Android Programming Press on the image to return to the main documentation page.

AHQuickAction

Written by Markus Stipp

This library provides two objects for some nice looking popup menus.

The AHQuickAction object is a popup window with horizontally aligned items.
You can see this popup window in many apps like Tapatalk or Folder Organizer.

The AHQuickAction3D object is a popup that can be used horizontally and
vertically. You can find a similar popup in many Google apps like 3D-Gallery
and Text&Tables.

This library is somewhat different to other libraries because it makes use
of standard Android resource files. Resource files cannot be published inside
a .jar file and so you have to copy them to your Basic4Android project directory.

Copy the whole "res" directory structure to the "Objects" directory of your B4A
project and VERY IMPORTANT: make them READ ONLY! Otherwise B4A will delete them
when compiling. After you make any change to the Objecs/res directory use
"Clean project" menu item in B4A to force the compiler to recreate the R.java file.

If you forget to make the resource files read only then you will most likely get
a ResourceNotFound exception when you try to use the popup objects.

The objects are ported from open source projects and you can find them here:
NewQuickAction
NewQuickAction3D

List of types:

AHActionItem
AHPopupMenu
AHQuickAction
AHQuickAction3D

AHActionItem

This object can hold a menu Item for the popup windows with icon and text.

Events:

None

Members:


  ActionId As Int

  Icon As android.graphics.drawable.Drawable

  Initialize (ActionId As Int, Title As String, Icon As android.graphics.drawable.Drawable)

  Selected As Boolean

  Sticky As Boolean

  Tag As Object

  Title As String

Members description:

ActionId As Int
Set or get action id

ActionId - Action id for this action
Icon As android.graphics.drawable.Drawable
Set or get action icon

Icon - action icon as a drawable
Initialize (ActionId As Int, Title As String, Icon As android.graphics.drawable.Drawable)
Initializes the action item

ActionId - Id for the action item. Pass any number here.
Title - Text for the item
Icon - Icon for the item. Pass Null if you want a text only item.
Selected As Boolean
Set or get selected flag;

Selected - Flag to indicate the item is selected
Sticky As Boolean
Set or get sticky status of button

Sticky - true for sticky, pop up sends event but does not disappear
Tag As Object
Set or get action tag object

Tag - Tag object to set
Title As String
Set or get action title

Title - Action title

AHPopupMenu


Events:

Click (Position as Int, ActionItemID as Int)
Dismiss

Members:


  AddActionItem (Action As AHActionItem)

  ANIM_AUTO As Int

  ANIM_GROW_FROM_CENTER As Int

  ANIM_GROW_FROM_LEFT As Int

  ANIM_GROW_FROM_RIGHT As Int

  ANIM_REFLECT As Int

  AnimStyle As Int [write only]

  GetActionItem (Index As Int) As AHActionItem

  Initialize (EventName As String)

  ItemCount As Int [read only]

  Show (AnchorView As android.view.View)

  VERTICAL As Int

Members description:

AddActionItem (Action As AHActionItem)
Add action item

Action - AHActionItem object
ANIM_AUTO As Int
ANIM_GROW_FROM_CENTER As Int
ANIM_GROW_FROM_LEFT As Int
ANIM_GROW_FROM_RIGHT As Int
ANIM_REFLECT As Int
AnimStyle As Int [write only]
Set animation style

AnimStyle - animation style, default is set to ANIM_AUTO
GetActionItem (Index As Int) As AHActionItem
Initialize (EventName As String)
Initialize the AHQuickAction3D object

EventName - Event name
ItemCount As Int [read only]
Get number of action items
Show (AnchorView As android.view.View)
Show ICS style popup menu. menu is automatically positioned, on top or
bottom of anchor view.

AnchorView - View that is used as an anchor
VERTICAL As Int

AHQuickAction


Events:

Click (Position as Int, ActionItemID as Int)
Dismiss

Members:


  AddActionItem (Action As AHActionItem)

  ANIM_AUTO As Int

  ANIM_GROW_FROM_CENTER As Int

  ANIM_GROW_FROM_LEFT As Int

  ANIM_GROW_FROM_RIGHT As Int

  AnimateTrack As Boolean [write only]

  AnimStyle As Int [write only]

  GetActionItem (Index As Int) As AHActionItem

  Initialize (EventName As String)

  ItemCount As Int [read only]

  Show (AnchorView As android.view.View)

Members description:

AddActionItem (Action As AHActionItem)
Add action item

Action - AHActionItem object
ANIM_AUTO As Int
ANIM_GROW_FROM_CENTER As Int
ANIM_GROW_FROM_LEFT As Int
ANIM_GROW_FROM_RIGHT As Int
AnimateTrack As Boolean [write only]
Flag, if the track should be animated when the popup window opens.
AnimStyle As Int [write only]
Set animation style

AnimStyle - animation style, default is set to ANIM_AUTO
GetActionItem (Index As Int) As AHActionItem
Get action item at an index

Index - Index of item
Initialize (EventName As String)
Initialize the AHQuickAction3D object

EventName - Event name
ItemCount As Int [read only]
Get number of action items
Show (AnchorView As android.view.View)
Show quickaction popup. Popup is automatically positioned, on top or bottom of anchor view.

AnchorView - View that is used as an anchor

AHQuickAction3D


Events:

Click (Position as Int, ActionItemID as Int)
Dismiss

Members:


  AddActionItem (Action As AHActionItem)

  ANIM_AUTO As Int

  ANIM_GROW_FROM_CENTER As Int

  ANIM_GROW_FROM_LEFT As Int

  ANIM_GROW_FROM_RIGHT As Int

  ANIM_REFLECT As Int

  AnimStyle As Int [write only]

  GetActionItem (Index As Int) As AHActionItem

  HORIZONTAL As Int

  Initialize (EventName As String, Orientation As Int)

  ItemCount As Int [read only]

  Show (AnchorView As android.view.View)

  VERTICAL As Int

Members description:

AddActionItem (Action As AHActionItem)
Add action item

Action - AHActionItem object
ANIM_AUTO As Int
ANIM_GROW_FROM_CENTER As Int
ANIM_GROW_FROM_LEFT As Int
ANIM_GROW_FROM_RIGHT As Int
ANIM_REFLECT As Int
AnimStyle As Int [write only]
Set animation style

AnimStyle - animation style, default is set to ANIM_AUTO
GetActionItem (Index As Int) As AHActionItem
Get action item at an index

Index - Index of item
HORIZONTAL As Int
Initialize (EventName As String, Orientation As Int)
Initialize the AHQuickAction3D object

EventName - Event name Orientation - Orientation of the popup window
ItemCount As Int [read only]
Get number of action items
Show (AnchorView As android.view.View)
Show quickaction popup. Popup is automatically positioned, on top or
bottom of anchor view.

AnchorView - View that is used as an anchor
VERTICAL As Int

Top