18
 Introducing Honeycomb

Introducing Honeycomb

Embed Size (px)

DESCRIPTION

What the Honeycomb UI contains and what else arrived in the Android 3.0 release for developers.

Citation preview

Page 1: Introducing Honeycomb

   

IntroducingHoneycomb

Page 2: Introducing Honeycomb

   

Elements of the HC Look & Feel

● Status Bar– At the bottom now– Soft keys for HOME, BACK, etc.

● Action Bar– Combination toolbar, options menu, context

menu, and title bar● Holographic Theme

Page 3: Introducing Honeycomb

   

Enabling the HC Look & Feel● <uses-sdk android:targetSdkVersion=“11” />

– Gives your widgets the Holographic theme, unless you overrode it

– Replaces a MENU button in status bar with your options menu in the action bar

Page 4: Introducing Honeycomb

   

Page 5: Introducing Honeycomb

   

Adding to the Action Bar

● android:showAsAction– ifRoom or always– withText for text+icon vs. just icon

● android:actionLayout– Layout resource to inflate into the action bar

instead of a toolbar button

Page 6: Introducing Honeycomb

   

Page 7: Introducing Honeycomb

   

Page 8: Introducing Honeycomb

   

Fragments: What and Why

● What: Layer Between Activity and View– Designed to create internally-reusable facets of

your UI, to be combined based upon screen size– Can animate on/off, have own BACK stack

● Why: Future Honeycomb-on-Phones– Tries to simplify having single UI definition that

scales up for larger screens

Page 9: Introducing Honeycomb

   

Fragments: User Experience

● Lists With Selection– Normally, touch mode is an action

● Lists Plus Detail Simultaneously– ...on tablets– Phones will have as separate activities due to

limited screen space● Intra-Activity BACK Operation

Page 10: Introducing Honeycomb

   

Fragments: The Mechanics

● Create Fragment Classes– Extend Fragment, ListFragment, etc.– Override onCreateView() to define content

● E.g., inflated layout

– Lifecycle Methods● onActivityCreated()● onSaveInstanceState()● Etc.

Page 11: Introducing Honeycomb

   

Fragments: The Mechanics

● Displaying Fragments– Embed in activity layouts via <fragment>

● Large/xlarge layouts have multiple fragments● Small/normal layouts have single fragment

– Add dynamically via FragmentManager– FragmentTransaction

● Add, replace, remove, etc.● Configure if “transaction” can be reversed via BACK

Page 12: Introducing Honeycomb

   

Fragments: The Mechanics

● Problem: Backwards Compatibility– Fragments firmly in API Level 11– Backwards-compatible fragment

implementation in the works● Android library project● Wrapper API that uses Honeycomb if available or

internal implementation if not● Not available at the time of this writing

Page 13: Introducing Honeycomb

   

App Widgets in Honeycomb

● Adapter-Driven Widget Contents– ListView, GridView, StackView,

AdapterViewFlipper– RemoteViewsService

● Preview Images– Shown to user before app widget is added to

screen

Page 14: Introducing Honeycomb

   

Notifications in Honeycomb

● What We Gain– Control over Growl-style large pop-ups

● What We Lose– number

● What Users Lose– Single clear button – now individual close

buttons per Notification

Page 15: Introducing Honeycomb

   

Animations in Honeycomb

● Animate Arbitrary Properties– E.g, change colors– ValueAnimator and ObjectAnimator– New view properties for rotation, pivot, scale,

etc.– Can generally replace much of classic animation

framework (translation, rotation, etc.)

Page 16: Introducing Honeycomb

   

The Rest of the HC Story

● android:hardwareAccelerated="true"– Speeds things up, but false by default for

compatibility● Rich Clipboard Contents● Drag-and-Drop

– For moving data, not widgets– Same engine as new clipboard contents

Page 17: Introducing Honeycomb

   

The Rest of the HC Story

● Loaders for asynchronous loading of data– Particularly for use with content providers

● New widgets: CalendarView, SearchView, NumberPicker, etc.

● Renderscript for 3D work● Touch events across widgets● And on, and on, and on...

Page 18: Introducing Honeycomb

   

Ice Cream Sandwich

● Current Working Theory– Android 3.1– Summer 2011– Honeycomb UI, other Android 3.0 goodness

brought to phones● Not everything, due to screen size or lower hardware

requirements