SlideShare a Scribd company logo
1 of 34
Download to read offline
Michał Biernacki, DeSmart
Android app materialization in practice
?
Material Design from developer’s
perspective
Material Design - dev's perspective
App layout changes,
a lot of new APIs making view transitions 

and animations Activity easier...
… to apply on Lollipop only,
possibility to set z-index to views so that 

framework could render real time shadows ...
… and for the remaining 99% of the devices 

we will make them as graphics.
Fragmentation FTW!!!
Where to start
?
Styles
Styles
For Android 5.0+:
Material.Light
Material.Dark
For AppCompat:
Theme.AppCompat.Light
ThemeAppCompat.Dark
Styles
android:colorPrimary
android:colorPrimaryDark
android:colorAccent
android:statusBarColor (inherited by default 

from colorPrimaryDark)
when using AppCompat write attributes without
android namespace.
Views/Widgets
Toolbar
Toolbar
ActionBar class generalization,
it can be placed at any level of view hierarchy,
you can have multiple Toolbar instances 

in your layout,
you can set Toolbar as a replacement 

for standard ActionBar in your Activity.
Toolbar as ActionBar (in AppCompat)
Set the correct style so that the framework 

won't draw standard ActionBar (using
Theme.AppCompat.NoActionBar for example),
add Toolbar to your layout,
make your Activity extend ActionBarActivity,
and in your Activity:
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
Toolbar
You can add child components to the Toolbar 

which inherits from ViewGroup,
Toolbar containing a SwitchCompat 

in Google Inbox app:
SwitchCompat - bug
RecyclerView
RecyclerView
ListView 2.0,
RecyclerView is a flexible view providing 

a limited window into a large data set,
it uses plugable classes for drawing, animating 

and positioning child components,
it’s available as a separate library
com.android.support:recyclerview-v7
RecyclerView - Adapter, ViewHolder
Provides access to data layer,
creates layout for each element and fills it with data,
RecyclerView uses new interface for Adapter 

called RecyclerView.Adapter…
…so say bye bye to CursorAdapter, ArrayAdapter
etc.
it uses convertView and holder pattern by default.
RecyclerView - LayoutManager
Responsible for measuring and positioning
elements in RecyclerView,
responsible for cleaning views from memory 

which are no longer visible to the users,
application will throw exception if we don’t set
LayoutManager for RecyclerView,
Google provides two standard implementations 

for this class: LinearLayoutManager 

and GridLayoutManager.
RecyclerView - ItemDecoration
Simple class responsible for additional view
decorations,
it’s optional to use it,
you can add a couple of decorations 

to one RecyclerView,
all decorations are drawn in the same order 

as they've been added using onDraw() 

and onDrawOver() methods.
RecyclerView - ItemAnimator
Class which animates collection elements,
animates elements while adding / deleting them
from collection and when element movement 

is required,
if we don’t prepare our custom ItemAnimator the
Recycler will use default implementation.
RecyclerView - ItemAnimator
notifyDataSetChanged()
Instead of it we use:
notifyItemInserted(int position);
notifyItemRemoved(int position);
notifyDataSetChanged() is bleah!
RecyclerView - Summary
We put RecyclerView to the layout,
we get its references in our Activity or Fragment,
we attach LayoutManager,
we attach adapter with data,
we add as many ItemDecorators as we need,
if we need our own animations we add our custom
ItemAnimator.
CardView
CardView
ViewGroup with predefined „card” background,
allows to set elevation on each system version,
this class is available as a separate library
com.android.support:cardview-v7
CardView
Other
Palette
Picks colors from given bitmap,
there are two methods to pick the colors:
public static generate(Bitmap)
public static generateAsync(Bitmap)
Class tries to assign colors as Vibrant or Muted.
Z-Index/Elevation
ViewCompat.setElevation(View, float),
method above helps us avoid checking at runtime
OS versions the app works on,
shadows will be rendered only for Android 5.0.
Activity transitions
API 21 makes it easy to animate elements 

from one Activity to another,
it’s also possible to set unshared elements 

enter and exit animations.
Activity transitions
In styles android:windowContentTransitions true
we specify animations in xml,
we set enter and exit animations for shared
elements in xml or in code,
we set attribute “transitionName” on the element we
want to animate,
we use method
ActivityOptions.makeSceneTransitionAnimation(Con
text, View, String);
CircularReveal
Animator anim =
ViewAnimationUtils.createCircularReveal(view, x, y,
0, radius);
myView.setVisibility(View.VISIBLE);
anim.start();
That’s all folks!
mail: hellboy@desmart.com
www: www.desmart.com
blog: www.desmart.com/blog

