HPA.ActionsBar
[Smartphone Edition]
Customize the Action bar in an app.
Use this API to dynamically:
- add an Action button
- show/hide the Action bar
- override the existing set of buttons
- add additional options to the More menu
In the smartphone edition, the actions bar is displayed on the bottom left corner, changing its buttons according as the user navigates in the application. App developers can customize it to their needs, as described above. By default, in the experience view, it appears this way:
Methods
Methods
setActions
-
items
Add customized items to the Action bar, such as a list of menu options or a single button. When the user taps a button or a command, the app's openEntryPoint method is called, and the data defined in the action is passed as parameters. There are three kinds of actions, each requires an additional property:
- defaultAction - requires an icon which will be placed in the actions bar.
- barAction - requires either an icon or text which will be placed in the actions bar.
- moreAction - requires a text which will be placed in the 'more' menu.
Parameters:
-
items
ArrayItems to be placed in the actions bar. Every item is an object with the following properties:
-
action
StringType of action, either 'barAction', 'defaultAction' or 'moreAction'. This will be provided as the 'entryPoint' parameter to the app's openEntryPoint function.
-
[params]
String optionalAdditional parameters which will be provided as the 'params.params' parameter to the app's openEntryPoint function.
-
icon
StringRequired for defaultAction; this or 'text' required for barAction. Must be one of the following: Add, Attach, Delete, Edit, Photo, Remove, Save, Search, Store. A suitable icon will be displayed in the bar. This will be provided as the 'params.iconCls' parameter to the app's openEntryPoint function.
-
text
StringRequired for 'moreAction'; this or 'icon' required for barAction. The string to display in the bar or the 'More' menu. If the item is a 'barAction', the text should be very short, typically one word. This text will be provided as the 'params.text' parameter to the app's openEntryPoint function.
-
setVisible
-
visible
Hide/show the Action bar.
Parameters:
-
visible
BooleanTrue/False Usage example: HPA.ActionsBar.setVisible(false);