How can I design Material for older versions?

How can I design Material for older versions?

I tried adding appcompat_v7 to my project but that didn't change anything unfortunately.

Please help!

Upvotes: 4

Views: 5083

Answers (3)

Fco P.
Fco P.

Reputation: 2691

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

Upvotes: 5

Zielony
Zielony

Reputation: 16537

Material Design is a concept, so it's not like switching API to newer will change all the visuals. API 21 contains some useful classes, but even using Android 5.0 compatible phone and SDK you will have to do a lot by yourself.

It depends, which versions would you like to support. Most of the features is supported only on newer devices (4.0+). Some of the features (like ripple touch feedback, or animated shadows) are officially supported only on Lollipop.

I'm working on a backport for all devices, but it really depends on what do you need and how fast your device is (rendering shadows is really demanding). You can find it here: https://androidreclib.wordpress.com/ and https://github.com/ZieIony/Carbon

There's a lot of information on the official page: https://developer.android.com/training/material/compatibility.html

The page mentioned by Fco P. is also important.

Upvotes: 3

Psypher
Psypher

Reputation: 10839

You can look into this library for supporting Material Design for older versions. It supports material design from 2.2

https://github.com/navasmdc/MaterialDesignLibrary

If you want use this library, you only have to download MaterialDesign project, import it into your workspace and add the project as a library in your android project settings.

If you prefer it, you can use the grade dependency, you have to add these lines in your buil.gradle file:

repositories {
    jcenter()
}

dependencies {
    compile 'com.github.navasmdc:MaterialDesign:1.2@aar'
}

Upvotes: 3

Related Questions