Since the introduction of the Action Bar design pattern, many applications have adopted it as a way to provide easy access to common actions. In Android 3.0 (or Honeycomb to its friends) this pattern has been baked in as the default navigation paradigm and extended to take advantage of the extra real-estate available on tablets. By using the Action Bar in your Honeycomb-targeted apps, you'll give your users a familiar way to interact with your application. Also, your app will be better prepared to scale across the range of Android devices that will be arriving starting in the Honeycomb era.
Just because Action Bars are familiar, doesn’t mean that they have to be identical! The following code samples and accompanying project demonstrate how to style the Action Bar to match your application’s branding. I’ll demonstrate how to take Honeycomb’s Holo.Light theme and customise it to match this blog’s colour scheme.
<style name="Theme.AndroidDevelopers" parent="android:style/Theme.Holo.Light">
…
</style>
Icon
This step is easy; I’ll use the wonderful Android Asset Studio to create an icon in my chosen colour scheme. For extra credit, I’ll use this image as a starting point to create a more branded logo.
Navigation
Next up, the navigation section of the Action Bar operates in three different modes; I’ll tackle each of these in turn.
Standard
The Action Bar’s standard navigation mode simply displays the title of the activity. This doesn’t require any styling... next!
List
To the left, a standard list drop-down; to the right, the effect we want to achieve.
Read more: Android developers blog
0 comments:
Post a Comment