SlideShare a Scribd company logo
1 of 38
Download to read offline
Material design basics 
Jorge Juan Barroso Carmona 
Android expert 
jorge@karumi.com 
@flipper83 
+JorgeJBarroso
Karumi is the Rock Solid code software development studio. 
We embark on every project with a commitment to create something 
elegant, enduring and effective. That is our heartbeat. 
Our approach is uniquely simple and honest, we are a small 
dedicated software studio, delivering outstanding work.
A Coherent Cross-platform 
experience
Flexible design system
Synthesises classic principles 
of good design
Depth is 
Important
<ImageView 
… 
android:elevation = “5dp” 
android:stateListAnimator = 
“@anim/pressed_state_list_animator” 
… 
/> 
view.animate().translationZ(…).start();
Depth as 
Reaction
<selector xmlns:android=“…”> 
<item android:state_pressed="true"> 
<set> 
<objectAnimator 
android:propertyName="translationZ" 
android:duration=“@android:integer/ 
config_shortAnimTime" 
android:valueTo="2dp"/> 
</set> 
</item> 
<item android:state_pressed="false"> 
<set> 
<objectAnimator … /> 
</set> 
</item> 
</selector>
Outline
<ImageView 
… 
android:background=“@drawable/ 
my_circle” /> 
… 
/> 
! 
<shape xmlns:android=“…” 
android:shape=“circle”> 
<solid android:color=“#ffE61A58” /> 
</shape>
ViewOutlineProvider viewOutlineProvider = 
new ViewOutlineProvider() { 
@Override 
public void getOutline(View view, Outline 
outline) { 
int size = getResources(). 
getDimensionPixelSize( 
R.dimen.fab_size); 
outline.setOval(0, 0, size, size); 
} 
}; 
! 
view.setClipToOutline(true); 
view.setOutlineProvider(viewOutlineProvider);
Themes
<style 
name="AppTheme" 
parent="android:Theme.Material.Light.DarkActionBar"> 
<item name="android:colorPrimary">@color/primary</item> 
<item name="android:colorAccent">@color/accent</item> 
<item name=“android:colorPrimaryDark”> 
@color/primary_dark</item> 
</style> 
Material
<style 
name="AppTheme" 
parent="Theme.AppCompat.Light.DarkActionBar"> 
<item name="android:colorPrimary">@color/primary</item> 
<item name="android:colorAccent">@color/accent</item> 
<item name=“android:colorPrimaryDark"> 
@color/primary_dark</item> 
</style> 
Theme.AppCompat
Palette
Dark Muted 
Dark Vibrant 
Muted 
Vibrant 
Light Muted 
Light Vibrant 
Palette
dependencies { 
compile 'com.android.support:palette-v7: 
21.0.+' 
Palette 
} 
!! 
Palette p = Palette.generate(bitmap); 
Palette.generateAsync(bitmap, new 
Palette.PaletteAsyncListener() { 
public void onGenerated(Palette palette) { 
// Do something with colors... 
} 
});
Typography
android:TextAppearance.Material.
TextAppearance.AppCompat.
Cards
xmlns:card_view="http:// 
schemas.android.com/apk/res-auto" 
!! 
<android.support.v7.widget.CardView 
android:id="@+id/card_view" 
android:layout_gravity="center" 
android:layout_width="200dp" 
android:layout_height="200dp" 
card_view:cardCornerRadius="4dp"> 
</android.support.v7.widget.CardView>
Toolbar
Material 
Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar); 
setActionBar(toolbar); 
! 
<Toolbar android:id="@+id/my_awesome_toolbar" 
android:layout_height="wrap_content" 
android:layout_width="match_parent" 
android:minHeight="?android/actionBarSize" 
android:background="?android/colorPrimary" />
App.Compat 
Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar); 
setActionBar(toolbar); 
! 
<android.support.v7.widget.Toolbar 
android:id="@+id/my_awesome_toolbar" 
android:layout_height="wrap_content" 
android:layout_width="match_parent" 
android:minHeight="?actionBarSize" 
android:background="?colorPrimary" />
Activity 
Transitions
Don’t forget 
getWindow().requestFeature(Window.FEATURE 
_CONTENT_TRANSITIONS); 
! 
or 
! 
<style 
name="BaseAppTheme" 
parent="android:Theme.Material"> 
<item name= 
“android:windowContentTransitions"> 
true 
</item> 
</style>
Theme transitions 
<style 
name="BaseAppTheme" parent=“android:Theme.Material"> 
<!-- specify enter and exit transitions --> 
<item name="android:windowEnterTransition">@transition/ 
explode</item> 
<item name=“android:windowExitTransition”>@transition/ 
explode</item> 
<!-- specify shared element transitions --> 
<item 
name=“android:windowSharedElementEnterTransition"> 
@transition/change_image_transform</item> 
<item name=“android:windowSharedElementExitTransition”> 
@transition/change_image_transform</item> 
</style>
Code transitions 
// set an exit transition 
getWindow().setExitTransition(new Explode()); 
// all the options 
Window.setEnterTransition() 
Window.setExitTransition() 
Window.setSharedElementEnterTransition() 
Window.setSharedElementExitTransition() 
// start the Activity 
startActivity(intent, 
ActivityOptions.makeSceneTransitionAnimation(this). 
toBundle());
Element transitions 
<ImageView 
… 
android:transitionName=“@transition/my_transition” 
… 
/> 
!! 
ActivityOptions options = ActivityOptions 
.makeSceneTransitionAnimation(this, androidRobotView, 
transitionName); 
startActivity(intent, options.toBundle());
Ripples
<ripple android:color="?android:colorControlHighlight"> 
<item> 
<shape android:shape="oval"> 
<solid android:color="?android:colorAccent" /> 
</shape> 
</item> 
</ripple> 
And set as background
Circular Reveal
Animator anim = 
ViewAnimationUtils.createCircularReveal( 
myView, 
centerX, 
centerY, 
startRadius, 
finalRadius); 
anim.start();
! 
Bibliography 
They’re the cracks! 
What Material means to Android. David González. Codemotion. 2014 
Material Witness. Chet Haase and Romain Guy. Google IO. 2014 
Papercraft. Chris Banes and Nick Butcher. Droidcon UK. 2014 
http://www.google.com/design
Questions? 
! 
Find me 
I am very social! 
jorge@karumi.com 
@flipper83 
+JorgeJBarroso
!

