B4A Class ActionDrawer - ActionBar and NavDrawer Made Perfect

ActionDrawer is a combination of my own custom actionbar class and the native navigation drawer. It aims to be an extremely simple way for basic4android users to make quality apps which follow google's guidlines, while still allowing lots of customization.
Features include: Dark and light themes, dynamic fitting of the action buttons to the overflow menu(try rotating the demo app), the drawer and up indicators, and more.
ActionDrawer requires AHNavigationDrawer, the reflection library, and the drawables in the zip below.

NOTE: For version 2.0 I will be rewriting this class to make it more flexible and simple, and also adding some big features like pull to refresh, multiple navdrawers, and making it easier to add nice lists to the drawer. v2.0 will be incompatible with the current version, so you may want to wait instead of using the current class.

Update v1.01
- Fixed a bug where double-tapping and holding the home button would cause it to stay selected
v1.1
- Added tooltips! When the actionbar buttons are long-pressed a special toast message will be displayed
- fixed a title-shortening bug
v1.2
-Changed how click events work (you now specify the eventname when adding the button) as suggested by corwin42. This means that v1.2 is not fully compatible with previous versions
v1.21
-Made SectionTitle (string) and lTitle (label) public. Now you can change the actionbar title however you want

Screenshot_2013-08-24-12-05-32.png
 

Attachments

  • Screenshot_2013-08-24-12-06-03.png
    Screenshot_2013-08-24-12-06-03.png
    195.7 KB · Views: 2,637
  • Screenshot_2013-08-24-12-05-45.png
    Screenshot_2013-08-24-12-05-45.png
    166.1 KB · Views: 2,666
  • Screenshot_2013-08-24-12-05-17.png
    Screenshot_2013-08-24-12-05-17.png
    203.5 KB · Views: 2,482
  • ActionDrawer Demo.zip
    47.7 KB · Views: 1,351
Last edited:

Glen Ponder

Member
Licensed User
Longtime User
I'm adding a listview to the AD.DrawerPanel.Addview

The items in the listview are displayed in the drawer panel however I am struggling to capture the item click event. I initialize the listview with an Event however this does not fire when selecting an item.

Can you please point me in the right direction?

Many thanks
 

Glen Ponder

Member
Licensed User
Longtime User
I'm adding a listview to the AD.DrawerPanel.Addview

The items in the listview are displayed in the drawer panel however I am struggling to capture the item click event. I initialize the listview with an Event however this does not fire when selecting an item.

Can you please point me in the right direction?

Many thanks

Please ignore this. I was initializing the listview incorrectly. My bad.
 

asales

Expert
Licensed User
Longtime User
I get this error when opening the demo:

An error has ocurred in sub: java.lang.NoSuchFieldException: ic_overflow_white

How can I fix it?
 

luke2012

Well-Known Member
Licensed User
Longtime User
I'm trying to disable the click event on the "lTitle" lable but without success.
My target is to le the user tap on the menu icon / app icon on the left but not on the label (like new material design navdrawer).

Anyone can help me ? :)
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
I'm getting:
Cannot find: C:\Program Files (x86)\Basic4android\libraries\nineoldandroid-2.4.0.jar
Even after installing that plugin
 

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
I'm getting an error saying NineOldAndroid is necesary.
I download it but the error persist

ERROR : A referenced library is missing: nineoldandroid-2.4.0
 

Attachments

  • 2015-06-05_1015.png
    2015-06-05_1015.png
    5.5 KB · Views: 220

Haris Hafeez

Active Member
Licensed User
Longtime User
I'm getting an error saying NineOldAndroid is necesary.
I download it but the error persist

ERROR : A referenced library is missing: nineoldandroid-2.4.0

When you download the nine old android jar, the file name contains and 's' in the end, like nineoldandoids-2.4.0.jar. Remove the 's' from the filename. At least that's what I had to do to get it working.
 

ArminKH

Well-Known Member
can this class be modiffied for write to left language ?
 

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
I cant make it work...
Compiling in Release mode... clicking in the menu I get this error. and I even cant click in No or Yes
Compiling in Debug Rapid or legacy... worst! while installing the phone is restarted!
 

Attachments

  • FlashAnnotate.jpg
    FlashAnnotate.jpg
    226 KB · Views: 206

Andre Souza

Member
Licensed User
Hello
How disable/enable icon in toolbar?

Example
AD.AddAction("Search", "Search_Click", "ic_search.png")
 

jchal

Active Member
Licensed User
Longtime User
when i cliked on the top left where the ADActivity is i got the following erros
An error occurred:
(Line: 0) null
java.lang.Exception: Sub drawer_drawerslide signature does not match expected signature.
public static anywheresoftware.b4a.pc.RemoteObject actn.drwr.actiondrawer_subs_0._drawer_drawerslide(anywheresoftware.b4a.pc.RemoteObject,anywheresoftware.b4a.pc.RemoteObject) throws java.lang.Exception
what is the error?
 
Top