Compatiblity of Material Design to Versions Below Android 5.0

Material Design backward compatibility

Updating this answer as Lollipop OS is officially released with support libraries, which you can use inside your project to provide compatibility to older versions.

Support library: v7 appcompat library

This library adds support for the Action Bar user interface design pattern. This library includes support for material design user interface implementations.

If you are using Android Studio then you just need to include below dependency identifier:

com.android.support:appcompat-v7:21.0.+

How to apply Material Design to android versions 5.0?

There are few library's to achieve the Material Design applicable to an earlier platforms less than API-21.
An example of such library is this one:
https://android-arsenal.com/details/1/1156. You can look on Android Arsenal for more library's like this.

Also this blog-post from Chris Banes is about Material Design on older platforms, I recommend that you read it: https://chris.banes.me/2014/10/17/appcompat-v21/. I hope it will be helpful for reduce design complexity.

Maintaining backward compatibility with Material Design

You should be using the non-android namespaced properties with the support library:

<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
</style>

No v21 version required. This will give you consistent behavior back to API level 7

How can I design Material for older versions?

It's not automatic. But for starters, you will need appcompat 21. Take a look at this:

http://android-developers.blogspot.com/2014/10/appcompat-v21-material-design-for-pre.html?m=1

Edit: In the 2015's IO, Matias Duarte revealed the Support Design Library, which eases significantly this task. It's included in the SDK repository.

take a look here: http://android-developers.blogspot.com/2015/05/android-design-support-library.html



Related Topics



Leave a reply



Submit