Arc Menu:
Here is a nice little animated menu known as Arc Menu. It is based on a native java android library ArcMenu Java Lib. I initially tried to wrap the java library, but my skills weren't up to the job on the day, so I decided to create my own incarnation in b4a code as a class. It is very customizable and I think it adds a nice effect to any User Interface. This should be nice and easy to use. The only methods that are required are the Initialize and at least 1 x AddItem (whats a menu without any menu items)
ScreenShots:
Documentation:
ArcMenu
Version: 1
Below I have added both the class (in a demo project) AND the library, both have the same functionality. I added both so you as the user can choose which to use. The library is the easiest to use, just install as any other library. The class is there if you wish to view / edit the code. This is my first attempt at animations, so hopefully others could learn from it too. Enjoy!
Note: This does require the Animation Plus v2 library to be installed too.
Here is a nice little animated menu known as Arc Menu. It is based on a native java android library ArcMenu Java Lib. I initially tried to wrap the java library, but my skills weren't up to the job on the day, so I decided to create my own incarnation in b4a code as a class. It is very customizable and I think it adds a nice effect to any User Interface. This should be nice and easy to use. The only methods that are required are the Initialize and at least 1 x AddItem (whats a menu without any menu items)
ScreenShots:
Documentation:
ArcMenu
Version: 1
- Methods:
- IsInitialized As Boolean
Tests whether the object has been initialized.
- _additem (ItemImage As BitmapWrapper) As String
Adds an item to the menu.
ItemImage - the image shown as the MenuItem
- _initialize (Activity As ActivityWrapper, Module As Object, EventName As String, AnimatedButtonImage As BitmapWrapper, StaticButtonImage As BitmapWrapper, x As Int, y As Int) As String
Initializes the object.
Parameters:
Activity - The activity to add the OrbitalMenu to. Use 'Activity' to pass the current activity.
Module - Use 'Me'
EventName - The EventName to be use for callbacks.
_AnimationEnd(Open as Boolean) - this event triggers once the menu has finished expanding or collapsing.
Open - will return whether the menu is open or not.
_Click(Position as Int)
_LongClick(Position as Int)
Position - returns the Item Position that triggered the event. First Item = 1.
StaticButtonImage - A static background for the menu button. Use NULL for no image.
AnimatedButtonImage - A bitmap that will show in front of the StaticBackgroundImage and will rotate 90 degrees when pressed. Use NULL for no image.
x, y - The coordinates for where the button will appear.
- _isopen As Boolean
- _setanimatedbuttondimensions (width As Int, height As Int) As String
Use to override the dimensions of the AnimatedButtonImage
Defaults are 20dip x 20dip
- _setdegreespan (value As Int) As String
Sets the amount of degrees the MenuItems Orbit will span from the starting point.
Default is 90
- _setmenuitemdimensions (width As Int, height As Int) As String
NOTE: Must be called before Adding and items to the menu.
Use to override the dimensions of the menu items.
Defaults are 40dip x 40dip
- _setmenuitemradius (value As Int) As String
Use to set the Menu item radius (the distance the items pop out from center)
Default is 120dip
- _setstartdegrees (value As Int) As String
Sets the angle the MenuItems Orbit will start at.
Default is 0 (straight up.)
- _setstaticbuttondimensions (width As Int, height As Int) As String
Use to override the dimensions of the StaticButtonImage
Defaults are 20dip x 20dip
- _toggle As String
Simulates a Click of the menu Button
- IsInitialized As Boolean
Below I have added both the class (in a demo project) AND the library, both have the same functionality. I added both so you as the user can choose which to use. The library is the easiest to use, just install as any other library. The class is there if you wish to view / edit the code. This is my first attempt at animations, so hopefully others could learn from it too. Enjoy!
Note: This does require the Animation Plus v2 library to be installed too.
Attachments
Last edited: