material design - høgskolen ringerike 2017

76
Material Design Konstantin Loginov & NorApps AS March 22 nd , 2017 1

Upload: konstantin-loginov

Post on 06-Apr-2017

46 views

Category:

Software


4 download

TRANSCRIPT

Page 1: Material Design - Høgskolen Ringerike 2017

Material DesignKonstantin Loginov & NorApps AS

March 22nd, 2017 1

Page 2: Material Design - Høgskolen Ringerike 2017

INTRODUCTION

2

Konstantin Loginov

9 years in mobile development• Windows Mobile• webOS• Windows Phone• iOS• Android

[email protected]| NorApps AS

Board-member of Mobile Era Conference

Page 3: Material Design - Høgskolen Ringerike 2017

NorApps AS

3

Small team of 7 (soon 8!) people from Bergen, Oslo and Guadalajara

FotMob is our main product

We love football (yes, it’s a job pre-requirement)

Featured by Google & Apple

Page 4: Material Design - Høgskolen Ringerike 2017

NorApps AS

4

FotMob is our main product

We are hiring

Page 5: Material Design - Høgskolen Ringerike 2017

– Why should I care about UI / UX? I’m a developer!

Page 6: Material Design - Høgskolen Ringerike 2017
Page 7: Material Design - Høgskolen Ringerike 2017
Page 8: Material Design - Høgskolen Ringerike 2017

+ 280 %conversions rate

+ 540 %conversions rate

* Adweek: How App Store Ratings Impact Downloads: http://www.adweek.com/digital/how-app-store-ratings-impact-downloads-infographic/

Page 9: Material Design - Høgskolen Ringerike 2017

- 25% downloads

Page 10: Material Design - Høgskolen Ringerike 2017

Featured app gets up to x100 downloads daily

Page 11: Material Design - Høgskolen Ringerike 2017

– But Craigslist and Reddit are on fire despite having design from 90s?

Page 12: Material Design - Høgskolen Ringerike 2017
Page 13: Material Design - Høgskolen Ringerike 2017

Android-devices are different

Material Design – unification of user-experience across different surfaces

Page 14: Material Design - Høgskolen Ringerike 2017

What is Material design?

14

• Design language developed in 2014 by Google driven by typography, color, scale and position

• based on paper and ink

Material design is a comprehensive guide for visual, motion, and interaction design across platforms and devices.

Page 15: Material Design - Høgskolen Ringerike 2017

“unlike real paper, our digital material can expand and

reform intelligently. Material has physical surfaces and edges. Seams and shadows provide meaning

about what you can touch.

15

Matías Duarte

Page 16: Material Design - Høgskolen Ringerike 2017

Pre-Material AndroidDevices & manufactures fragmentation:• 12000 different devices by 2013 (24000 by 2015)• OEMs customize UI in all possible ways

Page 17: Material Design - Høgskolen Ringerike 2017

Pre-Material Android

FotMob 2010 Gmail 2013Example of featured app 2012

Page 18: Material Design - Høgskolen Ringerike 2017

2014 - …20122010

Mobile design evolution

Page 19: Material Design - Høgskolen Ringerike 2017

Material design core principles

19

• All material objects have x, y, and z dimensions.• All material objects have a single z-axis position.• Key lights create directional shadows, and ambient light

creates soft shadows.

Page 20: Material Design - Høgskolen Ringerike 2017

Material design core principles

20

The material environment is a 3D space, which means all objects have x, y, and z dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the positive z-axis extending towards the viewer. Every sheet of material occupies a single position along the z-axis

Page 21: Material Design - Høgskolen Ringerike 2017

Material design core principles

21

Within the material environment, virtual lights illuminate the scene. Key lights create directional shadows, while ambient light creates soft shadows from all angles.

Shadows in the material environment are cast by these two light sources. Shadows occur when light sources are blocked by sheets of material at various positions along the z-axis

