SlideShare une entreprise Scribd logo
1  sur  81
Télécharger pour lire hors ligne
Designing and Implementing
Android UIs for Phones and Tablets
Matias Duarte
Rich Fulcher
Roman Nurik
Adam Powell
Christian Robertson

2

#io2011 #Android
Ask questions

Give feedback

http://goo.gl/mod/zdyR

http://goo.gl/4dTQp

Note: Both links are also available in the Google I/O Android App
Agenda
1. Introduction to tablets
2. Honeycomb visual design
3. Tablet UI patterns + Honeycomb framework features
– Interaction design
– Implementation

4. Case study — Google I/O 2011 App

4
Introduction to tablets
Design Goals for Honeycomb

6
Design Goals for Honeycomb

7
Design Goals for Honeycomb

8
The Beginning of a Journey

9
Honeycomb visual design
Introducing: Holographic UI
Holo Theme: Design Goals

1 / Enable flexible, dynamic UI
2 / Simplify, open up design
3 / Enable extensibility

12
1 / Enable dynamic UI: early explorations
1 / Enable flexible, dynamic UI
1 / Enable flexible, dynamic UI
1 / Enable flexible, dynamic UI
1 / Enable flexible, dynamic UI
Holo Theme: Design Goals

1 / Enable flexible, dynamic UI
2 / Simplify, open up design
3 / Enable extensibility

18
2 / Simplify: removing boxes
2 / Simplify: removing boxes
2 / Simplify: robust spacing, grid metrics
2 / Simplify: robust spacing, grid metrics
Holo Theme: Design Goals

1 / Enable flexible, dynamic UI
2 / Simplify, open up design
3 / Enable extensibility

24
3 / Enable extensibility: Design tips
๏ Choose light or dark theme as a start point
– Consider changing highlight color and background image
– When overriding styles and themes, override all assets

๏ Open design, removing boxes where appropriate
– Spacing and metrics matter
– “Stretch to fill” on tablets doesn’t work for many UI elements

๏ Spend time on icons & promo graphics ...

25
Application Branding

Density-specific
app icons

Hi-res Market icon

26
Application Branding

Promotional
graphic

Feature banner graphic

27
Honeycomb UI patterns and
framework features
UI Patterns
๏ Like a software design pattern, a UI design pattern describes
a general solution to a recurring problem
๏ Framework-supported
๏ Guidelines, not restrictions
๏ Topics we’ll discuss today:
1.
2.
3.
4.

29

Action Bar
Multi-pane Layouts
App Navigation
Beyond the List
Action Bar
Introduction

๏ Not a new pattern
– Presented as phone UI pattern at last year's I/O
– Used in many apps through Android Market
– Honeycomb has greatly extended its usefulness

๏ Dedicated real estate at the top of each screen
– Generally persistent throughout application

๏ Used to make frequently used actions prominent
๏ Supports navigation
๏ Convenient means of handling Menu and Search
30
Action Bar
General organization

๏ App icon
๏ View details
๏ Action buttons

31
Action Bar
General organization

๏ App icon
– Can be replaced with logo or other branding
– Used to support “upward” navigation within the app

32
Action Bar
General organization

๏ View details
– Simple: non-interactive title bar replacement
– Richer: Tabs, drop-down menus, breadcrumbs

33
Action Bar
General organization

๏ Action buttons
– More important / frequently-accessed action at left
– Buttons can be icon-only, text-only, or icon-and-text
– Overflow menu

34
Action Bar
Contextual actions

๏ Action bar can transform its appearance when items are selected
– Useful for single or multiple selection
– Typically invoking via touch and hold

๏ Like normal action bar, three sections:
– Done button (for releasing selection)
– Selection details
– Action Buttons

๏ Implemented using ActionMode
35
Action Bar
Implementation

๏ Basic action bar
– Theme.Holo or targetSdkVersion ≥ 11.
– Action items from res/menu/

๏ Customizing the action bar
– ActionBar class
– showAsAction for menu items

http://j.mp/customizing-action-bar

36
Action Bar
Compatibility

1. Write a custom action bar implementation pre-Honeycomb
http://code.google.com/p/iosched

