Hi,
Presently, in my B4XPages app I have the Action Bar with a 'Blue' background with 'White' foreground text and it is extremely well readable.
Ps. note: I referred Erel's Post in this regard.
However, when I add a Menu-item to it, the background colour of the Menu Item is 'White' and the Foreground is also 'White' and so it is not readable.
My manifest entries are:
Suppose I change the textColorPrimary to 'Black' say, then the text in the Menu Item becomes visible (since it is 'Black' over 'White') but the Text in the Status Bar is not readable at all ('Black' over 'Blue')...
So is it possible to:
i) change the Background color of the Menu Item to the same as the Action/ Status Bar colour i.e. 'Blue' so that the Menu item is visible and the 'textColorPrimary can be kept as 'White' only(in my case)..
ii)change the foreground color of only the Menu Item Text to some other color eg. Red(so that Red looks readable over White) Without changing the Foreground Text color of the Action/Status Bar (which remains White in my case)?
iii) thirdly, in the Themes example given by Erel, an Icon is added to the status bar with the Code ...
However, the B4XPages does not provide this Method to add an Icon...
It has : B4XPages.AddMenuItem( Me, "Home")
So how can we add an Icon to the Status Bar in a B4X Pages App and then invoke its click event via code ?
Ps. I do not want to change the 'Blue' colour of the Status Bar since it gels well with my App.
Requesting for guidance on the same,
Thanks.
Presently, in my B4XPages app I have the Action Bar with a 'Blue' background with 'White' foreground text and it is extremely well readable.
Ps. note: I referred Erel's Post in this regard.
Theme Colors
Changing the action bar, status bar and navigation bar colors is done with resources set in the manifest editor. The following code is fully supported by Android 5+ devices but it will also work properly on Android 4 devices. The manifest code: SetApplicationAttribute(android:theme...
www.b4x.com
However, when I add a Menu-item to it, the background colour of the Menu Item is 'White' and the Foreground is also 'White' and so it is not readable.
My manifest entries are:
B4X:
CreateResource(values, colors.xml,
<resources>
<color name="actionbar">#0000FF</color> 'blue
<color name="statusbar">#0000FF</color> 'blue
<color name="textColorPrimary">#FFFFFFFF</color> 'white
<color name="navigationBar">#0000FF</color> 'blue
<color name="window">#FF5B7BFF</color>
</resources>
)
Suppose I change the textColorPrimary to 'Black' say, then the text in the Menu Item becomes visible (since it is 'Black' over 'White') but the Text in the Status Bar is not readable at all ('Black' over 'Blue')...
So is it possible to:
i) change the Background color of the Menu Item to the same as the Action/ Status Bar colour i.e. 'Blue' so that the Menu item is visible and the 'textColorPrimary can be kept as 'White' only(in my case)..
ii)change the foreground color of only the Menu Item Text to some other color eg. Red(so that Red looks readable over White) Without changing the Foreground Text color of the Action/Status Bar (which remains White in my case)?
iii) thirdly, in the Themes example given by Erel, an Icon is added to the status bar with the Code ...
B4X:
Activity.AddMenuItem3("", "refresh", LoadBitmapResize(File.DirAssets, "ic_cached_white_24dp.png", 32dip, 32dip, True), True)
However, the B4XPages does not provide this Method to add an Icon...
It has : B4XPages.AddMenuItem( Me, "Home")
So how can we add an Icon to the Status Bar in a B4X Pages App and then invoke its click event via code ?
Ps. I do not want to change the 'Blue' colour of the Status Bar since it gels well with my App.
Requesting for guidance on the same,
Thanks.
Last edited: