B4A Library Arc Menu [Class] + [Lib]

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:

screen1.jpg screen2.jpg screen3.jpg screen4.jpg

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

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

  • ArcMenuClass.zip
    60.1 KB · Views: 1,493
  • ArcMenuLib.zip
    6.7 KB · Views: 1,397
Last edited:

Informatix

Expert
Licensed User
Longtime User
I'm removing some of my donationwares from the B4A forum because I have a lot of downloads but almost no donation. It seems that most people did not understand what "donationware" means.
Unfortunately for your class, AnimationPlus v2 is going to be removed.
Since I don't know the nickname of all of my donators, I'm unable to say if you're one of them. If it's the case, I will try to find a solution for your nice class.
 

barx

Well-Known Member
Licensed User
Longtime User
I'm removing some of my donationwares from the B4A forum because I have a lot of downloads but almost no donation. It seems that most people did not understand what "donationware" means.
Unfortunately for your class, AnimationPlus v2 is going to be removed.
Since I don't know the nickname of all of my donators, I'm unable to say if you're one of them. If it's the case, I will try to find a solution for your nice class.

Hi Informatix,

I had a feeling this may have upset you and to be honest I have spent hours thinking about the best solution. I was going to re-write the class to use the Tween Engine instead but that would restrict the use of it to > honeycomb. The only things required from the v2 lib are persist after (which could be implemented with the reflection lib and Animation Sets. I guess it's time for a re-think. I too have experienced the same as you with donationware. My notification builder lib. 112 downloads, 2 donations. I don't mind. I'm not in it for the money (if I was I would have put a price tag on it).

I will be honest, I personally haven't yet donated on this lib for 2 reasons. 1) i'm not personally using it yet. I have created something that does use it and passed that back to the community. 2) I don't think the fact that by me donating, the outcome would be any different. At the end of the day, others would still need your lib and my donation wouldnt pay their way.

Sorry if this has upset you in any way. I won't be removing the class as I still think it shows those that do have rights to the animation plus libs the possibilities of it and how to implement some of its great features.

Hope you understand.
 
Last edited:

barx

Well-Known Member
Licensed User
Longtime User
Also, I was going to originally release this as donationware. But I decided not to in the hope that any donations that would be offered would come your way.

I guess it just wasn't meant to be.
 

Informatix

Expert
Licensed User
Longtime User
That has nothing to do with you. It's a decision I took two weeks ago. I wanted to change a few things after mid-April. The UltimateListView experience proved me that a library with no demo and no trial version can be a success when there's a real need for it.
But I'm really annoyed now. Because, contrary to the classes and libraries I saw these last weeks in this forum, this one is really new, nice and well done (it's a clone of a Java library but who cares?). I don't even exclude from using it in one of my project someday, so I'm going to find a solution.

EDIT: send me an email with your own email address and I'll send you the code that you need.
 
Last edited:

barx

Well-Known Member
Licensed User
Longtime User
That has nothing to do with you. It's a decision I took two weeks ago. I wanted to change a few things after mid-April. The UltimateListView experience proved me that a library with no demo and no trial version can be a success when there's a real need for it.
But I'm really annoyed now. Because, contrary to the classes and libraries I saw these last weeks in this forum, this one is really new, nice and well done (it's a clone of a Java library but who cares?). I don't even exclude from using it in one of my project someday, so I'm going to find a solution.

EDIT: send me an email with your own email address and I'll send you the code that you need.

Thanks for your response and it appears I have taken it personal without finding all the details. This post clears that up. Thanks for explaining and I hope you will accept my apology. I will send you an email once I have posted this and I would really appreciate such a solution.....
 

bluedude

Well-Known Member
Licensed User
Longtime User
So in the end we cannot use it?

Hi,

Great stuff but I don't have Animationplus v2 and I just see that one will be deleted soon.

Not sure about donation ware, I guess there are ways to make money from work you guys do.

I hope I can use this Arclib soon and be able to get the AnimationPlus v2.

Cheers,
 

jiangws

Member
Licensed User
Longtime User
Hi Informatix,

You can change donationwares to chargable if you need money to maintain your libs.

I'm removing some of my donationwares from the B4A forum because I have a lot of downloads but almost no donation. It seems that most people did not understand what "donationware" means.
Unfortunately for your class, AnimationPlus v2 is going to be removed.
Since I don't know the nickname of all of my donators, I'm unable to say if you're one of them. If it's the case, I will try to find a solution for your nice class.
 

bluedude

Well-Known Member
Licensed User
Longtime User
Works but not in combination with AHViewPager

Hi,

Got it working but unfortunately it does not work with the AHViewPager lib.

Cheers,
 

susu

Well-Known Member
Licensed User
Longtime User
Thank you both of you: Barx & Infomatix :D
 

Gary Milne

Active Member
Licensed User
Longtime User
I'm interested in having an Arc menu in my app. Don't mind donating for a good library but not sure of
A) is animationplus 2.0 actually available even through donation.
B) does the ArcMenu class still have a dependency on animationplus 2.0. This thread indicated there may have been an alternate solution shared.
C) does any of this still work 15 months on from its creation.

Thanks.
 

Gary Milne

Active Member
Licensed User
Longtime User
AnimationPlus 2 is freely available.
Would you mind posting a link. It's not coming up readily on a google search using "animationplus 2.0 b4a", just the prior version.

Thanks.
 
Top