2. Alternatively, defer to the standard Options menu

37
Action Bar
Phones and smaller screens

๏ Swap out elements for space-conservative variants
– Icon + text reduced to just icon
– Overflow icon hidden, invoked using MENU key

๏ Split single bar into two
– View portion such as Tabs can become second row, below action bar
– Actions can move into bottom action bar

๏ 2-3 main action buttons, others placed in Overflow
– Determined by showAsAction = “ifRoom” or “always”

38
Action Bar
Phones and
smaller screens

39
Multi-pane Layouts
Introduction

๏ Take advantage of vastly increased real estate
– Give more context
– Consolidate multiple related phone screens into a single compound view
– Avoid excessively long line lengths

๏ Panes to the right should generally present more content
or details for items selected in the panes on the left.

40
Multi-pane Layouts

Strategies

Orientation change

๏ Orientation changes should
preserve functional parity
– User shouldn’t have to rotate
device to achieve a task

๏ Strategies apply per-screen, not
per app
๏ For the show/hide orientation
strategy, use UP navigation to
show the master pane
– e.g. Gmail conversation view
41

Stretch

Stack

(e.g. Settings)

(e.g. Calendar)

Expand/collapse

Show/hide

(e.g. Google Talk)

(e.g. Gmail)
Multi-pane Layouts
Implementation — Fragments

๏ Fragment class
๏ Optionally use the <fragment> tag in layout XML

42
Multi-pane Layouts
A quick intro to Fragments

๏ “Fragments” of an Activity
๏ Unit of reuse between Activities
๏ Separation of concerns
๏ Fragments don’t necessarily have views
– Fragments are a lifecycle construct, not necessarily a visual construct

๏ ...but this talk is about UI.

43
Multi-pane Layouts
Compatibility

๏ Can use Fragments with the Android support library
available through the SDK manager
๏ Use getSupportFragmentManager
๏ All activities extend FragmentActivity
http://j.mp/fragments-for-all

44
Multi-pane Layouts
Using resources

๏ You’ve probably seen this before:
– drawable-ldpi/
– drawable-mdpi/
– drawable-hdpi/

๏ But you can also do this:
–
–
–
–

45

layout-normal/
layout-large/
layout-xlarge/
layout-xlarge-port/
Multi-pane Layouts
Using resources

๏ Activities can inflate layouts with different fragment configurations

46
Multi-pane Layouts
Using resources

๏ Activities can inflate layouts with different fragment configurations

Stack
(e.g. Calendar)

47
Multi-pane Layouts
Using resources

๏ Activities can inflate layouts with different fragment configurations
layout-xlarge-land/my_layout.xml

Stack
(e.g. Calendar)

48

<LinearLayout android:orientation=”horizontal”
android:layout_width=”match_parent”
android:layout_height=”match_parent”>
<fragment android:name=”com.example.MainPaneFragment”
android:id=”@+id/main_pane”
android:layout_width=”0dip” android:layout_weight=”1”
android:layout_height=”match_parent” />
<LinearLayout android:orientation=”vertical”
android:layout_width=”wrap_content”
android:layout_height=”match_parent”>
<fragment android:name=”com.example.MonthFragment”
android:id=”@+id/month_pane”
android:layout_width=”wrap_content”
android:layout_height=”0dip” android:layout_weight=”1” />
<fragment android:name=”com.example.CalendarListFragment”
android:id=”@+id/list_pane”
android:layout_width=”wrap_content”
android:layout_height=”0dip” android:layout_weight=”1” />
</LinearLayout>
</LinearLayout>
Multi-pane Layouts
Using resources

๏ Activities can inflate layouts with different fragment configurations
layout-xlarge-port/my_layout.xml

Stack
(e.g. Calendar)

49

