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

Material Design in Android

Material Design in Android

Seminary "Material Design in Android" in University of Granada.

Esteban Dorado Roldan

May 12, 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
  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. public void onFabPressed(View view) { Intent i = new Intent

    (TransitionFirstActivity.this, TransitionSecondActivity.class); ActivityOptions transitionActivityOptions = ActivityOptions .makeSceneTransitionAnimation(mContext, Pair.create(mFabButton, "fab"), Pair.create(mHeader, "holder1")); startActivity(i, transitionActivityOptions.toBundle()); } <View ... android:transitionName="holder1" /> <Button ... android:transitionName=“fab" />
  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

    From Holo to Material http://novoda.com/blog/from-holo-to-material Paper prototyping https://www.youtube.com/watch?v=07xPF7L6klY From Material Design to Android Wear https://speakerdeck.com/saulmm/from-material-design-to-android-wear
  8. RecyclerView API Recycler API: • Adapter • ViewHolder • Layaout

    Manayer • Item Decoration • Item Animation
  9. Adapter Recycler API: • Defines what gets displayed and how

    one item is displayed • No default implementations • ViewHolder pattern
  10. Item Decorations • Defines how items are separated from each

    other • No default implementation • Called once per onDraw()