More Related Content

What's hot

What's New in Android
What's New in AndroidWhat's New in Android
What's New in AndroidRobert Cooper
 
Embracing the Lollipop
Embracing the LollipopEmbracing the Lollipop
Embracing the LollipopSonja Kesic
 
Android appwidget
Android appwidgetAndroid appwidget
Android appwidgetKrazy Koder
 
Practicing AppDevKit in kata training
Practicing AppDevKit in kata trainingPracticing AppDevKit in kata training
Practicing AppDevKit in kata traininganistar sung
 
Android Tutorials - Powering with Selection Widget
Android Tutorials - Powering with Selection WidgetAndroid Tutorials - Powering with Selection Widget
Android Tutorials - Powering with Selection WidgetPrajyot Mainkar
 
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular jsAayush Shrestha
 
Advancing the UI — Part 1: Look, Motion, and Gestures
Advancing the UI — Part 1: Look, Motion, and GesturesAdvancing the UI — Part 1: Look, Motion, and Gestures
Advancing the UI — Part 1: Look, Motion, and GesturesSamsung Developers
 
Android L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesAndroid L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesMohammad Shaker
 
Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseEPAM Systems
 
iOS Layout Overview
iOS Layout OverviewiOS Layout Overview
iOS Layout OverviewMake School
 
GoogleVisualr - A Ruby library for Google Visualization API
GoogleVisualr - A Ruby library for Google Visualization APIGoogleVisualr - A Ruby library for Google Visualization API
GoogleVisualr - A Ruby library for Google Visualization APIWinston Teo
 
Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360RapidValue
 
Android L02 - Activities and Adapters
Android L02 - Activities and AdaptersAndroid L02 - Activities and Adapters
Android L02 - Activities and AdaptersMohammad Shaker
 
ChtiJUG - Introduction à Angular2
ChtiJUG - Introduction à Angular2ChtiJUG - Introduction à Angular2
ChtiJUG - Introduction à Angular2Demey Emmanuel
 
Technozaure - Angular2
Technozaure - Angular2Technozaure - Angular2
Technozaure - Angular2Demey Emmanuel
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1Hussain Behestee
 

What's hot (20)

What's New in Android
What's New in AndroidWhat's New in Android
What's New in Android
 
Embracing the Lollipop
Embracing the LollipopEmbracing the Lollipop
Embracing the Lollipop
 
Solid angular
Solid angularSolid angular
Solid angular
 
Android appwidget
Android appwidgetAndroid appwidget
Android appwidget
 
Android Widget
Android WidgetAndroid Widget
Android Widget
 
Practicing AppDevKit in kata training
Practicing AppDevKit in kata trainingPracticing AppDevKit in kata training
Practicing AppDevKit in kata training
 
Android Tutorials - Powering with Selection Widget
Android Tutorials - Powering with Selection WidgetAndroid Tutorials - Powering with Selection Widget
Android Tutorials - Powering with Selection Widget
 
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular js
 
Advancing the UI — Part 1: Look, Motion, and Gestures
Advancing the UI — Part 1: Look, Motion, and GesturesAdvancing the UI — Part 1: Look, Motion, and Gestures
Advancing the UI — Part 1: Look, Motion, and Gestures
 
Android L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesAndroid L08 - Google Maps and Utilities
Android L08 - Google Maps and Utilities
 
Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete Course
 
Angular Js Basics
Angular Js BasicsAngular Js Basics
Angular Js Basics
 
Angular js
Angular jsAngular js
Angular js
 
iOS Layout Overview
iOS Layout OverviewiOS Layout Overview
iOS Layout Overview
 
GoogleVisualr - A Ruby library for Google Visualization API
GoogleVisualr - A Ruby library for Google Visualization APIGoogleVisualr - A Ruby library for Google Visualization API
GoogleVisualr - A Ruby library for Google Visualization API
 
Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360
 
Android L02 - Activities and Adapters
Android L02 - Activities and AdaptersAndroid L02 - Activities and Adapters
Android L02 - Activities and Adapters
 
ChtiJUG - Introduction à Angular2
ChtiJUG - Introduction à Angular2ChtiJUG - Introduction à Angular2
ChtiJUG - Introduction à Angular2
 
Technozaure - Angular2
Technozaure - Angular2Technozaure - Angular2
Technozaure - Angular2
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1
 

Similar to Android app material design from dev's perspective

Top Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on TabletsTop Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on TabletsMotorola Mobility - MOTODEV
 
Android architecture
Android architecture Android architecture
Android architecture Trong-An Bui
 
