Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 3    Views: 735

Kingston
Aspiring developer
Profile
Posts: 118
Reg: Feb 01, 2013
New York
1,180
11/07/15 12:51 PM (8 years ago)

Android - Change Nav bar color.

Hi, Currently i am using Buzztouch 3.0 to develop my app I wanted to change the nav bar color to white in my Android app since it appears in black. Kindly suggest me how it has to be done.
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
11/07/15 04:22 PM (8 years ago)
Well, each and every plugin in Buzztouch has an option Top Navigation Bar and within it, there will be a field Background Color. Set your own color and that should be it, both on Android and iOS. For Android only, you can also set it directly in file BT_activity_host.java, in lines 1235 - 1238. If you want to set colors of the text in the navbar, have a look here: https://www.buzztouch.com/files/howtos/Color_in_action_bar_Android.pdf ====== Here's how I discovered that: -- I searched for the phrase "change navbar color android" -- Google did its thing and I selected this link to inspect: http://stackoverflow.com/questions/27589833/change-navigation-bar-color-android The advice there was to use line like this: window.setNavigationBarColor(getResources().getColor(R.color.red)); Aha! there is a special statement to change the navigation bar color and it is predictably called setNavigationBarColor. Since it is an official Android statement, there is a strong probability that David Book used exactly that word somewhere in the source code for Android. So fire up Android Studio and use this chain of commands: Edit >> Find >> Find in path... Enter setNavigationBarColor, click on OK and Studio will give you where that word is used, in BT_activity_host.java in line 1236. Line 1236 is ColorDrawable cd = new ColorDrawable(BT_color.getColorFromHexString(navBarBackgroundColor)); so let us search that text for navBarBackgroundColor. We'll find it in line 1205 String navBarBackgroundColor = BT_strings.getStyleValueForScreen(theScreenData, "navBarBackgroundColor", ""); from which we see that BT framework reads its value from server side variable navBarBackgroundColor. Search the HTML source code of any plugin and you will see where is it placed in the plugin parameters page.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/07/15 05:09 PM (8 years ago)
Nice tip, Dusko! I always get the best Android stuff from you! :) Cheers! -- Smug
 
Kingston
Aspiring developer
Profile
Posts: 118
Reg: Feb 01, 2013
New York
1,180
like
11/11/15 01:35 PM (8 years ago)
Hi All, Thanks Guys! the resolution works.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.