More Related Content

What's hot

Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti
 Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti   Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti
Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti
Smash Tech
 
Android Layout 3分クッキング
Android Layout 3分クッキングAndroid Layout 3分クッキング
Android Layout 3分クッキング
Yuki Anzai
 
To David - Resume
To David - ResumeTo David - Resume
To David - Resume
David To
 

What's hot (19)

Android Layout
Android LayoutAndroid Layout
Android Layout
 
Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti
 Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti   Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti
Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti
 
BluePrint Mobile Framework
BluePrint Mobile FrameworkBluePrint Mobile Framework
BluePrint Mobile Framework
 
Yahoo Mobile Widgets
Yahoo Mobile WidgetsYahoo Mobile Widgets
Yahoo Mobile Widgets
 
Android UI System
Android UI SystemAndroid UI System
Android UI System
 
09 material design
09 material design09 material design
09 material design
 
Application Craft Tutorial for Google Map
Application Craft Tutorial for Google MapApplication Craft Tutorial for Google Map
Application Craft Tutorial for Google Map
 
Android Layout 3分クッキング
Android Layout 3分クッキングAndroid Layout 3分クッキング
Android Layout 3分クッキング
 
Android ui with xml
Android ui with xmlAndroid ui with xml
Android ui with xml
 
To David - Resume
To David - ResumeTo David - Resume
To David - Resume
 
Training Session 2
Training Session 2 Training Session 2
Training Session 2
 
Getting started with Google Android - OSCON 2008
Getting started with Google Android - OSCON 2008Getting started with Google Android - OSCON 2008
Getting started with Google Android - OSCON 2008
 
User Interface customization for AEM 6
User Interface customization for AEM 6User Interface customization for AEM 6
User Interface customization for AEM 6
 
AEM 6.1 User Interface Customization
AEM 6.1 User Interface CustomizationAEM 6.1 User Interface Customization
AEM 6.1 User Interface Customization
 
iOS UI best practices
iOS UI best practicesiOS UI best practices
iOS UI best practices
 
Write once, ship multiple times
Write once, ship multiple timesWrite once, ship multiple times
Write once, ship multiple times
 
Angular material
Angular materialAngular material
Angular material
 
KKBOX WWDC17 UIKit - QQ
KKBOX WWDC17 UIKit - QQKKBOX WWDC17 UIKit - QQ
KKBOX WWDC17 UIKit - QQ
 
Write once, ship multiple times
Write once, ship multiple timesWrite once, ship multiple times
Write once, ship multiple times
 

Viewers also liked

Google material-design
Google material-designGoogle material-design
Google material-design
Harrison Weber
 
Google Material design
Google Material designGoogle Material design
Google Material design
Dan Vitoriano
 
Android animation
Android animationAndroid animation
Android animation
Krazy Koder
 

Viewers also liked (20)

Android Material Design
Android Material DesignAndroid Material Design
Android Material Design
 
Materials design
Materials designMaterials design
Materials design
 
Esp chap 4 materials design (finished)
Esp chap 4   materials design (finished)Esp chap 4   materials design (finished)
Esp chap 4 materials design (finished)
 
Material Design: Google's New Design Language
Material Design: Google's New Design LanguageMaterial Design: Google's New Design Language
Material Design: Google's New Design Language
 
Material design - AndroidosDay 2015
Material design - AndroidosDay 2015Material design - AndroidosDay 2015
Material design - AndroidosDay 2015
 
Material design
Material designMaterial design
Material design
 
Google material-design
Google material-designGoogle material-design
Google material-design
 
Google Material design
Google Material designGoogle Material design
Google Material design
 
Material design
Material designMaterial design
Material design
 
Implementing Google's Material Design Guidelines
Implementing Google's Material Design GuidelinesImplementing Google's Material Design Guidelines
Implementing Google's Material Design Guidelines
 
Basic Android Animation
Basic Android Animation Basic Android Animation
Basic Android Animation
 
Android animation
Android animationAndroid animation
Android animation
 
School Management System in Android
School Management System in AndroidSchool Management System in Android
School Management System in Android
 
Seguridad en dispositivos móviles
Seguridad en dispositivos móvilesSeguridad en dispositivos móviles
Seguridad en dispositivos móviles
 
Herramientas gestion proyectos
Herramientas gestion proyectosHerramientas gestion proyectos
Herramientas gestion proyectos
 
Por su seguridad
Por su seguridadPor su seguridad
Por su seguridad
 
Certificaciones Tecnológicas: La acreditación del experto
Certificaciones Tecnológicas: La acreditación del expertoCertificaciones Tecnológicas: La acreditación del experto
Certificaciones Tecnológicas: La acreditación del experto
 
Privacidad internet
Privacidad internetPrivacidad internet
Privacidad internet
 
Inteligencia Colectiva
Inteligencia ColectivaInteligencia Colectiva
Inteligencia Colectiva
 
Groovy&Grails: desarrollo rápido de aplicaciones
Groovy&Grails: desarrollo rápido de aplicacionesGroovy&Grails: desarrollo rápido de aplicaciones
Groovy&Grails: desarrollo rápido de aplicaciones
 

Similar to Material design basics

Similar to Material design basics (20)

Design Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesDesign Patterns for Tablets and Smartphones
Design Patterns for Tablets and Smartphones
 
Chapter 5 - Layouts
Chapter 5 - LayoutsChapter 5 - Layouts
Chapter 5 - Layouts
 
Getting Started With Material Design
Getting Started With Material DesignGetting Started With Material Design
Getting Started With Material Design
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?
 
Tips & Tricks to spice up your Android app
Tips & Tricks to spice up your Android appTips & Tricks to spice up your Android app
Tips & Tricks to spice up your Android app
 
Layouts in android
Layouts in androidLayouts in android
Layouts in android
 
Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101
 
Geekcamp Android
Geekcamp AndroidGeekcamp Android
Geekcamp Android
 
01 09 - graphical user interface - basic widgets
01  09 - graphical user interface - basic widgets01  09 - graphical user interface - basic widgets
01 09 - graphical user interface - basic widgets
 
3. file external memory
3. file external memory3. file external memory
3. file external memory
 
How to use data binding in android
How to use data binding in androidHow to use data binding in android
How to use data binding in android
 
android level 3
android level 3android level 3
android level 3
 
Android Tutorials - Powering with Selection Widget
Android Tutorials - Powering with Selection WidgetAndroid Tutorials - Powering with Selection Widget
Android Tutorials - Powering with Selection Widget
 
Hierarchy viewer
Hierarchy viewerHierarchy viewer
Hierarchy viewer
 
Advanced Android gReporter
Advanced Android gReporterAdvanced Android gReporter
Advanced Android gReporter
 
Support Design Library
Support Design LibrarySupport Design Library
Support Design Library
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
 
Android por onde começar? Mini Curso Erbase 2015
Android por onde começar? Mini Curso Erbase 2015 Android por onde começar? Mini Curso Erbase 2015
Android por onde começar? Mini Curso Erbase 2015
 
Getting the Magic on Android Tablets
Getting the Magic on Android TabletsGetting the Magic on Android Tablets
Getting the Magic on Android Tablets
 
Services
ServicesServices
Services
 

More from Jorge Barroso

More from Jorge Barroso (10)

Tensor for android
Tensor for androidTensor for android
Tensor for android
 
Forgetting android v2
Forgetting android v2Forgetting android v2
Forgetting android v2
 
Get out of my thread (Trabajando en diferido)
Get out of my thread (Trabajando en diferido)Get out of my thread (Trabajando en diferido)
Get out of my thread (Trabajando en diferido)
 
All you need know about testing
All you need know about testingAll you need know about testing
All you need know about testing
 
Presistiendo que es gerundio (My storing story)
Presistiendo que es gerundio (My storing story)Presistiendo que es gerundio (My storing story)
Presistiendo que es gerundio (My storing story)
 
Mobile development for startups
Mobile development for startupsMobile development for startups
Mobile development for startups
 
Androides y Mazmorras. Part I (dungeons & robots)
Androides y Mazmorras. Part I (dungeons & robots)Androides y Mazmorras. Part I (dungeons & robots)
Androides y Mazmorras. Part I (dungeons & robots)
 
Learning android with AOSP
Learning android with AOSPLearning android with AOSP
Learning android with AOSP
 
Material for old school
Material for old schoolMaterial for old school
Material for old school
 
Forgetting android
Forgetting androidForgetting android
Forgetting android
 

Recently uploaded

notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 

Recently uploaded (20)

University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 