Page 22: Material Design - Høgskolen Ringerike 2017

Shadow cast by ambient light

Combined shadow from key and ambient lights

Shadow cast by key light

Page 23: Material Design - Høgskolen Ringerike 2017

Material design core principles

23

Material has varying x & y dimensions (measured in dp) and a uniform thickness (1dp)

Page 24: Material Design - Høgskolen Ringerike 2017

Material design core principles

24

Material is solid - input events only affect the foreground material

Page 25: Material Design - Høgskolen Ringerike 2017

Material design core principles

25

Multiple material elements cannot occupy the same point in space simultaneously.

Page 26: Material Design - Høgskolen Ringerike 2017

Material design core principles

26

Material cannot pass through other material.

Page 27: Material Design - Høgskolen Ringerike 2017

Material design - Android

27

Introduced in Android 5.0 (API level 21)• A new theme• New widgets for complex views• New APIs for custom shadows and animations

The Design Support library is compatible with Android 2.3 (API level 9):

Page 28: Material Design - Høgskolen Ringerike 2017

“A style is a collection of attributes that specify the look and format for a View or window. A style can

specify attributes such as height, padding, font color, font size, background color, and much more.

A style is defined in an XML resource that is separate from the XML that specifies the layout.

28

https://developer.android.com/guide/topics/ui/themes.html

Page 29: Material Design - Høgskolen Ringerike 2017

“A theme is a style applied to an entire Activity or

app, rather than an individual View. When a style is applied as a theme, every view in the activity or app applies each style attribute that it supports.

29

https://developer.android.com/guide/topics/ui/themes.html

Page 30: Material Design - Høgskolen Ringerike 2017

Material design - Android

30

Applies to all app

Applies to LightActivity

No theme defined – use Application-specified theme

Page 31: Material Design - Høgskolen Ringerike 2017

Material design - Android

31

Customizing theme

Applying customized theme

Page 32: Material Design - Høgskolen Ringerike 2017

Material design - Android

32

Page 33: Material Design - Høgskolen Ringerike 2017

Material design – Material theme

33Light material themeDark material theme

Page 34: Material Design - Høgskolen Ringerike 2017

Material design – Material theme

34Read more about Styles and Themes: https://developer.android.com/guide/topics/ui/themes.html

NB! You will use appcompat-v7 library all around. AppCompatActivity brings material support to older devices. This support-lib has it’s own Theme-naming:

• @style/Theme.AppCompat• @style/Theme.AppCompat.Light• @ style/Theme.AppCompat.Light.DarkActionBar

The material theme is defined as:• @android:style/Theme.Material (dark version)• @android:style/Theme.Material.Light (light version)• @android:style/Theme.Material.Light.DarkActionBar

Page 35: Material Design - Høgskolen Ringerike 2017

Material design – New widgets – RecyclerView

35

The RecyclerView widget is a more advanced and flexible version of ListView. This widget is a container for displaying large data sets that can be scrolled very efficiently by maintaining a limited number of views.

Simplifies the display and handling of large data sets by providing:• Layout managers for positioning items• Default animations for common item operations, such as removal or addition of items

Page 36: Material Design - Høgskolen Ringerike 2017

Material design – New widgets – RecyclerView

36

Page 37: Material Design - Høgskolen Ringerike 2017

Material design – New widgets – RecyclerView

37Don’t forget about extra-dependency!

LinearLayoutManager StaggeredGridLayoutManager

Page 38: Material Design - Høgskolen Ringerike 2017

Material design – New widgets – CardView

38

CardView extends the FrameLayout class and lets you show information inside cards that have a consistent look across the platform. CardView widgets can have shadows and rounded corners.

Page 39: Material Design - Høgskolen Ringerike 2017

Material design – New widgets – CardView

39CardView is part of Cardview Support library

Page 40: Material Design - Høgskolen Ringerike 2017

Material design – New widgets – Floating Action Button

41