<LinearLayout android:orientation=”vertical”
android:layout_width=”match_parent”
android:layout_height=”match_parent”>
<fragment android:name=”com.example.MainPaneFragment”
android:id=”@+id/main_pane”
android:layout_width=”match_parent”
android:layout_height=”0dip” android:layout_weight=”1” />
<LinearLayout android:orientation=”horizontal”
android:layout_width=”match_parent”
android:layout_height=”wrap_content”>
<fragment android:name=”com.example.MonthFragment”
android:id=”@+id/month_pane”
android:layout_width=”0dip” android:layout_weight=”1”
android:layout_height=”wrap_content” />
<fragment android:name=”com.example.CalendarListFragment”
android:id=”@+id/list_pane”
android:layout_width=”0dip” android:layout_weight=”1”
android:layout_height=”wrap_content” />
</LinearLayout>
</LinearLayout>
Multi-pane Layouts
Using resources

๏ Some other handy uses:
– Fragments can use layouts with different view configurations
– List items can be more detailed or compact as needed
– integer or boolean resources can have different values

50
App Navigation
Introduction

๏ One of the more dramatic changes in Honeycomb
๏ Increased variety of mechanisms for direct, deep navigation into an app

51
App Navigation
Highlights

Richer home screen widgets

Richer notifications

‘Recents’
52
App Navigation
Navigation and user memory

๏ Android has traditionally relied on temporal memory:
–
–
–
–

Users are good at remembering what just happened
Great for snapping back to one context directly from another
Much harder to sequence precise order of events that happened a little while ago
More potential for error, surprise

๏ Users have strong structural memory
– Remember relationships between screens in an app
– Used to going “Home” in web apps
– Clearer expectations for behavior

53
App Navigation
Back versus Up

๏ SYSTEM BACK navigates history between related screens
๏ APPLICATION UP navigates hierarchy within a single app

54
App Navigation
Example Flows

Contacts Task
Contacts

55
App Navigation
Example Flows

Contacts Task
Contacts

56

Contact
details
App Navigation
Example Flows
BACK

Contacts Task
Contacts

57

Contact
details
App Navigation
Example Flows
UP

Contacts Task
Contacts

58

Contact
details
App Navigation
Example Flows

Contacts Task
Contacts

59
App Navigation
Example Flows

Contacts Task
Contacts

60

Contact
details
App Navigation
Example Flows

Contacts Task
Contacts

61

Contact
details

Compose
email
App Navigation
Example Flows
BACK

Contacts Task
Contacts

62

Contact
details

Compose
email
App Navigation
Example Flows

Contacts Task
Contacts

Contact
details
UP

Gmail Task
Gmail

63

Compose
email
App Navigation
What you need to do

๏ If you have an app with hierarchy, support UP in action bar
๏ If you support system deep links into your app, inject screens “above” the target into
the back stack
– E.g. Deep link from a widget
– E.g. Deep link from a notification

64
Beyond the List
Introduction

๏ Views for media-rich applications
๏ “Hero moments” to break the monotony of list views
๏ Encourage more engaged exploration, akin to flipping through a magazine

65
Beyond the List
Examples

66
Beyond the List
Implementation

๏ CarouselView
– Renderscript
– Intended for customization

http://j.mp/io2011-carousel-sample

๏ FragmentPager, Workspace for
showing one item or page at a time
๏ Don’t use the Gallery widget
67
Case study — Google I/O 2011 App
Download the app now.
We’ll wait.
http://goo.gl/UhnLT

69
How it works
Basics

๏ Single .APK
๏ Custom layouts, drawable, style, dimension
resources for -xlarge-v11
– Gingerbread tablets will use ‘normal’, phone layout

๏ Fragment compatibility library

73
How it works
Activities

๏ Different types of activities:
– Universal:
– Phone-only:

HomeActivity

– Tablet-only:

SessionsMultiPaneActivity

SessionsActivity (single fragment)

๏ Activity helpers
– ActivityHelper
– ActivityHelperHoneycomb

74

BaseSinglePaneActivity
BaseMultiPaneActivity
How it works
Action bar

๏ Custom action bar (ActionBarCompat) for phones
– Still using res/menu/
– Action bar and buttons are just styled Views

public void onPostCreate(Bundle savedInstanceState) {
SimpleMenu menu = new SimpleMenu(mActivity);
onCreatePanelMenu(Window.FEATURE_OPTIONS_PANEL, menu);
for (int i = 0; i < menu.size(); i++) {
MenuItem item = menu.getItem(i);
addActionButtonCompatFromMenuItem(item);
}
}

