[B4X] [XUI] AS Bottom Menu V2

sigster

Active Member
Licensed User
Longtime User
Hi

how can I set button 2 ASBottomMenu1.SetIcon2 default when I open the app
 

sigster

Active Member
Licensed User
Longtime User
Button 1 is default selected when I open the app but I want button 2 to be selected

see screenshot


 

Alexander Stolte

Expert
Licensed User
Longtime User
set the "setCurrentTab" to 1.
But if you use this view without the middle button, i recommend this view:
 

sigster

Active Member
Licensed User
Longtime User
do you mean setCurrentTab 2 ?

I did try to use ASBottomMenu1.setCurrentTab(1) or 2

nothing change


B4X:
    ASBottomMenu1.SetIcon1(LoadBitmap(File.DirAssets,"home2.png"))
    ASBottomMenu1.SetIcon2(LoadBitmap(File.DirAssets,"chat.png"))
    ASBottomMenu1.MiddleButtonIcon = xui.LoadBitmap(File.DirAssets,"home2.png")
    ASBottomMenu1.UnderlineAnimation = "Normal"
    ASBottomMenu1.setMiddleButtonSize(65dip,2dip)
    ASBottomMenu1.MiddleButtonVisible = False
 
    ASBottomMenu1.setCurrentTab(1)


this is the button I want to be default when the app load, I manual select the button before take screenshot
 
Last edited:

syerif

Active Member
Licensed User
Longtime User
how to set unselected icon color?
 

james_sgp

Active Member
Licensed User
Longtime User
How to change the font size for the badges...its too large (see attached)

 

CryoGenID

Active Member
Licensed User
Longtime User
Hello Alexander,

again here is a great library from you... Really impressive
One question though:
How can I set the background color of the middle button via code? I can see the color in the designer but I don't know how to set it from code?
And how can I set the default color of the text in the default tab in the menu via code?
Per default it is green, I can set it via
B4X:
ASBottomMenu__main.SelectedPageIconColor= xui.Color_Cyan
but that only applies when I click it once...
Per default it looks like this:

When I clicked on it once, then it uses the color from "SelectedPageIconColor":

But I would like it to be in that color from the beginning...

Thanks

Best regards,

Chris
 
Last edited:

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • V2.9
    • Add get and set MiddleButtonBackgroundColor - Changes the middle button color
And how can I set the default color of the text in the default tab in the menu via code?
with SelectedPageIconColor is text and icon color are the same, there is no way to have a other text color than the icon color.
B4X:
SelectedPageIconColor
But I would like it to be in that color from the beginning...
There are only 2 colors, the unselected color and the selected color, if you don't want the selected color, you can disable it in the designer with EnableSelectedPageColor = False

Since it is a very old library, with some questionable decisions by me back then, I can only give limited support. Small things I can change, but deep things I don't want to change anymore.
 

CryoGenID

Active Member
Licensed User
Longtime User
Hello Alexander,

thanks so much for your quick reaction!
I find this library (optically) really beautiful!
The other library with a bottom menu looks (from the examples) not so beautiful...

Would a re-write of this library be possible or can I do everything from this lib with the other as well?

But regarding my question and your answer:
When I set "EnableSelectedPageColor" to OFF, then the green is gone, but the of course the selectedColor as well ;-)
No chance to set the "UnselectedPageColor" via Code somewhere or did I just miss it?

And one other question:
Can I also "disable" a menu item or would I need to do this manually by changing the font color and simply ignoring any clicks on it?

Again thanks so much

Best regards,

Chris
 

Alexander Stolte

Expert
Licensed User
Longtime User
Would a re-write of this library be possible or can I do everything from this lib with the other as well?
No and no.
The other lib. is without middle button. But you can also just put a button in the middle or on the far right.

Update
  • V2.10
    • Add designer property UnselectedPageColor
    • Add DisableTab
    • Add EnableTab
    • Add Designer Property DisabledPageColor
No chance to set the "UnselectedPageColor" via Code somewhere or did I just miss it?
UnselectedPageColor

Can I also "disable" a menu item or would I need to do this manually by changing the font color and simply ignoring any clicks on it?
DisableTab(1)
 

CryoGenID

Active Member
Licensed User
Longtime User
One other question:
What would I need to do so that the menu starts with no pre-selection?
All tabs are deactivated in the beginning via "DisableTab", but the first tab still shows up in Green with the white line beneath it:

Tab 2 is correctly deactivated...

Thanks

Best regards,

Chris
 

Alexander Stolte

Expert
Licensed User
Longtime User
What would I need to do so that the menu starts with no pre-selection?
All tabs are deactivated in the beginning via "DisableTab", but the first tab still shows up in Green with the white line beneath it:
does not work. (and also not easy to change, because this behavior is deep inside) makes absolutely no sense to me why you should do something like that, either you are on the 1st page or you are not on the 1st page, but then you also do not see the menu, because you are on another page.
 

CryoGenID

Active Member
Licensed User
Longtime User
Well in my case the main view controls the menu... So you do s.th. on the main view and based on the result of that, the tabs get activated (or not)... So the default startup state would be inactive for all tabs...

Hm... then I will have to think of some workaround ;-)

But again thanks for that lib, it is really great!
Besides the big button, I could do everything else with the newer lib as well if I understood you correctly (also designwise)?

Best regards,

Chris
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…