A floating action button represents the primary action in an application.

Shaped like a circled icon floating above the UI, it changes color upon focus and lifts upon selection. When pressed, it may contain more related actions.

Page 41: Material Design - Høgskolen Ringerike 2017

Material design – New widgets – Floating Action Button

42

Page 42: Material Design - Høgskolen Ringerike 2017

Material design – New widgets – Floating Action Button

43FloatingActionButton is part of Design Support library

Page 43: Material Design - Høgskolen Ringerike 2017

Material design – New widgets – Coordinator Layout

44

CoordinatorLayout is a -powered FrameLayout.CoordinatorLayout is intended for two primary use cases:

1. As a top-level application decor or chrome layout2. As a container for a specific interaction with one or

more child views

CoordinatorLayout is also part of Design Support library

Page 44: Material Design - Høgskolen Ringerike 2017

Material design – New widgets – Coordinator Layout

40

==

Page 45: Material Design - Høgskolen Ringerike 2017

Material design – New widgets – Coordinator Layout – Header

45

• AppBarLayout is a vertical LinearLayout under the hood• Requires all children to provide their desired scrolling behavior• Doesn’t work outside of CoordinatorLayout• In most cases, works in conjunction with CollapsingToolbarLayout

Page 46: Material Design - Høgskolen Ringerike 2017

Material design – New widgets – Coordinator Layout – Content

46

… or any other scrollable content ** Content-widget has to define layout behavior:app:layout_behavior="@string/appbar_scrolling_view_behavior"

Page 47: Material Design - Høgskolen Ringerike 2017

Elevation & Shadows

Page 48: Material Design - Høgskolen Ringerike 2017

Material design – 50 shades of grey

48

Elevation is the relative depth, or distance, between two surfaces along the z-axis.

Page 49: Material Design - Høgskolen Ringerike 2017

Material design – 50 shades of grey

49

Page 50: Material Design - Høgskolen Ringerike 2017

Material design – 50 shades of grey

50

Page 51: Material Design - Høgskolen Ringerike 2017

Material design – 50 shades of grey

51

Page 52: Material Design - Høgskolen Ringerike 2017

Material design – 50 shades of grey

52

Before:

Page 53: Material Design - Høgskolen Ringerike 2017

Material design – 50 shades of grey

53

After:

It’s easy to add elevation! It works only for API Level 21+

Page 54: Material Design - Høgskolen Ringerike 2017

Animations

Page 55: Material Design - Høgskolen Ringerike 2017

Material design – Animations

55

The new animation APIs let you create custom animations for touch feedback in UI controls, changes in view state, and activity transitions.

These APIs let you:• Respond to touch events in your views with touch feedback animations.• Hide and show views with circular reveal animations.• Switch between activities with custom activity transition animations.• Create more natural animations with curved motion.• Animate changes in one or more view properties with view state change animations.• Show animations in state list drawables between view state changes.

NB! Touch feedback animations are built into several standard views, such as buttons. The new APIs let you customize these animations and add them to your custom views.

Page 56: Material Design - Høgskolen Ringerike 2017

Material design – Animations – Examples

56

Page 57: Material Design - Høgskolen Ringerike 2017

Material design – Animations – Examples

57

Page 58: Material Design - Høgskolen Ringerike 2017

– What else in the guidelines?

Page 59: Material Design - Høgskolen Ringerike 2017

Material design - Usability

59

• Accessibility guide – set of rules & practices to allows users of all abilities to navigate, understand, and use your UI successfully

• Bidirectionality guide – practices of displaying content for right-to-left (RTL) languages (Arabic, etc.)

Page 60: Material Design - Høgskolen Ringerike 2017

Material design - Accessibility

60

https://www.google.com/accessibility/ - Google’s overview of Accessibility features

1. Clear layout• Clearly visible elements• Sufficient contrast and size• A clear hierarchy of importance• Key information discernable at a glance

