14
Design like ICS, Holo for Android 2+ Use action bar and HOLO theme in Android 2+ applications Michal CoPLaS Pavlasek www.pavlasek.sk/devel/ twitter.com/pavlasek

ActionBar and Holo in Android 2+

Embed Size (px)

DESCRIPTION

Slides from Android dev meeting in Zilina, Slovakia about ActionBar and Holo in Android 2+.follow me on: www.twitter.com/pavlasek

Citation preview

Page 1: ActionBar and Holo in Android 2+

Design like ICS, Holo for Android 2+

Use action bar and HOLO theme in Android 2+ applications

Michal CoPLaS Pavlasekwww.pavlasek.sk/devel/twitter.com/pavlasek

Page 2: ActionBar and Holo in Android 2+

About me

● Java, Android, Grails (etc...) developer

● I'm not creator of ActionBarSkerlock or

HoloEverywhere

● Just fan of it

Page 3: ActionBar and Holo in Android 2+

ActionBarSherlock

Extension of the compatibility library.

Action bar design pattern across all versions of Android with a single API.

http://actionbarsherlock.com/

Page 4: ActionBar and Holo in Android 2+

HoloEverywhere

Port of Holo Theme to Android 1.6+

https://github.com/ChristopheVersieux/HoloEverywhere

Page 5: ActionBar and Holo in Android 2+

ActionBarSherlock● Eclipse: include ActionBarSherlock as a library

project● Activity extends Sherlock* - SherlockActivity,

SherlockFragmentActivity●Interaction with the action bar is handled by

calling getSupportActionBar() (instead of

getActionBar()).

Page 6: ActionBar and Holo in Android 2+

ActionBarSherlockTheming:

● requires a set of default themes, one of which

must be applied to each activity on which you

want the action bar present● Theme.Sherlock, Theme.Sherlock.Light, or

Theme.Sherlock.Light.DarkActionBar

Page 7: ActionBar and Holo in Android 2+

ActionBarSherlockImports:

● Includes and uses a lot of classes that are

named the same as their native counterparts● com.actionbarsherlock.app.ActionBar

● com.actionbarsherlock.view.Menu

● com.actionbarsherlock.view.MenuItem

● com.actionbarsherlock.view.MenuInflater

Page 8: ActionBar and Holo in Android 2+

ActionBarSherlock

Examples:

@Overridepublic boolean onCreateOptionsMenu(final Menu menu) {

final MenuInflater inflater = getSupportMenuInflater(); inflater.inflate(R.menu.only_info2, menu); return true;}

Page 9: ActionBar and Holo in Android 2+

ActionBarSherlock

Page 10: ActionBar and Holo in Android 2+

ActionBarSherlockUse <item name="absForceOverflow">true</item> in style...

Page 11: ActionBar and Holo in Android 2+

HoloEverywherePort of Holo Theme to Android 1.6+

Themes:● Theme.HoloEverywhereDark

● Theme.HoloEverywhereLight

● Theme.HoloEverywhereDark.Sherlock

● Theme.HoloEverywhereLight.Sherlock

Page 12: ActionBar and Holo in Android 2+

HoloEverywhereExamples:

Page 13: ActionBar and Holo in Android 2+

HoloEverywhereExamples:

Page 14: ActionBar and Holo in Android 2+

More info

ActionBarSherlock:http://actionbarsherlock.com/

https://twitter.com/JakeWharton

HoloEverywhere:https://github.com/ChristopheVersieux/HoloEverywhere