You have a demo, you have the source code of the class, you have the solution. And you want me to write your code? You're kidding?Hi @Informatix can you give me an example code please?
You have a demo, you have the source code of the class, you have the solution. And you want me to write your code? You're kidding?Hi @Informatix can you give me an example code please?
No, I don't want you to write the code I just wanted to point me out in the write direction.You have a demo, you have the source code of the class, you have the solution. And you want me to write your code? You're kidding?
Dim btn_home As View
Dim btn_qlist As View
Dim btn_appinfo As View
Dim btn_settings As View
btn_home = AB.AddButton(LoadBitmap(File.DirAssets, "home.png"), "", 2, 1, "Home_Click", "")
AB.SetText(btn_home, "Home", Colors.Yellow, -1)
btn_qlist = AB.AddButton(LoadBitmap(File.DirAssets, "listQ.png"), "Q-List", 2, 2, "QueueList_Click", "")
btn_appinfo = AB.AddButton(LoadBitmap(File.DirAssets, "info.png"), "App Info", 2, 3, "Info_Click", "")
btn_settings = AB.AddButton(LoadBitmap(File.DirAssets, "rsettings.png"), "Settings", 2, 4, "Settings_Click", "")
Sub Home_Click(ActionBar As ClsActionBar, Btn As View)
' We remove everything from the action bar before displaying a new style
AB.SetText(btn_home, "Home", Colors.Yellow, -1)
AB.SetText(btn_qlist, "Q-List", Colors.White, -1)
AB.SetText(btn_settings, "Settings", Colors.White, -1)
End Sub
Your code should work.No, I don't want you to write the code I just wanted to point me out in the write direction.
I have done what you asked me to do but it does not work.
I created 4 global variables for this.
Then in activity create I have the followingB4X:Dim btn_home As View Dim btn_qlist As View Dim btn_appinfo As View Dim btn_settings As View
Then in the button clcickB4X:btn_home = AB.AddButton(LoadBitmap(File.DirAssets, "home.png"), "", 2, 1, "Home_Click", "") AB.SetText(btn_home, "Home", Colors.Yellow, -1) btn_qlist = AB.AddButton(LoadBitmap(File.DirAssets, "listQ.png"), "Q-List", 2, 2, "QueueList_Click", "") btn_appinfo = AB.AddButton(LoadBitmap(File.DirAssets, "info.png"), "App Info", 2, 3, "Info_Click", "") btn_settings = AB.AddButton(LoadBitmap(File.DirAssets, "rsettings.png"), "Settings", 2, 4, "Settings_Click", "")
And I do the above for the other buttons and it does not work @Informatix !!!B4X:Sub Home_Click(ActionBar As ClsActionBar, Btn As View) ' We remove everything from the action bar before displaying a new style AB.SetText(btn_home, "Home", Colors.Yellow, -1) AB.SetText(btn_qlist, "Q-List", Colors.White, -1) AB.SetText(btn_settings, "Settings", Colors.White, -1) End Sub
@Informatix I think it does not like colors.white because I tried different collors and it worked. So what is the default color for white?
Your code should work.
If I do these changes to the demo:
- I add "Dim BtnFavorite As View" to Globals
- I add "BtnFavorite=" before "AB.AddButton(LoadBitmap(File.DirAssets, "tab_normal.png"), "Favorite", 5, 2, "Tab_Click", "Star_LongClick")"
- I add "AB.SetText(BtnFavorite, "Favorite", Colors.Blue, -1)" in Tab_Click(...)
Then the Favorite word becomes blue when I click on any tab (with the Tab style).
Because Colors.White = -1. I didn't notice it when I did the class. If you set the color to Colors.RGB(254,254,254), the result will be visually white but the value of the color will be different from -1.As I edited my previous post, it works with any color apart from colors.white, I cannot put it back to the default color
Thanks Colors.RGB(254,254,254) worked fineBecause Colors.White = -1. I didn't notice it when I did the class. If you set the color to Colors.RGB(254,254,254), the result will be visually white but the value of the color will be different from -1.