Page 1 of 1

Change the color of the android native bar.

Posted: Thu Sep 12, 2019 1:00 am
by Jellobus
Hello,

Is it possible to change the color of the android native button bar? I like to change grey to black so that the color theme would match my app.

Thanks in advance!

Re: Change the color of the android native bar.

Posted: Thu Sep 12, 2019 8:29 am
by bogs
Just as a guess I'd think it would not be allowed by the android OS.

Re: Change the color of the android native bar.

Posted: Thu Sep 12, 2019 8:47 am
by FourthWorld
In the Colors tab of the Inspector you should have an option for setting the Background Color, no?

Re: Change the color of the android native bar.

Posted: Tue Sep 17, 2019 5:01 pm
by Jellobus
Hi bogs, FourthWorld,

I tested by setting all colors black in the inspector, but the color of the navigation bar does not change. Any walkaround with manifest file?

Re: Change the color of the android native bar.

Posted: Tue Sep 17, 2019 5:57 pm
by FourthWorld
I don't know of a workaround. The best I can recommend is to dive into the widget code to fix it, or submit a bug report for the team to do so.

Re: Change the color of the android native bar.

Posted: Tue Sep 17, 2019 6:34 pm
by bogs
Sorry Jellobus, I don't dev for mobile of any kind, but as I said in my first post, since the nav bar is provided by the Android OS, and not Lc, I really doubt there is any way you are going to change anything about it. Just an opinion on my part.

There *is* an api for it, which you can find out about here...
setNavigationBarColor
Added in API level 21

public abstract void setNavigationBarColor (int color)

Sets the color of the navigation bar to . For this to take effect, the window must be drawing the system bar backgrounds with WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS and WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION must not be set. If is not opaque, consider setting View.SYSTEM_UI_FLAG_LAYOUT_STABLE and View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION.

The transitionName for the view background will be "android:navigation:background".

Related XML Attributes:

android:navigationBarColor
...but I have no idea whether Lc can take advantage of that or not. Maybe Jacque (or someone that actually builds stuff for android) knows :? but I really really doubt it is a bug, per se, since it is not part of your app.

Re: Change the color of the android native bar.

Posted: Tue Sep 17, 2019 6:58 pm
by FourthWorld
Good find, Bogs.

Widgets are written in LiveCode Builder, which provides a scripting interface for OS APIs, so this seems quite doable.

Whether this is a bug per se or an enhancement request may be a matter of opinion. Personally, since the color is unresponsive to the UI provided in the Inspector I'd consider it a bug.

But either way, unless someone here is in a position to add support for that to the widget a bug report will be needed to bring it to the team's attention.

Re: Change the color of the android native bar.

Posted: Sat Sep 28, 2019 4:27 pm
by Jellobus
Thanks guys,

I have reported it a bug to the quality control center.

https://quality.livecode.com/show_bug.cgi?id=22394

Cheers,

Louis