Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Material Design in Android

Material Design in Android

A deep dive into the Material Design system. Covering the design principles, applying them to your app and how to build them using the new Android Design Support Library and others APIs

Esteban Dorado Roldan

June 16, 2015
Tweet

More Decks by Esteban Dorado Roldan

Other Decks in Programming

Transcript

  1. Material Design implementing & compatibilizing - Concepts - Animations -

    Style - Layout - Components - Patterns - Compatibility - Design Suppory Library
  2. <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <set> <objectAnimator android:propertyName="translationZ" android:duration="@android:integer/config_shortAnimTime" android:valueTo="10dp" android:valueType="floatType"/>

    </set> </item> <item android:state_pressed="false"> <set> <objectAnimator android:propertyName="translationZ" android:duration="@android:integer/config_shortAnimTime" android:valueTo="2dp" android:valueType="floatType"/> </set> </item> </selector>
  3. // After transition mFab.animate() .scaleX(1).scaleY(1) .start(); // After fab mToolbar.animate()

    .scaleX(0).scaleY(1) .start(); // After toolbar mContent.animate() .scaleX(0).scaleY(1) .start();
  4. // Slide awesomeTransition = new Slide (Gravity.BOTTOM); // Fade awesomeTransition

    = new Fade (); Explode awesomeTransition = new Explode(); awesomeTransition.excludeTarget(android.R.id.navigationBarBackground, true); awesomeTransition.excludeTarget(android.R.id.statusBarBackground, true); awesomeTransition.excludeTarget(R.id.activity_transition_header, true); getWindow().setExitTransition(awesomeTransition); Slide Explode Fade
  5. <style name=“AwesomeTheme" parent=“AppTheme"> <item name=“android:colorPrimary”>@color/my_primary</item> <item name=“android:colorAccent">@color/my_accent</item> </style> <style name=“AwesomeTheme"

    parent=“AppTheme"> <item name=“colorPrimary”>@color/my_primary</item> <item name=“colorAccent">@color/my_accent</item> </style> colorAccent
  6. public class MovieDetailActivity extends Activity implements Palette.PaletteAsyncListener { ... @Override

    public void onGenerated(Palette palette) { if (palette != null) { Palette.Swatch vibrantSwatch = palette .getVibrantSwatch(); Palette.Swatch darkVibrantSwatch = palette .getDarkVibrantSwatch(); Palette.Swatch lightSwatch = palette .getLightVibrantSwatch(); if (lightSwatch != null) { // awesome palette code } } } }
  7. Further reading Support Libraries v22.1.0 https://chris.banes.me/2015/04/22/support-libraries-v22-1-0/ Material Design Guidelines http://www.google.com/design/spec/material-design/introduction.html

    Android Design Support Library http://android-developers.blogspot.com.es/2015/05/android-design-support-library.html First steps with the Design Support Library https://medium.com/android-bites/first-steps-with-the-design-support-library-8dcf06230ddd From Material Design to Android Wear https://speakerdeck.com/saulmm/from-material-design-to-android-wear