public interface

ActionBarActivity

greendroid.app.ActionBarActivity
Known Indirect Subclasses

Class Overview

Defines all methods related to Activities embedding an ActionBar

Summary

Constants
String GD_ACTION_BAR_TITLE The optional title of the launched ActionBarActivity
String GD_ACTION_BAR_VISIBILITY An integer that can be used to force the ActionBar to a particular visibility.
Public Methods
abstract ActionBarItem addActionBarItem(ActionBarItem item)
Add a new item to the ActionBar.
abstract ActionBarItem addActionBarItem(ActionBarItem item, int itemId)
Add a new item to the ActionBar.
abstract ActionBarItem addActionBarItem(ActionBarItem.Type actionBarItemType)
Adds a new item of type type to the ActionBar.
abstract ActionBarItem addActionBarItem(ActionBarItem.Type actionBarItemType, int itemId)
Adds a new item of type type to the ActionBar.
abstract int createLayout()
Returns the identifier of the layout that needs to be created for this ActionBarActivity
abstract ActionBar getActionBar()
Returns the ActionBar.
abstract FrameLayout getContentView()
Returns the content view.
abstract GDApplication getGDApplication()
A simple utility method that casts the Application returned by Activity.getApplication() into a GDApplication
abstract boolean onHandleActionBarItemClick(ActionBarItem item, int position)
Clients may use this method to listen to ActionBarItems clicks.
abstract void onPostContentChanged()
Called at the end of the onContentChanged() method.
abstract void onPreContentChanged()
Called at the beginning of the onContentChanged() method.

Constants

public static final String GD_ACTION_BAR_TITLE

The optional title of the launched ActionBarActivity

Constant Value: "greendroid.app.ActionBarActivity.GD_ACTION_BAR_TITLE"

public static final String GD_ACTION_BAR_VISIBILITY

An integer that can be used to force the ActionBar to a particular visibility. This is especially useful when using GDActivity inside a GDTabActivity.

Constant Value: "greendroid.app.ActionBarActivity.GD_ACTION_BAR_VISIBILITY"

Public Methods

public abstract ActionBarItem addActionBarItem (ActionBarItem item)

Add a new item to the ActionBar.

Parameters
item The item to add to the ActionBar

public abstract ActionBarItem addActionBarItem (ActionBarItem item, int itemId)

Add a new item to the ActionBar.

Parameters
item The item to add to the ActionBar
itemId Unique item ID. Use NONE if you do not need a unique ID.

public abstract ActionBarItem addActionBarItem (ActionBarItem.Type actionBarItemType)

Adds a new item of type type to the ActionBar.

Parameters
actionBarItemType The item to add to the ActionBar

public abstract ActionBarItem addActionBarItem (ActionBarItem.Type actionBarItemType, int itemId)

Adds a new item of type type to the ActionBar.

Parameters
actionBarItemType The item to add to the ActionBar
itemId Unique item ID. Use NONE if you do not need a unique ID.

public abstract int createLayout ()

Returns the identifier of the layout that needs to be created for this ActionBarActivity

Returns
  • The layout identifier of the layout to create

public abstract ActionBar getActionBar ()

Returns the ActionBar. Listening to ActionBar events should be done via the onHandleActionBarItemClick(ActionBarItem, int) method. Most of the time, this method don't need to be used directly.

Returns

public abstract FrameLayout getContentView ()

Returns the content view. Please note the content view is not the entire view but a FrameLayout that contains everything but the ActionBar.

Returns
  • The content view

public abstract GDApplication getGDApplication ()

A simple utility method that casts the Application returned by Activity.getApplication() into a GDApplication

Returns

public abstract boolean onHandleActionBarItemClick (ActionBarItem item, int position)

Clients may use this method to listen to ActionBarItems clicks.

Parameters
item The ActionBarItem that has been clicked
position The position of the clicked item. This number is equal or greater to zero. 0 is the leftmost item.
Returns
  • true if the method has handled the click on the ActionBarItem at position position. Otherwise it returns false.

public abstract void onPostContentChanged ()

Called at the end of the onContentChanged() method. This may be use to initialize the content of the layout (titles, etc.)

public abstract void onPreContentChanged ()

Called at the beginning of the onContentChanged() method. This may be used to initialize all references on elements.