Volley lab btc_bbit
Volley lab btc_bbitVolley lab btc_bbit
Volley lab btc_bbitCarWash1
 
Lecture Slides for List Views [Android ]
Lecture Slides for List Views [Android ]Lecture Slides for List Views [Android ]
Lecture Slides for List Views [Android ]Nehil Jain
 
Android Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompatAndroid Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompatcbeyls
 
Android Application Development - Level 1
Android Application Development - Level 1Android Application Development - Level 1
Android Application Development - Level 1Isham Rashik
 
How to Become the MacGyver of Android Custom Views
How to Become the MacGyver of Android Custom ViewsHow to Become the MacGyver of Android Custom Views
How to Become the MacGyver of Android Custom ViewsFernando Cejas
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)Chiew Carol
 
What's new in Android - Google I/O Extended Bangkok 2022
What's new in Android - Google I/O Extended Bangkok 2022What's new in Android - Google I/O Extended Bangkok 2022
What's new in Android - Google I/O Extended Bangkok 2022Somkiat Khitwongwattana
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android AppsGil Irizarry
 
View groups containers
View groups containersView groups containers
View groups containersMani Selvaraj
 
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...Akira Hatsune
 
Marakana Android User Interface
Marakana Android User InterfaceMarakana Android User Interface
Marakana Android User InterfaceMarko Gargenta
 
Android App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsAndroid App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsDiego Grancini
 

Similar to Android app material design from dev's perspective (20)

Top Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on TabletsTop Tips for Android UIs - Getting the Magic on Tablets
Top Tips for Android UIs - Getting the Magic on Tablets
 
Android architecture
Android architecture Android architecture
Android architecture
 
Volley lab btc_bbit
Volley lab btc_bbitVolley lab btc_bbit
Volley lab btc_bbit
 
Android UI
Android UI Android UI
Android UI
 
Lecture Slides for List Views [Android ]
Lecture Slides for List Views [Android ]Lecture Slides for List Views [Android ]
Lecture Slides for List Views [Android ]
 
Android 3
Android 3Android 3
Android 3
 
Android Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompatAndroid Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompat
 
Android Application Development - Level 1
Android Application Development - Level 1Android Application Development - Level 1
Android Application Development - Level 1
 
How to Become the MacGyver of Android Custom Views
How to Become the MacGyver of Android Custom ViewsHow to Become the MacGyver of Android Custom Views
How to Become the MacGyver of Android Custom Views
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
 
Material Design Android
Material Design AndroidMaterial Design Android
Material Design Android
 
What's new in Android - Google I/O Extended Bangkok 2022
What's new in Android - Google I/O Extended Bangkok 2022What's new in Android - Google I/O Extended Bangkok 2022
What's new in Android - Google I/O Extended Bangkok 2022
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 
View groups containers
View groups containersView groups containers
View groups containers
 
Angular2 and You
Angular2 and YouAngular2 and You
Angular2 and You
 
ReactJS.pptx
ReactJS.pptxReactJS.pptx
ReactJS.pptx
 
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
 
Marakana Android User Interface
Marakana Android User InterfaceMarakana Android User Interface
Marakana Android User Interface
 
Dagger for android
Dagger for androidDagger for android
Dagger for android
 
Android App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsAndroid App Development - 04 Views and layouts
Android App Development - 04 Views and layouts
 

More from DeSmart Agile Software House

More from DeSmart Agile Software House (6)

Mobile Trends 2016
Mobile Trends 2016Mobile Trends 2016
Mobile Trends 2016
 
Czego Google mógłby nauczyć się od DeSmart?
Czego Google mógłby nauczyć się od DeSmart?Czego Google mógłby nauczyć się od DeSmart?
Czego Google mógłby nauczyć się od DeSmart?
 
How to find the best technical partnes for your startup
How to find the best technical partnes for your startup How to find the best technical partnes for your startup
How to find the best technical partnes for your startup
 
Mediarun Festiwal 2014 Damian Winkowski DeSmart Conventica
Mediarun Festiwal 2014 Damian Winkowski DeSmart ConventicaMediarun Festiwal 2014 Damian Winkowski DeSmart Conventica
Mediarun Festiwal 2014 Damian Winkowski DeSmart Conventica
 
10 Awesome Websites Built With Laravel Framework
10 Awesome Websites Built With Laravel Framework10 Awesome Websites Built With Laravel Framework
10 Awesome Websites Built With Laravel Framework
 
DeSmart 2014
DeSmart 2014DeSmart 2014
DeSmart 2014
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Niamh verma
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...wyqazy
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 

Recently uploaded (7)

CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 

Android app material design from dev's perspective