문제

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 http://android-developers.blogspot.com/2010/05/twitter-for-android-closer-look-at.html

도움이 되었습니까?

해결책

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:

http://code.google.com/p/iosched/

다른 팁

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:

Have fun!

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.

See https://code.launchpad.net/~tomdroid-maintainers/tomdroid/main

Android 4.x (Ice Cream Sandwich) now includes a native Action Bar: http://developer.android.com/guide/topics/ui/actionbar.html

Android 4.x Design Guidelines: http://developer.android.com/design/patterns/actionbar.html

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top