ActionBar


An action bar holds the title and actions displayed in the application toolbar. More...
import Material 0.2
Properties and Methods

Detailed Description

An action bar holds the title and actions displayed in the application toolbar.

The reason this exists separately from Toolbar is for animation purposes. Each page contains its own ActionBar, and when the application transitions between pages, the toolbar animates the transition between action bars.

Normally, you don't need to manually create an instance of this class, and just use the instance provided by the page. See the example in the Page documentation for more details.

Properties

actions : Action

A list of actions to show in the action bar. These actions will be shown anchored to the right, and will overflow if there are more than the maximum number of actions as defined in maxActionCount.

When used with a page, the actions will be set to the page's Page::actions property, so set that instead of changing this directly.

backAction : Action

The back action to display to the left of the title in the action bar. When used with a page, this will pick up the page's back action, which by default is a back arrow when there is a page behind the current page on the page stack. However, you can customize this, for example, to show a navigation drawer at the root of your app.

When using an action bar in a page, set the Page::backAction instead of directly setting this property.

backgroundColor : color

The background color for the toolbar when the action bar's page is active. By default this is the primary color defined in Theme::primaryColor

customContent : Item

A custom view to show instead of the title in the action bar.

decorationColor : color

The background color of the window decoration when the action bar's page is active, usually a darker version of the backgroundColor. By default this is the primary dark color defined in Theme::primaryDarkColor

elevation : int

The elevation of the action bar. Set to 0 if you want have a header or some other view below the action bar that you want to appear as part of the action bar.

extendedContent : Item

A custom view to show under the row containing the title and actions. Causes the action bar to be extend in height to contain this view.

hidden : bool

Set to true to hide the action bar. This is used when displaying an action bar in a toolbar through the use of a page and the page stack. If you are using an action bar for custom purposes, set the opacity or visibility instead.

leftKeyline : int
No description provided.
maxActionCount : int

The maximum number of actions that can be displayed before they spill over into a drop-down menu. When using an action bar with a page, this inherits from the global Toolbar::maxActionCount. If you are using an action bar for custom purposes outside of a toolbar, this defaults to 3.

selectedTab : alias

The index of the selected tab. This will be an index from the tabs property.

tabBar : alias

The tab bar displayed below the actions in the action bar. Exposed for additional customization.

tabs : alias

The model to use as the tab items in the action bar. This can either be a Javascript array wih an object for each tab, or it can be a TabView object to display tabs for.

If it is a Javascript array, each object represents one tab, and can either be a simple string (used as the tab title), or an object with title, iconName, and/or iconSource properties.

If it is a TabView component, the title of each Tab object will be used, as well as iconName and iconSource properties if present (as provided by the Material subclass of Tab).

When used in a page, this will be set to the tabs of the page, so set the Page::tabs property instead of changing this directly.

title : string

The title displayed in the action bar. When used in a page, the title will be set to the title of the page, so set the Page::title property instead of changing this directly.