Page 61: Material Design - Høgskolen Ringerike 2017

Material design - Accessibility

61

Page 62: Material Design - Høgskolen Ringerike 2017

Material design - Accessibility

62

2. Robust• Give users confidence in knowing where they are in your app and what is important• Reinforce important information through multiple visual and textual cues• Make sure app works via

1. Voice Access2. Switch Access3. TalkBack

Page 63: Material Design - Høgskolen Ringerike 2017

Material design - Accessibility

63

Page 64: Material Design - Høgskolen Ringerike 2017

Material design - Accessibility

64

When you create a new app – by default it’s accessible. Don’t ruin it!• Do not use small text sizes

• Do not use “dp” as a textSize, only “sp”• Use contrast colors for text and background

NB! System themes are taking care of it

Page 65: Material Design - Høgskolen Ringerike 2017

Material design - Accessibility

65Read more about Android accessibility: http://developer.android.com/guide/topics/ui/accessibility/index.html

• Carefully use third-party libraries for UI work• Give a meaningful contentDescriptions for ImageViews,

Buttons, CheckBox, etc.

• Don’t forget “state_focused” in selector

Page 66: Material Design - Høgskolen Ringerike 2017

Material design - Bidirectionality

66

• LTR languages display content from left to right• RTL languages display content from right to left You need to support both!

Page 67: Material Design - Høgskolen Ringerike 2017

Material design - Bidirectionality

67

Page 68: Material Design - Høgskolen Ringerike 2017

Material design - Bidirectionality

68

When you create a new app – by default it’s bidirectional. Don’t ruin it!

• Read all warning in Layout editor• Never use marginLeft without marginRight, paddingLeft without

paddingRight • Use standard control-containers (LinearLayout, RelativeLayout, etc.) &

controlsNB! ViewPager doesn’t support bidirectionality. Live with that.

Page 69: Material Design - Høgskolen Ringerike 2017

Almost ready!

Page 70: Material Design - Høgskolen Ringerike 2017

Material design – Best in class

70

Asana: organize team projects

Page 71: Material Design - Høgskolen Ringerike 2017

Material design – Best in class

71

Kitchen Stories

Find out more: https://design.google.com/articles/material-design-awards-2016/

Page 72: Material Design - Høgskolen Ringerike 2017

Useful links• Video-course:

https://www.udacity.com/course/material-design-for-android-developers--ud862• Guidelines:

https://design.google.comhttps://material.iohttps://material.io/guidelines/https://developer.android.com/design/material/index.html

• Material icons (free to use!): https://material.io/icons/https://github.com/google/material-design-icons

• Fonts:https://fonts.google.com

• Accessibility:https://www.google.com/accessibility/

Page 73: Material Design - Høgskolen Ringerike 2017

Some advice - General

73

Contribute to StackOverflow• Challenge yourself• Great exercise in practical problem-solving• Looks nice on your CV• Arguably, the best way of learning is to get a question and find an answer for it

Take part in OpenSource projects on GitHub (and/or your own projects) • Read others code, do code reviews – try to notice good and bad practices from others• Gives a great practical experience with team work, code source control, problem solving

Page 74: Material Design - Høgskolen Ringerike 2017

Some advice - Android

74

Read twitter, blogs, listen to podcasts:• http://fragmentedpodcast.com• @chethaase, @JakeWharton, @Piwai, @ianhlake, @AndroidDev, @dontmesswithjo• https://android-developers.googleblog.com

Udacity - free video-courses about Android & all other cool technologies• https://www.udacity.com

Most code you need is already written - use Open Source Libraries

Page 75: Material Design - Høgskolen Ringerike 2017

Some advice - Android

75

Square, Inc & Jake Wharton are main contributors into Android community.Check out their GitHub-repository: http://square.github.io

If you want to be a professional, these 5 libraries are mandatory: • Dagger 2• Picasso• Okhttp• Retrofit• RxJava