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

Material Design for Old Schoolers

Material Design for Old Schoolers

Nowadays, we as android developers suffer serious problems regarding android fragmentation if we wanna use Material Design.
In this talk we will learn how to make backward compatibility easier when applying material design on older devices.
Welcome to the old school world of Material Design.

12defde716586eb2d726d081a161756d?s=128

Fernando Cejas

January 31, 2015
Tweet

Transcript

  1. Material for old schoolers Fernado Cejas - Souncloud aka Cejakas

    @fernando_cejas fernando.cejas@souncloud.com +FernandoCejas Jorge J. Barroso - Karumi aka Flipper83 @flipper83 jorge@karumi.com +JorgeJBarroso
  2. Material is cool

  3. What happens with old schoolers

  4. What google provides?

  5. com.android.support:appcompat-v7 Themes ActionBar and ToolBar Transitions Widget Tinting

  6. Styling Material <style name="BaseAppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
 <item name="colorPrimary">@color/theme_default_primary</item>
 <item name="colorPrimaryDark">@color/theme_default_primary_dark</item>
 <item

    name="colorAccent">@color/theme_default_accent</item>
 <item name="colorControlHighlight">@color/theme_default_accent_light</item>
 </style>
  7. Styling Material values/themes.xml ! <style name="AppTheme" parent="BaseAppTheme">
 </style> ! values-21/themes.xml

    ! <style name="AppTheme" parent="BaseAppTheme">
 <item name="android:windowContentTransitions">true</item>
 <item name="android:windowAllowEnterTransitionOverlap">true</item>
 <item name="android:windowAllowReturnTransitionOverlap">true</item>
 </style>
  8. Be careful with some Samsung devices Proguard to the rescue!!!

  9. Tint doesn’t work on custom views!!

  10. com.android.support:recyclerview-v7 Bye Bye List view! Extends from RecyclerAdapter ViewHolder by

    default Layout manager
  11. com.android.support:recyclerview-v7 Change your dividers for ItemDecoration

  12. com.android.support:recyclerview-v7 Change your headers and footers for ItemTypes.

  13. com.android.support:recyclerview-v7 OnItemClick doesn’t exist any more, delegate click functionality to

    view holders
  14. com.android.support:recyclerview-v7 Add animations with ItemAnimator, it’s easy and it’s cool.

  15. com.android.support:cardview-v7

  16. com.android.support:palette-v7 Only in compat Check null Problems with some images

  17. Toolbar vs ActionBar ToolBar is a viewGroup setSupportActionBar(); Extends from

    ActionBarActivity Deactivate ActionBar via Theme
  18. VectorDrawable vs ‘Font as icon’ You can use icon fonts

    for reduce the number of assets on you app. Keep performance!!! please!!
  19. Transitions ActivityOptionsCompat options = ActivityOptionsCompat.
 makeSceneTransitionAnimation((Activity) context, pairs);
 ! !

    <style name="AppTheme" parent="BaseAppTheme">
 <item name="android:windowContentTransitions">true</item>
 <item name="android:windowAllowEnterTransitionOverlap">true</item>
 <item name="android:windowAllowReturnTransitionOverlap">true</item>
 </style>
  20. None
  21. Bibliography https://developer.android.com/training/material/compatibility.html http://android-developers.blogspot.de/2014/10/implementing-material-design-in-your.html http://antonioleiva.com/material-design-everywhere/ http://www.slideshare.net/arueggeberg/material-design-and-backwards-compatibility https://github.com/navasmdc/MaterialDesignLibrary https://github.com/markushi/android-ui https://github.com/flipper83/transition-old-school

  22. Q&A