Change the color of the android native bar.

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Jellobus
Posts: 319
Joined: Tue Dec 10, 2013 2:53 pm

Change the color of the android native bar.

Post 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!
Attachments
nativeButtons.png
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Change the color of the android native bar.

Post by bogs »

Just as a guess I'd think it would not be allowed by the android OS.
Image
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Change the color of the android native bar.

Post by FourthWorld »

In the Colors tab of the Inspector you should have an option for setting the Background Color, no?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Jellobus
Posts: 319
Joined: Tue Dec 10, 2013 2:53 pm

Re: Change the color of the android native bar.

Post 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?
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Change the color of the android native bar.

Post 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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Change the color of the android native bar.

Post 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.
Image
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Change the color of the android native bar.

Post 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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Jellobus
Posts: 319
Joined: Tue Dec 10, 2013 2:53 pm

Re: Change the color of the android native bar.

Post 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
Post Reply