What is the best way to implement action bar like twitter sample UI Pattern.
Twitter for Android: A closer look at Android’s evolving UI patterns
Pattern 4: Action Bar
You might want to take a look at the source code for the Google I/O 2010 schedule application, which is open source and contains an Action Bar implementation:
Yet another action bar implementation can be found here (shameless plug), https://github.com/johannilsson/android-actionbar. It’s implemented as a library project so there’s no need to copy-paste resources.
Implementation wise it’s built as a widget that extends a RelativeLayout with it own layout for the actions and the bar. This makes it possible to add it to layouts with it own xml snippet.
<com.markupartist.android.widget.ActionBar android:id="@+id/actionbar" style="@style/ActionBar" />
And then later on refer to it in a activity to add actions.
ActionBar actionBar = (ActionBar) findViewById(R.id.actionbar); actionBar.setTitle("Other"); actionBar.setHomeAction(new IntentAction(this, HomeActivity.createIntent(this), R.drawable.ic_title_home_default)); actionBar.addAction(new IntentAction(this, createShareIntent(), R.drawable.ic_title_share_default)); actionBar.addAction(new ToastAction());
ActionBarSherlock at https://github.com/JakeWharton/ActionBarSherlock is an Android library for implementing the action bar design pattern using the native ActionBar on 3.0+ and a third-party library on pre-3.0.
I’m also waiting hard till Google open sources the Twitter app…but also tweeting Reto Meier didn’t bring info about a possible release…anyway.
Regarding QuickActions I found the following interesting links which may potentially be interesting for some of you here:
Google suppose to open source twitter app pretty soon ( i hope ) as showcase for all they talk about in this article.
If you can’t wait – hide title bar. Create layout that looks like that. Include it in all your activities via tag .
There is an Action Bar implementation in Tomdroid, a GPL note taking App which can sync with Tomboy.
Android 4.x (Ice Cream Sandwich) now includes a native Action Bar:
Android 4.x Design Guidelines: