new android ui patterns

Post on 28-Jan-2015

117 Views

Category:

Technology

4 Downloads

Preview:

Click to see full reader

DESCRIPTION

Short presentation of the current status of the action bar and pull to refresh projects for Android. Android Library Projects http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject Action Bar for Android https://github.com/johannilsson/android-actionbar Pull to Refresh for Android https://github.com/johannilsson/android-pulltorefresh Presented at GTUG Stockholm 2011-01-20.

TRANSCRIPT

new(Android UI Patterns)

@johannihttp://markupartist.com

Twitter for Android

"As many of you know, we’ll soon be open sourcing this application

code under the Android Open Source Project. "

http://android-developers.blogspot.com/2010/05/twitter-for-android-closer-look-at.html

Did they?

NO

So I built my own, last summer I wrote implementations of the action bar and the quick action

pattern. And have recently open sourced the action bar

Building Custom Components

JAR files can't hold Android resources and we really don't want to copy-paste resources.

Android Library Projects

Holds shared code and resources

At build time the library projects are merged with the

application

Reusable widgetsWhite-label appsPaid and free versions of the same app

developer.android.com/guide/developing/eclipse-adt.html#libraryProject

Action Bar

<com.markupartist.android.widget.ActionBar    android:id="@+id/actionbar"    app:title="@string/some_title"    style="@style/ActionBar"    />

ActionBar ab = (ActionBar)    findViewById(R.id.actionbar);// Assign the home actionab.setHomeAction(new IntentAction(    this,homeIntent, R.drawable.home));// Add some actionsab.addAction(new IntentAction(    this, shareIntent, R.drawable.share));ab.addAction(new IntentAction(    this, otherIntent, R.drawable.other));

Customization

<?xml version="1.0" encoding="utf-8"?><resources>    <color name="actionbar_separator">        #3A5FCD    </color>    <color name="actionbar_background_start">        #3A5FCD    </color>    <color name="actionbar_background_end">        #27408B    </color></resources> 

Current Status

Used in Voddler for Android and in the upcoming version of iglaset.

github.com/johannilsson/android-actionbar

Pull to Refresh

http://screenr.com/RRk

Replaces a standard ListView widget.

<com.markupartist.android.        widget.PullToRefreshListView    android:id="@+id/android:list"    android:layout_height="fill_parent"    android:layout_width="fill_parent"    />

Current Status

API Level 8 (2.2) and far from complete

github.com/johannilsson/android-pulltorefresh

top related