B4A Library LMenu - Dynamic icons menu

Hi guys, I'm happy to share, this library LMenu.
This library allows creating horizontal slider special menus

Features:

-Allows multiple rows of buttons/icons.
-Similar presentation to the Metro interface.
-Dynamic icons, you can allow the user place the buttons/icons where the preference at runtime.
-Create, delete, touch move and hide menu buttons/icons at runtime.

This Library doesn't need additional librarys.
This Library need b4android 3.8.2 version or higher.

Any idea, comment or thanks, will be appreciated.


LMenu
Author: Logic Data
Web: www.logicdata.es
Version: 1.0

  • LMenu
Events:
    • Click ()
    • LongClick ()
Methods:
    • ButtonsClickAnimation (Animate As Boolean)
      Activate/Deactivate Buttons Click Animation
    • CreateMenu (Parent As Activity, Left As Int, Top As Int, Width As Int, Height As Int, ButtonsHor As Int, ButtonsVer As Int, ActivateEdition As Boolean)
      Create Menu Object in the activity.
    • GetButtons As Map
      Get Map of menu buttons.
    • Initialize (YourActivityModule As Object, EventName As String)
      Initializes the Menu.
    • IsInitialized As Boolean
    • ButtonAdd (Tittle As String, Horizontalpos As Int, Verticalpos As Int, BackColor As Int, FolderPath As String, MainImage As String, ImageSec As String)
      Adds Button.
    • ButtonAdd2 (Tittle As String, Horizontalpos As Int, Verticalpos As Int, BackColor As Int)
      Adds Button without images.
    • ButtonGetIndex (Tittle As String) As Int
      Get the index of button.
    • ButtonGetTittle (Index As Int) As String
      Get the tittle of button.
    • ButtonRemove (Index As Int)
      Remove/Delete a button.
Properties:
    • BackGroundMenu As Int [write only]
      Sets menu background color
    • ButtonsClickAnimation (Animate As Boolean)
      Activate/Deactivate Buttons Click Animation
    • ButtonMainImageSize As Int [write only]
      Sets button main image size
    • ButtonSecImageSize As Int [write only]
      Sets button secundary image size
    • Isvisible As Boolean[read only]
      Get the visibility menu status
    • LabelButtonTextSize As Int [write only]
      Sets button text size
    • LabelButtonTextBackColor As Int [write only]
      Sets button text back colour
    • LabelButtonTextTypeface As Typeface [write only]
      Sets button text typeface
    • MaxHorizontalButtons As Int [write only]
      Set the maximum number of horizontal buttons
    • Visible (Makevisible As Boolean)
      Make visible/invisible the menu
    • VisibleScrollBar (Visibility As Boolean)
      Make visible/invisible the Menu Scroll Bar
    • ButtonEnabled (Index As Int, Enabled As Boolean)
      Enable/Disable a menu button.
    • ButtonIsVisible (Index As Int)As Boolean
      Get the visibility status of button.
    • ButtonVisible (Index As Int, IsButtonVisible As Boolean)
      Make the visibility status of button.
    • ButtonSelected As Int [read only]
      Get last selected button.
    • ButtonsCount As Int [read only]
      Get the number of buttons.
Example:
B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim TheMenu As LMenu
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")

    TheMenu.Initialize(Me,"TheMenu")
    TheMenu.ButtonAdd2("Reports",1,1,Colors.Magenta)
    TheMenu.ButtonAdd("Contacts",2,1,Colors.Gray,File.DirAssets,"address_book.png","button-cross-red-48.png")
    TheMenu.ButtonAdd("Messages",3,2,Colors.Gray,File.DirAssets,"balloon-red-48.png","")
    TheMenu.BackGroundMenu=Colors.Transparent
    TheMenu.LabelButtonTextBackColor=Colors.Yellow
    TheMenu.LabelButtonTextColor=Colors.Black
    TheMenu.MaxHorizontalButtons=4
    TheMenu.CreateMenu(Activity,0,40,480,400,2,3,False)
    TheMenu.ButtonsClickAnimation(True)

End Sub

Sub TheMenu_ButtonClick
    Msgbox(TheMenu.ButtonGetTitle(TheMenu.ButtonSelected),"")
End Sub

example1.png example2.png
 

Attachments

  • LMenu.zip
    10.2 KB · Views: 277
Last edited:

vampirbcn

Active Member
Licensed User
Longtime User
It does not work on b4a 3.00

java.lang.NoSuchMethodError: anywheresoftware.b4a.BA.isShellModeRuntimeCheck

Hello LucaMs,

The library has been developed in B4A 3.8.2, so it is possible that an older version can be problematic.

But if you want you can send the source code to review it!

Thank you
 

vampirbcn

Active Member
Licensed User
Longtime User
The source code is your example :(
:)

Hello Lucas,

I do not have version 3.0.0, but I installed the version 2.7.1 of b4android and this library is not supported. I have already put a note that version 3.8.2 of b4android or higher is required.

Thanks a lot
 
Top