75
Tab Drawables — Phones and Tablets, Nine-patches

๏ drawable-hdpi

๏ drawable-xlarge-mdpi-v11

76
Body Content Dimensions — Phones and Tablets
Phones:

values/dimens.xml
<dimen name="body_padding_large"> 10dp </dimen>
<dimen name="text_size_xlarge">
18sp </dimen>
<dimen name="speaker_image_size"> 36dp </dimen>

Tablets:

values-xlarge-v11/dimens.xml
<dimen name="body_padding_large"> 20dp </dimen>
<dimen name="text_size_xlarge">
32sp </dimen>
<dimen name="speaker_image_size"> 64dp </dimen>

77
Get the code:
http://code.google.com/p/iosched
What We Covered
1. Introduction to tablets
2. Honeycomb visual design
3. Tablet UI patterns + Honeycomb framework features
– Interaction design
– Implementation

4. Case study — Google I/O 2011 App

79
Ask questions

Give feedback

http://goo.gl/mod/zdyR

http://goo.gl/4dTQp

#io2011 #Android
Designing and implementing_android_uis_for_phones_and_tablets

Contenu connexe

En vedette

En vedette (7)

Rifno hidayad 13300084
Rifno hidayad 13300084Rifno hidayad 13300084
Rifno hidayad 13300084
 
Toyota production system
Toyota production systemToyota production system
Toyota production system
 
Laser Beam Welding of Plastic
Laser Beam Welding of PlasticLaser Beam Welding of Plastic
Laser Beam Welding of Plastic
 
Automatic Transmission
Automatic TransmissionAutomatic Transmission
Automatic Transmission
 
Seminar report of Laser Beam Welding
Seminar report of Laser Beam WeldingSeminar report of Laser Beam Welding
Seminar report of Laser Beam Welding
 
Graphical User Interface
Graphical User InterfaceGraphical User Interface
Graphical User Interface
 
TOYOTA
TOYOTATOYOTA
TOYOTA
 

Similaire à Designing and implementing_android_uis_for_phones_and_tablets

Designing and implementing_android_uis_for_phones_and_tablets
Designing and implementing_android_uis_for_phones_and_tabletsDesigning and implementing_android_uis_for_phones_and_tablets
Designing and implementing_android_uis_for_phones_and_tabletsTeddy Koornia
 
Designing UIs for phones and tablets - Android Developr Lab Q3 2011
Designing UIs for phones and tablets - Android Developr Lab Q3 2011Designing UIs for phones and tablets - Android Developr Lab Q3 2011
Designing UIs for phones and tablets - Android Developr Lab Q3 2011Paris Android User Group
 
Android ui patterns
Android ui patternsAndroid ui patterns
Android ui patternsMobile March
 
Android ui patterns
Android ui patternsAndroid ui patterns
Android ui patternsvpulec
 
Excellence in the Android User Experience
Excellence in the Android User ExperienceExcellence in the Android User Experience
Excellence in the Android User Experiencemobilegui
 
2012/02/15 Android 4.0 UI Design Tips@happy designer meetup
2012/02/15 Android 4.0 UI Design Tips@happy designer meetup2012/02/15 Android 4.0 UI Design Tips@happy designer meetup
2012/02/15 Android 4.0 UI Design Tips@happy designer meetupJustin Lee
 
Designing native android apps
Designing native android appsDesigning native android apps
Designing native android appsRyan Harter
 
Android design patterns
Android design patternsAndroid design patterns
Android design patternsPlatty Soft
 
Android design patterns in mobile application development presentation
Android design patterns in mobile application development   presentationAndroid design patterns in mobile application development   presentation
Android design patterns in mobile application development presentationMichail Grigoropoulos
 
Application Design - Part 1
Application Design - Part 1Application Design - Part 1
Application Design - Part 1Kelley Howell
 
Lecture #3 activities and intents
Lecture #3  activities and intentsLecture #3  activities and intents
Lecture #3 activities and intentsVitali Pekelis
 
