B4A Class [B4X] [XUI] SD BottoMenu (with source code)

SD_BottoMenu (update)

Author: Star-Dust
Version: 1.6
  • BottoMenu
    • Events:
      • Selected (Value As Int)
    • Fields:
      • BackGroundColor As Int
      • Position As Int
        ' get or set Position
    • Functions:
      • AddMenu (CharText As String, FontName As B4XFont) As String
      • Class_Globals As String
      • Clear As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • Initialize (Callback As Object, EventName As String) As String
      • Invalidate As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • SetValueAt(Position As Int, CharText As String, FontName As B4XFont)
      • TransitionAnimated (Duration As Int, FromBmp As B4XBitmap, ToBmp As B4XBitmap, ImageView As B4XView) As ResumableSub
Video1.gif
IMG_0110.PNG
Video4.gif
 

Attachments

  • SD_BottoMenu.b4xlib
    4 KB · Views: 317
Last edited:

willbr2k

Member
Licensed User
Hello Star-Dust! Nice a set menu, this is exactly what I was looking for! But I have a question, How do the menu return to the first position? I put it in the bottomenu1.position, but that does not work.
 

Star-Dust

Expert
Licensed User
I have updated the code to version 1.1

Now you can set the position or simply read it with BottoMenu.Position
 

Star-Dust

Expert
Licensed User
Tip: Create a single thread with [B4X] prefix and post the library as a b4xlib. It will be easier for you to maintain.
I will do it, unfortunately I have yet to learn how to do it, but it is planned. :D
 

Star-Dust

Expert
Licensed User
update rel 1.3 (post#1)
Video4.gif
 

Carlos marin

Active Member
Licensed User
I get an error when launching the app in release
java.lang.RuntimeException: java.lang.RuntimeException: Field bottomenu1 was declared with the wrong type.
 

Star-Dust

Expert
Licensed User
hi how can i move it from code? try with BottoMenu1.Position = 1 but it does not work
Yes, you can.
I get an error when launching the app in release
java.lang.RuntimeException: java.lang.RuntimeException: Field bottomenu1 was declared with the wrong type.
I need to see the code to figure out where you went wrong.

Does the example work for you?
 

Star-Dust

Expert
Licensed User
hello dear, and solve the error. Can you tell me how I can move from code?
The code you used is correct.
But you're probably not using the latest version.

Then update the library.
If you want to use the old version after the change of position use the Invalidate method
 

Carlos marin

Active Member
Licensed User
hi star-dust
if you mean this file SD_BottoMenu.b4xlib, I do not know how to update it or where I can download it
 

Kope

Member
Licensed User
Hi @Star-Dust , you’re really amazing. Have used this Bottom Menu is most of my projects but had some little issues with regards to:
1. changing the icon on each tab
2. adding titles to each tab

Please guide me on how to resolve these issues.

Thanks in advance for your help.
 

Star-Dust

Expert
Licensed User
To change the icon I entered a new method (update to post#1)
SetValueAt(Position As Int, CharText As String, FontName As B4XFont)

As for having a title under the image, it's not expected because it's not a TAB View but a BottonMenu
 

hatzisn

Well-Known Member
Licensed User
Complimenti Star-Dust, you 're the man!!! Very nice job. Very handy view. I discovered a bug. When you click a menu item and click another after a fraction of the second the menu gets totally confused and the circle with the clicked item goes cuckoo (pazzo)... Try it once or two times. It must be something in the animation. Congratulations again.
 

Star-Dust

Expert
Licensed User
Update 1.41
  • Solved a bug in the animation. If another option is clicked while the animation has not yet finished, the click is ignored
 

CaptKronos

Active Member
Licensed User
V1.41 seems to be buggy. (I haven't tried previous versions.) Creating a new project with just the code from post #2 and then clicking on the tabs, some tab icons disappear and then reappear, and then eventually the interface stops responding at all. I have attached a screenshot at the point the interface has become unresponsive and the 4th tab's icon has disappeared. And another screenshot showing tab 2's icon having been replaced with tab 1's icon.

bottommenu.jpg


bottommenu.jpg
 

Attachments

  • bottommenu.jpg
    bottommenu.jpg
    6.7 KB · Views: 53
Last edited:

Star-Dust

Expert
Licensed User
V1.41 seems to be buggy. (I haven't tried previous versions.) Creating a new project with just the code from post #2 and then clicking on the tabs, some tab icons disappear and then reappear, and then eventually the interface stops responding at all. I have attached a screenshot at the point the interface has become unresponsive and the 4th tab's icon has disappeared. And another screenshot showing tab 2's icon having been replaced with tab 1's icon.

View attachment 91011

View attachment 91013
I just tried it and it works properly. Maybe you did something wrong. I added a complete example in post # 2 you can download it and try it out
 

CaptKronos

Active Member
Licensed User
Just tried aSample1 from post #2 and the same problem. (Tab 3 and 4 has same icon.) I am definitely using v1.41. Testing using an S8.

bottommenu.jpg
 
Top