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: 705
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Attached are the examples for B4A, B4J, B4i

B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Layout1")
    BottoMenu1.AddMenu(Chr(0xF009),xui.CreateFontAwesome(18))
    BottoMenu1.AddMenu(Chr(0xF0CA),xui.CreateFontAwesome(18))
    BottoMenu1.AddMenu(Chr(0xF0EC),xui.CreateFontAwesome(18))
    BottoMenu1.AddMenu(Chr(0xF096),xui.CreateFontAwesome(18))
    BottoMenu1.AddMenu(Chr(0xF2C0),xui.CreateFontAwesome(18))
End Sub

Sub BottoMenu1_Selected(Value As Int)
    Log(Value)
End Sub
 

Attachments

  • jSample1.zip
    2.2 KB · Views: 444
  • iSample1.zip
    110.3 KB · Views: 422
  • aSample1.zip
    9.6 KB · Views: 582
  • iSample2.zip
    113.1 KB · Views: 252
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
The circle animation is flickering.
View attachment 77627
It's made on purpose. Find a second animation in the example.
But you can use others that you find in the forum as BITMAPCREATOR EFFECT

B4X:
    TransitionAnimated(200,GenerateBitmapSelected("",xui.Color_Black,xui.CreateDefaultBoldFont(16)),GenerateBitmapSelected(M.Get("CharText"),xui.Color_Black,M.Get("Font")),Slct)
 

Brandsum

Well-Known Member
Licensed User
It's made on purpose. Find a second animation in the example.
But you can use others that you find in the forum as BITMAPCREATOR EFFECT

B4X:
    TransitionAnimated(200,GenerateBitmapSelected("",xui.Color_Black,xui.CreateDefaultBoldFont(16)),GenerateBitmapSelected(M.Get("CharText"),xui.Color_Black,M.Get("Font")),Slct)
Not that icon animation, but the white circle and the curve beside the circle.
 

Star-Dust

Expert
Licensed User
Longtime User
Not that icon animation, but the white circle and the curve beside the circle.
It makes no flicker for me.
Show me exactly the defect.

However I have provided the source, you can see the code yourself and modify it for your device.
But I saw that you accepted the challenge of creating a menu similar to this ... I suggest you to start from scratch without seeing mine ;)
 

Star-Dust

Expert
Licensed User
Longtime User
However if you see the grainy circle in your device then you simply need to increase the resolution of the images it creates (sub GenerateBitmap)
 
Last edited:

Brandsum

Well-Known Member
Licensed User
But I saw that you accepted the challenge of creating a menu similar to this

Sorry! but I haven't accepted any challenge.:) I have already started to work on that menu before you posted your work. That's why I don't want to move my incompleted work to trash.
I suggest you to start from scratch without seeing mine
Oh sure!! I will not copy your code. :p
 

Star-Dust

Expert
Licensed User
Longtime User
Sorry! but I haven't accepted any challenge.:) I have already started to work on that menu before you posted your work. That's why I don't want to move my incompleted work to trash.

Oh sure!! I will not copy your code. :p
It is not a problem that others take my code, I have made available the source because I also wish others can take advantage of it, modifying it, improving it or learning some notion.

In case you had accepted the challenge then the question would have been different, but you explained to me that this is not the case
 

Star-Dust

Expert
Licensed User
Longtime User
I improved the code and enlarged the selection sphere. I attach the code
(Now also for B4J)

Video3.gif
 

Attachments

  • Sample2.zip
    11.8 KB · Views: 506
Last edited:

Kope

Active Member
Licensed User
B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Layout1")
    BottoMenu1.AddMenu(Chr(0xF009),xui.CreateFontAwesome(18))
    BottoMenu1.AddMenu(Chr(0xF0CA),xui.CreateFontAwesome(18))
    BottoMenu1.AddMenu(Chr(0xF0EC),xui.CreateFontAwesome(18))
    BottoMenu1.AddMenu(Chr(0xF096),xui.CreateFontAwesome(18))
    BottoMenu1.AddMenu(Chr(0xF2C0),xui.CreateFontAwesome(18))
End Sub

Sub BottoMenu1_Selected(Value As Int)
    Log(Value)
End Sub

Great Job!!
Can you please help with how to navigate to another activity or layout?
thank you
 

Star-Dust

Expert
Licensed User
Longtime User

Attachments

  • SD_BottoMenu 1.1.zip
    12.3 KB · Views: 530

Kope

Active Member
Licensed User

Wow!! that was quick and amazing
but wanted to know if it would be possible to navigate between Activities and or Layouts other than Panels on the Same Layout
Thank You
 

Star-Dust

Expert
Licensed User
Longtime User
Wow!! that was quick and amazing
but wanted to know if it would be possible to navigate between Activities and or Layouts other than Panels on the Same Layout
Thank You
Maybe I did not understand what you want to get. Spice better or show a picture that illustrates it
 

Marlou Fin

Member
Licensed User
Hi Star-Dust, what his trying to say is that, how we can navigate or call other layout or form everytime you click the button? and also how can we add another icon in the button?
 

Star-Dust

Expert
Licensed User
Longtime User
Hi Star-Dust, what his trying to say is that, how we can navigate or call other layout or form everytime you click the button? and also how can we add another icon in the button?
In the example at post#13, each button calls a different Layout.

The buttons can be changed simply by changing the character FontAwesone, then you can also modify the code and insert images instead of text.

But you have to develop all of this, otherwise you can not learn and improve your skills :D
 
Last edited:

Marlou Fin

Member
Licensed User
Thanks Star-Dust for the tips, just last question, where you can get a table for this one Chr(0xF009)?
 

Star-Dust

Expert
Licensed User
Longtime User
Click sx Mouse Button
upload_2019-2-25_17-24-36.png
 

Attachments

  • upload_2019-2-25_17-23-44.png
    upload_2019-2-25_17-23-44.png
    27 KB · Views: 315

Marlou Fin

Member
Licensed User
Hayz, sorry for my ignorance Star-Dust, I thought need to get the value from the unicode something! hehehe! anyway I got it. Thanks very much
 
Top