Android 4.0 UI Design Tips
Android 4.0 UI Design TipsAndroid 4.0 UI Design Tips
Android 4.0 UI Design TipsJustin Lee
 
Serenity for Android: Design Tips for Android TV
Serenity for Android: Design Tips for Android TVSerenity for Android: Design Tips for Android TV
Serenity for Android: Design Tips for Android TVDavid Carver
 
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...marjoramg
 
Android session 2-behestee
Android session 2-behesteeAndroid session 2-behestee
Android session 2-behesteeHussain Behestee
 

Similaire à Designing and implementing_android_uis_for_phones_and_tablets (20)

Designing and implementing_android_uis_for_phones_and_tablets
Designing and implementing_android_uis_for_phones_and_tabletsDesigning and implementing_android_uis_for_phones_and_tablets
Designing and implementing_android_uis_for_phones_and_tablets
 
Android UI Patterns
Android UI PatternsAndroid UI Patterns
Android UI Patterns
 
Designing UIs for phones and tablets - Android Developr Lab Q3 2011
Designing UIs for phones and tablets - Android Developr Lab Q3 2011Designing UIs for phones and tablets - Android Developr Lab Q3 2011
Designing UIs for phones and tablets - Android Developr Lab Q3 2011
 
Android ui patterns
Android ui patternsAndroid ui patterns
Android ui patterns
 
Android ui patterns
Android ui patternsAndroid ui patterns
Android ui patterns
 
Excellence in the Android User Experience
Excellence in the Android User ExperienceExcellence in the Android User Experience
Excellence in the Android User Experience
 
Android UI Design Tips
Android UI Design TipsAndroid UI Design Tips
Android UI Design Tips
 
2012/02/15 Android 4.0 UI Design Tips@happy designer meetup
2012/02/15 Android 4.0 UI Design Tips@happy designer meetup2012/02/15 Android 4.0 UI Design Tips@happy designer meetup
2012/02/15 Android 4.0 UI Design Tips@happy designer meetup
 
Designing native android apps
Designing native android appsDesigning native android apps
Designing native android apps
 
Android design patterns
Android design patternsAndroid design patterns
Android design patterns
 
Android design patterns in mobile application development presentation
Android design patterns in mobile application development   presentationAndroid design patterns in mobile application development   presentation
Android design patterns in mobile application development presentation
 
Prototyping + User Journeys
Prototyping + User JourneysPrototyping + User Journeys
Prototyping + User Journeys
 
Application Design - Part 1
Application Design - Part 1Application Design - Part 1
Application Design - Part 1
 
Lecture #3 activities and intents
Lecture #3  activities and intentsLecture #3  activities and intents
Lecture #3 activities and intents
 
Android 4.0 UI Design Tips
Android 4.0 UI Design TipsAndroid 4.0 UI Design Tips
Android 4.0 UI Design Tips
 
Swift
SwiftSwift
Swift
 
iPhone Lunch And Learn
iPhone Lunch And LearniPhone Lunch And Learn
iPhone Lunch And Learn
 
Serenity for Android: Design Tips for Android TV
Serenity for Android: Design Tips for Android TVSerenity for Android: Design Tips for Android TV
Serenity for Android: Design Tips for Android TV
 
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...
 
Android session 2-behestee
Android session 2-behesteeAndroid session 2-behestee
Android session 2-behestee
 

Dernier

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 

Dernier (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 

Designing and implementing_android_uis_for_phones_and_tablets

  • 1.
  • 2. Designing and Implementing Android UIs for Phones and Tablets Matias Duarte Rich Fulcher Roman Nurik Adam Powell Christian Robertson 2 #io2011 #Android
  • 3. Ask questions Give feedback http://goo.gl/mod/zdyR http://goo.gl/4dTQp Note: Both links are also available in the Google I/O Android App
  • 4. Agenda 1. Introduction to tablets 2. Honeycomb visual design 3. Tablet UI patterns + Honeycomb framework features – Interaction design – Implementation 4. Case study — Google I/O 2011 App 4
  • 6. Design Goals for Honeycomb 6
  • 7. Design Goals for Honeycomb 7
  • 8. Design Goals for Honeycomb 8
  • 9. The Beginning of a Journey 9
  • 12. Holo Theme: Design Goals 1 / Enable flexible, dynamic UI 2 / Simplify, open up design 3 / Enable extensibility 12
  • 13. 1 / Enable dynamic UI: early explorations
  • 14. 1 / Enable flexible, dynamic UI
  • 15. 1 / Enable flexible, dynamic UI
  • 16. 1 / Enable flexible, dynamic UI
  • 17. 1 / Enable flexible, dynamic UI
  • 18. Holo Theme: Design Goals 1 / Enable flexible, dynamic UI 2 / Simplify, open up design 3 / Enable extensibility 18
  • 19.
  • 20. 2 / Simplify: removing boxes
  • 21. 2 / Simplify: removing boxes
  • 22. 2 / Simplify: robust spacing, grid metrics
  • 23. 2 / Simplify: robust spacing, grid metrics
  • 24. Holo Theme: Design Goals 1 / Enable flexible, dynamic UI 2 / Simplify, open up design 3 / Enable extensibility 24
  • 25. 3 / Enable extensibility: Design tips ๏ Choose light or dark theme as a start point – Consider changing highlight color and background image – When overriding styles and themes, override all assets ๏ Open design, removing boxes where appropriate – Spacing and metrics matter – “Stretch to fill” on tablets doesn’t work for many UI elements ๏ Spend time on icons & promo graphics ... 25
  • 28. Honeycomb UI patterns and framework features
  • 29. UI Patterns ๏ Like a software design pattern, a UI design pattern describes a general solution to a recurring problem ๏ Framework-supported ๏ Guidelines, not restrictions ๏ Topics we’ll discuss today: 1. 2. 3. 4. 29 Action Bar Multi-pane Layouts App Navigation Beyond the List
  • 30. Action Bar Introduction ๏ Not a new pattern – Presented as phone UI pattern at last year's I/O – Used in many apps through Android Market – Honeycomb has greatly extended its usefulness ๏ Dedicated real estate at the top of each screen – Generally persistent throughout application ๏ Used to make frequently used actions prominent ๏ Supports navigation ๏ Convenient means of handling Menu and Search 30
  • 31. Action Bar General organization ๏ App icon ๏ View details ๏ Action buttons 31
  • 32. Action Bar General organization ๏ App icon – Can be replaced with logo or other branding – Used to support “upward” navigation within the app 32
  • 33. Action Bar General organization ๏ View details – Simple: non-interactive title bar replacement – Richer: Tabs, drop-down menus, breadcrumbs 33
  • 34. Action Bar General organization ๏ Action buttons – More important / frequently-accessed action at left – Buttons can be icon-only, text-only, or icon-and-text – Overflow menu 34
  • 35. Action Bar Contextual actions ๏ Action bar can transform its appearance when items are selected – Useful for single or multiple selection – Typically invoking via touch and hold ๏ Like normal action bar, three sections: – Done button (for releasing selection) – Selection details – Action Buttons ๏ Implemented using ActionMode 35
  • 36. Action Bar Implementation ๏ Basic action bar – Theme.Holo or targetSdkVersion ≥ 11. – Action items from res/menu/ ๏ Customizing the action bar – ActionBar class – showAsAction for menu items http://j.mp/customizing-action-bar 36
  • 37. Action Bar Compatibility 1. Write a custom action bar implementation pre-Honeycomb http://code.google.com/p/iosched 2. Alternatively, defer to the standard Options menu 37
  • 38. Action Bar Phones and smaller screens ๏ Swap out elements for space-conservative variants – Icon + text reduced to just icon – Overflow icon hidden, invoked using MENU key ๏ Split single bar into two – View portion such as Tabs can become second row, below action bar – Actions can move into bottom action bar ๏ 2-3 main action buttons, others placed in Overflow – Determined by showAsAction = “ifRoom” or “always” 38
  • 40. Multi-pane Layouts Introduction ๏ Take advantage of vastly increased real estate – Give more context – Consolidate multiple related phone screens into a single compound view – Avoid excessively long line lengths ๏ Panes to the right should generally present more content or details for items selected in the panes on the left. 40
  • 41. Multi-pane Layouts Strategies Orientation change ๏ Orientation changes should preserve functional parity – User shouldn’t have to rotate device to achieve a task ๏ Strategies apply per-screen, not per app ๏ For the show/hide orientation strategy, use UP navigation to show the master pane – e.g. Gmail conversation view 41 Stretch Stack (e.g. Settings) (e.g. Calendar) Expand/collapse Show/hide (e.g. Google Talk) (e.g. Gmail)
  • 42. Multi-pane Layouts Implementation — Fragments ๏ Fragment class ๏ Optionally use the <fragment> tag in layout XML 42
  • 43. Multi-pane Layouts A quick intro to Fragments ๏ “Fragments” of an Activity ๏ Unit of reuse between Activities ๏ Separation of concerns ๏ Fragments don’t necessarily have views – Fragments are a lifecycle construct, not necessarily a visual construct ๏ ...but this talk is about UI. 43
  • 44. Multi-pane Layouts Compatibility ๏ Can use Fragments with the Android support library available through the SDK manager ๏ Use getSupportFragmentManager ๏ All activities extend FragmentActivity http://j.mp/fragments-for-all 44
  • 45. Multi-pane Layouts Using resources ๏ You’ve probably seen this before: – drawable-ldpi/ – drawable-mdpi/ – drawable-hdpi/ ๏ But you can also do this: – – – – 45 layout-normal/ layout-large/ layout-xlarge/ layout-xlarge-port/
  • 46. Multi-pane Layouts Using resources ๏ Activities can inflate layouts with different fragment configurations 46
  • 47. Multi-pane Layouts Using resources ๏ Activities can inflate layouts with different fragment configurations Stack (e.g. Calendar) 47
  • 48. Multi-pane Layouts Using resources ๏ Activities can inflate layouts with different fragment configurations layout-xlarge-land/my_layout.xml Stack (e.g. Calendar) 48 <LinearLayout android:orientation=”horizontal” android:layout_width=”match_parent” android:layout_height=”match_parent”> <fragment android:name=”com.example.MainPaneFragment” android:id=”@+id/main_pane” android:layout_width=”0dip” android:layout_weight=”1” android:layout_height=”match_parent” /> <LinearLayout android:orientation=”vertical” android:layout_width=”wrap_content” android:layout_height=”match_parent”> <fragment android:name=”com.example.MonthFragment” android:id=”@+id/month_pane” android:layout_width=”wrap_content” android:layout_height=”0dip” android:layout_weight=”1” /> <fragment android:name=”com.example.CalendarListFragment” android:id=”@+id/list_pane” android:layout_width=”wrap_content” android:layout_height=”0dip” android:layout_weight=”1” /> </LinearLayout> </LinearLayout>
  • 49. Multi-pane Layouts Using resources ๏ Activities can inflate layouts with different fragment configurations layout-xlarge-port/my_layout.xml Stack (e.g. Calendar) 49 <LinearLayout android:orientation=”vertical” android:layout_width=”match_parent” android:layout_height=”match_parent”> <fragment android:name=”com.example.MainPaneFragment” android:id=”@+id/main_pane” android:layout_width=”match_parent” android:layout_height=”0dip” android:layout_weight=”1” /> <LinearLayout android:orientation=”horizontal” android:layout_width=”match_parent” android:layout_height=”wrap_content”> <fragment android:name=”com.example.MonthFragment” android:id=”@+id/month_pane” android:layout_width=”0dip” android:layout_weight=”1” android:layout_height=”wrap_content” /> <fragment android:name=”com.example.CalendarListFragment” android:id=”@+id/list_pane” android:layout_width=”0dip” android:layout_weight=”1” android:layout_height=”wrap_content” /> </LinearLayout> </LinearLayout>
  • 50. Multi-pane Layouts Using resources ๏ Some other handy uses: – Fragments can use layouts with different view configurations – List items can be more detailed or compact as needed – integer or boolean resources can have different values 50
  • 51. App Navigation Introduction ๏ One of the more dramatic changes in Honeycomb ๏ Increased variety of mechanisms for direct, deep navigation into an app 51
  • 52. App Navigation Highlights Richer home screen widgets Richer notifications ‘Recents’ 52
  • 53. App Navigation Navigation and user memory ๏ Android has traditionally relied on temporal memory: – – – – Users are good at remembering what just happened Great for snapping back to one context directly from another Much harder to sequence precise order of events that happened a little while ago More potential for error, surprise ๏ Users have strong structural memory – Remember relationships between screens in an app – Used to going “Home” in web apps – Clearer expectations for behavior 53
  • 54. App Navigation Back versus Up ๏ SYSTEM BACK navigates history between related screens ๏ APPLICATION UP navigates hierarchy within a single app 54
  • 56. App Navigation Example Flows Contacts Task Contacts 56 Contact details
  • 57. App Navigation Example Flows BACK Contacts Task Contacts 57 Contact details
  • 58. App Navigation Example Flows UP Contacts Task Contacts 58 Contact details
  • 60. App Navigation Example Flows Contacts Task Contacts 60 Contact details
  • 61. App Navigation Example Flows Contacts Task Contacts 61 Contact details Compose email
  • 62. App Navigation Example Flows BACK Contacts Task Contacts 62 Contact details Compose email
  • 63. App Navigation Example Flows Contacts Task Contacts Contact details UP Gmail Task Gmail 63 Compose email
  • 64. App Navigation What you need to do ๏ If you have an app with hierarchy, support UP in action bar ๏ If you support system deep links into your app, inject screens “above” the target into the back stack – E.g. Deep link from a widget – E.g. Deep link from a notification 64
  • 65. Beyond the List Introduction ๏ Views for media-rich applications ๏ “Hero moments” to break the monotony of list views ๏ Encourage more engaged exploration, akin to flipping through a magazine 65
  • 67. Beyond the List Implementation ๏ CarouselView – Renderscript – Intended for customization http://j.mp/io2011-carousel-sample ๏ FragmentPager, Workspace for showing one item or page at a time ๏ Don’t use the Gallery widget 67
  • 68. Case study — Google I/O 2011 App
  • 69. Download the app now. We’ll wait. http://goo.gl/UhnLT 69
  • 70.
  • 71.
  • 72.
  • 73. How it works Basics ๏ Single .APK ๏ Custom layouts, drawable, style, dimension resources for -xlarge-v11 – Gingerbread tablets will use ‘normal’, phone layout ๏ Fragment compatibility library 73
  • 74. How it works Activities ๏ Different types of activities: – Universal: – Phone-only: HomeActivity – Tablet-only: SessionsMultiPaneActivity SessionsActivity (single fragment) ๏ Activity helpers – ActivityHelper – ActivityHelperHoneycomb 74 BaseSinglePaneActivity BaseMultiPaneActivity
  • 75. How it works Action bar ๏ Custom action bar (ActionBarCompat) for phones – Still using res/menu/ – Action bar and buttons are just styled Views public void onPostCreate(Bundle savedInstanceState) { SimpleMenu menu = new SimpleMenu(mActivity); onCreatePanelMenu(Window.FEATURE_OPTIONS_PANEL, menu); for (int i = 0; i < menu.size(); i++) { MenuItem item = menu.getItem(i); addActionButtonCompatFromMenuItem(item); } } 75
  • 76. Tab Drawables — Phones and Tablets, Nine-patches ๏ drawable-hdpi ๏ drawable-xlarge-mdpi-v11 76
  • 77. Body Content Dimensions — Phones and Tablets Phones: values/dimens.xml <dimen name="body_padding_large"> 10dp </dimen> <dimen name="text_size_xlarge"> 18sp </dimen> <dimen name="speaker_image_size"> 36dp </dimen> Tablets: values-xlarge-v11/dimens.xml <dimen name="body_padding_large"> 20dp </dimen> <dimen name="text_size_xlarge"> 32sp </dimen> <dimen name="speaker_image_size"> 64dp </dimen> 77
  • 79. What We Covered 1. Introduction to tablets 2. Honeycomb visual design 3. Tablet UI patterns + Honeycomb framework features – Interaction design – Implementation 4. Case study — Google I/O 2011 App 79