This library will create a Compact ActionBar.
You can display a clickable Logo, a Menu button and up to 20 action buttons, the ActionBar can also auto-hide.
Requirements:
- B4A 6.x+
- Add the following files to your assets directory:
How to install:
- Copy the CustomCompactActionBar.jar and CustomCompactActionBar.xml to your additional libraries directory.
How to use:
The click events are captured by doing the following:
NOTE: This new version breaks previous versions, check the NEW library name (it is called now CustomCompactActionBar) and there are also additional parameters. Please check the attached sample for details.
Screenshots:
-
You can display a clickable Logo, a Menu button and up to 20 action buttons, the ActionBar can also auto-hide.
Requirements:
- B4A 6.x+
- Add the following files to your assets directory:
- ActionBarLogo.png
- ActionBarMenuButton.png
- ActionBarPullTab.png
How to install:
- Copy the CustomCompactActionBar.jar and CustomCompactActionBar.xml to your additional libraries directory.
How to use:
B4X:
'Initialize the library
Dim ActionBar As CustomCompactActionBar
'Create the ActionBar
ActionBar.Initialize(Activity, Me, "Manager", "", "", Colors.ARGB(255, 20, 20, 20), Colors.ARGB(255, 160, 160, 160), True, True, True)
'Add some ActionButtons
'NOTE: The action buttons SUPPORTS ONLY GRAPHICS.
ActionBar.AddBarIcon(mIcon1.Bitmap, 1)
ActionBar.AddBarIcon(mIcon1.Bitmap, 2)
ActionBar.AddBarIcon(mIcon1.Bitmap, 3)
ActionBar.AddBarIcon(mIcon1.Bitmap, 4)
'If you want to add a menu
ActionBar.SetMenu(200dip, 200dip, Null, "", Colors.DarkGray, Typeface.DEFAULT)
'Add menu items
For I = 1 To 10
ActionBar.AddMenuItem(LoadBitmap(File.DirAssets, "ActionBarLogo.png"), "Item " & I, Colors.White, I)
Next
The click events are captured by doing the following:
B4X:
Sub Manager_Click(ViewClicked As String, Value As Object)
'You can use SELECT CASE or IF...THEN to process the return, the possible results are:
'Logo, 0 = The logo was clicked
'BarIcon, <value> = A bar icon was clicked
'MenuItem, <value> = A menu item was clicked
ToastMessageShow("Result = " & ViewClicked & CRLF & "Value = " & Value, False)
End Sub
NOTE: This new version breaks previous versions, check the NEW library name (it is called now CustomCompactActionBar) and there are also additional parameters. Please check the attached sample for details.
Screenshots:
Attachments
Last edited: