Skip to content
Advertisement

How to make title background transparent on android app

There is an issue in the follow Android App where guidance is greatly appreciated. This application is to support a Renesas RX130 microcontroller and Texas Instrument CC2650 Bluetooth Low Energy hardware demonstration design. In the initial device scanning page the tile has a bright red background as shown below.

enter image description here

The tool bar has a Purple to Red gradient background.

Question: How can the Red Tile background be made transparent?

The application has two activities. Below are excepts from the AndroidManifest.xml file

JavaScript

Code from activity_main.xml, listitem.xml, toolbar.xml and MainActivity.java generated the first activity. Relevant sections of code is from the files are below.

Excepts from activity_main.xml

JavaScript

Excepts from toolbar.xml

JavaScript

Excepts from MainActivity.java

JavaScript

The complete project is available on github Android_Mobile_App_RX130_CC2650


References:

Advertisement

Answer

There is a conflict in color from multiple source to background.

Don’t use theme unless if needed, as

  • theme influence all the views and layouts inside the toolbar

  • style influence only the toolbar and does not interfere with views and layouts inside toolbar

Please try below options, one of which might work for you,

Option 1 (preferred): update CustomerToolbarStyle code as below

JavaScript

update toolbar.xml code as below

JavaScript

Option 2: set transparent background in CustomerToolbarStyle

JavaScript

Option 3: remove android:background from the CustomerToolbarStyle

JavaScript

Option 4: remove app:theme="@style/CustomerToolbarStyle" from toolbar.xml

If above options not working, please check below links

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement