56
AWESOME ANDROID DESIGN +Android Developers —Nick Butcher

Awesome android design

Embed Size (px)

DESCRIPTION

This slide is packed full of important information from beginner to experienced Android designers and developers!

Citation preview

Page 1: Awesome android design

AWESOME

ANDROIDDESIGN

+Android Developers

—Nick Butcher

Page 2: Awesome android design

Awesome Android Design…

HOLOVISUAL

LANGUAGE

TECHNIQUES

RESPONSIVEDESIGN

TOOLS

WHY

IMPLEMENTING

Page 3: Awesome android design

Holo Visual Language

Page 4: Awesome android design

Holo Visual Language

Page 5: Awesome android design

Content First

Page 6: Awesome android design

Content FirstBorderless

buttons

Button

bar

Page 7: Awesome android design

Typography

Hello, Roboto

Roboto Thin & Thin Oblique

Roboto Light & Light Oblique

Roboto Regular & Regular ObliqueRoboto Medium & Medium ObliqueRoboto Bold & Bold Oblique

Roboto Black & Black Oblique

Roboto Condensed & Condensed ObliqueRoboto Bold CondensedBold Condensed Oblique

Page 8: Awesome android design

USE TYPOGRAPHYto provide STRUCTURE and emphasis

Page 9: Awesome android design

Colour

Holo != #33b5e5

Page 10: Awesome android design

Colour

Use your brand colour for accent

Use high-contrast colour for emphasis

Page 11: Awesome android design

ColourTouch feedback

Jolt of highcontrast

Sprinkles ofencouragement

Holo Light: 20% #999

(#33999999)

Holo Dark: 25% #ccc

(#40cccccc)

Page 12: Awesome android design

Branding

Information

Design

Interaction

Design

Visual

Design

Holo/AndroidYou

Page 13: Awesome android design

TOOLS

ANDROID HOLO COLORS

Generate Holo assets for UI

controls, using your brand’s

accent color

android-holo-colors.com

Page 14: Awesome android design

TOOLS

ACTION BAR STYLE GENERATOR

Generate Holo assets for the

action bar and tabs, using your

brand’s accent color

actionbarstylegenerator.com

Page 15: Awesome android design

Implementing Holo

Page 16: Awesome android design

Themes

res/values/styles.xml<style name="MyTheme" parent="android:Theme.Holo.Light"/>

minSdkVersion 11+

<style name="MyTheme" parent="Theme.AppCompat.Light"/>

res/values/styles.xml

minSdkVersion 7–11

AndroidManifest.xml<application ...

theme="@style/MyTheme">

Inherit from Holo styles…

Page 17: Awesome android design

Use the frameworkReference styles, dimensions and drawables from the current theme

Current theme value

(eqivilant to ?android:attr/baz)

<View style="?android:foo" .../>

<View android:minHeight="?android:bar" .../>

<View android:background="?android:baz" .../>

See android.R.attr for all style attributes

Page 18: Awesome android design

Usetheframework

Page 19: Awesome android design

Use the framework

<TextView style="?android:listSeparatorTextViewStyle" android:layout_width="match_parent"

android:layout_height="wrap_content"

android:text="Section header" />

2dp separator

14sp, bold, ALL CAPS

Page 20: Awesome android design

Use the framework

<TextView android:textAppearance= "?android:textAppearanceMedium" android:text="Sample item 1"

... />

<ImageButton style="?android:borderlessButtonStyle" ... />

18sp

Stateful background

Page 21: Awesome android design

Use the framework<LinearLayout android:orientation="vertical"

android:showDividers="middle" android:divider="?android:dividerHorizontal" ...>

<LinearLayout android:orientation="horizontal"

android:baselineAligned="false"

android:showDividers="middle" android:divider="?android:dividerVertical" android:dividerPadding="8dp" ...>

Padding creates

hierarchy

Page 22: Awesome android design

Use the framework

<LinearLayout style="?android:buttonBarStyle" ...>

<Button style="?android:buttonBarButtonStyle" ...>

Stateful background

Adds dividers

Page 23: Awesome android design
Page 24: Awesome android design

Style the framework

requestWindowFeature(

Window.FEATURE_INDETERMINATE_PROGRESS);setContentView(R.layout.activity_main);

...

setProgressBarIndeterminateVisibility(true);

MainActivity#onCreate

Activity indicator

Page 25: Awesome android design

Style the framework

<style name="MyTheme" parent="...">

<item name="android:actionBarStyle">@style/ActionBar</item></style>

Styled

activity indicator

<style name="Widget.ActionBar.ActivityIndicator" parent="..."> <item name="android:minWidth">48dp</item> <item name="android:maxWidth">48dp</item> <item name="android:minHeight">32dp</item> <item name="android:maxHeight">32dp</item></style>

<style name="ActionBar" parent="..."> <item name="android:indeterminateProgressStyle"> @style/Widget.ActionBar.ActivityIndicator</item></style>

Page 26: Awesome android design

Query theme values

Control inset by

Action Bar height

Page 27: Awesome android design

Query theme values

TypedValue value = new TypedValue(); getActivity().getTheme().resolveAttribute( android.R.attr.actionBarSize, value, true);

int actionBarSize = getResources() .getDimensionPixelSize(value.resourceId);

// now inset the map control

getMap().setPadding(0, actionBarSize, 0, 0);

Page 28: Awesome android design

Responsive Design

Page 29: Awesome android design

Why responsive?

Page 30: Awesome android design

Why responsive?

Page 31: Awesome android design

Combining content

Page 32: Awesome android design

Combining contentres/

...

layout/

activity_home.xml

activity_details.xml

fragment_list.xml

fragment_details.xml

layout-sw720dp/

activity_home.xml

...

Page 33: Awesome android design

Combining contentres/

...

layout/

activity_home.xml

activity_details.xml

fragment_list.xmlfragment_details.xml

layout-sw720dp/

activity_home.xml

...

Page 34: Awesome android design

Combining contentres/

...

layout/

activity_home.xml

activity_details.xml

fragment_list.xmlfragment_details.xml

layout-sw720dp/

activity_home.xml

...

Page 35: Awesome android design

Combining contentres/

...

layout/

activity_home.xml

activity_details.xml

fragment_list.xml

fragment_details.xml

layout-sw720dp/activity_home.xml

...

Page 36: Awesome android design

Combining contentSlidingPaneLayout

Page 37: Awesome android design

Combining contentSlidingPaneLayout<android.support.v4.widget.SlidingPaneLayout ... android:layout_width="match_parent"

android:layout_height="match_parent">

<!-- First child is the left pane --> <fragment android:name="com.example.ListFragment"

android:layout_width="280dp" android:layout_height="match_parent"

android:layout_gravity="start" />

<!-- Second child is the right (content) pane --> <fragment android:name="com.example.DetailFragment"

android:layout_width="600dp" android:layout_height="match_parent"

android:layout_weight="1" />

</android.support.v4.widget.SlidingPaneLayout>

If combined pane widths

exceed screen width then

right pane overlaps

Page 38: Awesome android design

Lists and grids

Page 39: Awesome android design

Lists and grids

<GridView ... android:numColumns="@integer/num_columns" />

res/layout/activity_home.xml

<resources>

<integer name="num_columns">1</integer></resources>

res/values/integers.xml

<resources>

<integer name="num_columns">2</integer></resources>

res/values-w500dp/integers.xml

Page 40: Awesome android design

Lists and gridsMyAdapter#getView

if (convertView == null) {

int numColumns = getResources().getInteger(R.integer.num_columns);if (numColumns == 1) {convertView =

inflater.inflate(R.layout.list_item_layout, parent, false);

} else {convertView =

inflater.inflate(R.layout.grid_item_layout, parent, false);

}

}

...

Page 42: Awesome android design

Inside out design

Page 43: Awesome android design

Inside out design Going Responsive with Google Play

http://goo.gl/ceytgQ

Page 44: Awesome android design

Extract dimensions

headline_text_size

body_text_size

default_spacing_major

body_line_spacing<dimen name="default_spacing_major">32dp</dimen><dimen name="body_text_size">20sp</dimen><dimen name="body_line_spacing" format="float" type="dimen">1.2</dimen>

res/values-sw720dp/dimens.xml

res/values/dimens.xml<dimen name="default_spacing_major">16dp</dimen><dimen name="default_spacing_minor">8dp</dimen>

<dimen name="default_spacing_micro">4dp</dimen>

<dimen name="body_text_size">18sp</dimen><dimen name="body_line_spacing" format="float" type="dimen">1.0</dimen>

Page 45: Awesome android design

Maximum widths

Avoid overly wide line lengths for comfortable reading

Optimal measure is 45–75 chars per line

Page 46: Awesome android design

Maximum widths MaxWidthLinearLayout

http://goo.gl/zNY0jy

<com.example.MaxWidthLinearLayout android:layout_width="match_parent"

android:layout_height="wrap_content"

android:gravity="center_horizontal"

android:orientation="vertical">

  <TextView

app:layout_maxWidth="600dp" android:layout_width="match_parent"

android:layout_height="wrap_content"

android:text="@string/lorem_ipsum"

... />

</com.example.MaxWidthLinearLayout>

Page 47: Awesome android design

Responsive images

1dp separator<ImageView android:scaleType="centerCrop" android:src="@drawable/bacon"

android:layout_width="match_parent"

android:layout_height="match_parent" />

Page 48: Awesome android design

res/...

drawable/drawable-xhdpi/layout/layout-w600dp/layout-sw600dp-land/layout-sw720dp/values/values-sw600dp/values-sw720dp/...

Alternate density drawables for crispness

Alternate layouts for different sized displays

Alternate dimensions for different sized displays

Use the resources framework

Page 49: Awesome android design

Tips for designers

Page 50: Awesome android design

1 Use an Android phone and learn it’s patterns

Page 51: Awesome android design

2 Map your information design to android

navigation patterns

Page 52: Awesome android design

3 Know your pixels from your DIPs

http://youtu.be/zhszwkcay2A

Page 53: Awesome android design

4 Design layout at MDPI i.e. 1px = 1dp

Page 54: Awesome android design

5 Consider scale from the start

Page 55: Awesome android design

Awesome Android Design…

HOLOVISUAL

LANGUAGE

TECHNIQUES

RESPONSIVEDESIGN

TOOLS

WHY

IMPLEMENTING

Page 56: Awesome android design

Thanks!

+Android Developers

—Nick Butcher