Skip to content

Commit

Permalink
Updated docs about setOnTitleLickListener.
Browse files Browse the repository at this point in the history
  • Loading branch information
johannilsson committed Feb 11, 2011
1 parent 7abe12a commit 9a79526
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ The use of `app:title` is optional, it's also possible to assign the title using
actionBar.addAction(new IntentAction(this, createShareIntent(), R.drawable.ic_title_share_default));
actionBar.addAction(new ToastAction());

### Set onClickListener on the title

actionBar.setOnTitleClickListener(new OnClickListener() {
public void onClick(View v) {
// Your code here
}
});

### Custom actions

ActionBar comes with a convenient IntentAction that makes it easy to create action out of Intents. To create custom actions simply implement the Action interface and build your own like the Toast example below.
Expand All @@ -55,6 +47,16 @@ ActionBar comes with a convenient IntentAction that makes it easy to create acti

}

### Handle on click on the title

To handle on clicks on the title pass a `android.view.View.OnClickListener` to the method `setOnTitleClickListener` on the action bar. The `View` that is passed in `onClick` is the `TextView` that the title is assigned to.

actionBar.setOnTitleClickListener(new OnClickListener() {
public void onClick(View v) {
// Your code here
}
});

### Customization

Since the ActionBar is an Libary Project all resources will be merged to the project that referencing the ActionBar. The values in the main project will always be used before the default values of the ActionBar.
Expand Down

0 comments on commit 9a79526

Please sign in to comment.