Material design basics

  • 1. Material design basics Jorge Juan Barroso Carmona Android expert jorge@karumi.com @flipper83 +JorgeJBarroso
  • 2. Karumi is the Rock Solid code software development studio. We embark on every project with a commitment to create something elegant, enduring and effective. That is our heartbeat. Our approach is uniquely simple and honest, we are a small dedicated software studio, delivering outstanding work.
  • 7. <ImageView … android:elevation = “5dp” android:stateListAnimator = “@anim/pressed_state_list_animator” … /> view.animate().translationZ(…).start();
  • 9. <selector xmlns:android=“…”> <item android:state_pressed="true"> <set> <objectAnimator android:propertyName="translationZ" android:duration=“@android:integer/ config_shortAnimTime" android:valueTo="2dp"/> </set> </item> <item android:state_pressed="false"> <set> <objectAnimator … /> </set> </item> </selector>
  • 11. <ImageView … android:background=“@drawable/ my_circle” /> … /> ! <shape xmlns:android=“…” android:shape=“circle”> <solid android:color=“#ffE61A58” /> </shape>
  • 12. ViewOutlineProvider viewOutlineProvider = new ViewOutlineProvider() { @Override public void getOutline(View view, Outline outline) { int size = getResources(). getDimensionPixelSize( R.dimen.fab_size); outline.setOval(0, 0, size, size); } }; ! view.setClipToOutline(true); view.setOutlineProvider(viewOutlineProvider);
  • 14. <style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar"> <item name="android:colorPrimary">@color/primary</item> <item name="android:colorAccent">@color/accent</item> <item name=“android:colorPrimaryDark”> @color/primary_dark</item> </style> Material
  • 15. <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="android:colorPrimary">@color/primary</item> <item name="android:colorAccent">@color/accent</item> <item name=“android:colorPrimaryDark"> @color/primary_dark</item> </style> Theme.AppCompat
  • 17. Dark Muted Dark Vibrant Muted Vibrant Light Muted Light Vibrant Palette
  • 18. dependencies { compile 'com.android.support:palette-v7: 21.0.+' Palette } !! Palette p = Palette.generate(bitmap); Palette.generateAsync(bitmap, new Palette.PaletteAsyncListener() { public void onGenerated(Palette palette) { // Do something with colors... } });
  • 22. Cards
  • 23. xmlns:card_view="http:// schemas.android.com/apk/res-auto" !! <android.support.v7.widget.CardView android:id="@+id/card_view" android:layout_gravity="center" android:layout_width="200dp" android:layout_height="200dp" card_view:cardCornerRadius="4dp"> </android.support.v7.widget.CardView>
  • 25. Material Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar); setActionBar(toolbar); ! <Toolbar android:id="@+id/my_awesome_toolbar" android:layout_height="wrap_content" android:layout_width="match_parent" android:minHeight="?android/actionBarSize" android:background="?android/colorPrimary" />
  • 26. App.Compat Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar); setActionBar(toolbar); ! <android.support.v7.widget.Toolbar android:id="@+id/my_awesome_toolbar" android:layout_height="wrap_content" android:layout_width="match_parent" android:minHeight="?actionBarSize" android:background="?colorPrimary" />
  • 28. Don’t forget getWindow().requestFeature(Window.FEATURE _CONTENT_TRANSITIONS); ! or ! <style name="BaseAppTheme" parent="android:Theme.Material"> <item name= “android:windowContentTransitions"> true </item> </style>
  • 29. Theme transitions <style name="BaseAppTheme" parent=“android:Theme.Material"> <!-- specify enter and exit transitions --> <item name="android:windowEnterTransition">@transition/ explode</item> <item name=“android:windowExitTransition”>@transition/ explode</item> <!-- specify shared element transitions --> <item name=“android:windowSharedElementEnterTransition"> @transition/change_image_transform</item> <item name=“android:windowSharedElementExitTransition”> @transition/change_image_transform</item> </style>
  • 30. Code transitions // set an exit transition getWindow().setExitTransition(new Explode()); // all the options Window.setEnterTransition() Window.setExitTransition() Window.setSharedElementEnterTransition() Window.setSharedElementExitTransition() // start the Activity startActivity(intent, ActivityOptions.makeSceneTransitionAnimation(this). toBundle());
  • 31. Element transitions <ImageView … android:transitionName=“@transition/my_transition” … /> !! ActivityOptions options = ActivityOptions .makeSceneTransitionAnimation(this, androidRobotView, transitionName); startActivity(intent, options.toBundle());
  • 33. <ripple android:color="?android:colorControlHighlight"> <item> <shape android:shape="oval"> <solid android:color="?android:colorAccent" /> </shape> </item> </ripple> And set as background
  • 35. Animator anim = ViewAnimationUtils.createCircularReveal( myView, centerX, centerY, startRadius, finalRadius); anim.start();
  • 36. ! Bibliography They’re the cracks! What Material means to Android. David González. Codemotion. 2014 Material Witness. Chet Haase and Romain Guy. Google IO. 2014 Papercraft. Chris Banes and Nick Butcher. Droidcon UK. 2014 http://www.google.com/design
  • 37. Questions? ! Find me I am very social! jorge@karumi.com @flipper83 +JorgeJBarroso
  • 38. !