Material theme backwards compatibility [duplicate] - android

From examples provided on the Android Developer pages I see that new Views, like the RecyclerView, are backward compatible (android.support.v7.widget.RecyclerView).
Are all the new things introduced in Material Design backward compatible (to which version)?

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.+

Material Design from Android 2.2 (API 8) to present 5.0 (API 21)
Here is what you need:
Toolbar
Material Design Library for widgets (buttons, checkboxes, etc)
1. Toolbar
Just get the idea and you ready to go.
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimaryDark"/>
Setup guide: http://antonioleiva.com/material-design-everywhere/
Source with example: https://github.com/antoniolg/MaterialEverywhere
To make Toolbar work lower API 11 use Theme.AppCompat.Light.NoActionBar (instead windowActionBar set to false)
<style name="NoActionBarTheme" parent="Theme.AppCompat.Light.NoActionBar">
...
</style>
2. Material Design Library
Here is Material Design Library for pretty buttons, etc..
Guide, code, example - https://github.com/navasmdc/MaterialDesignLibrary
Guide how to add library to Android Studio 1.0 - How do I import material design library to Android Studio?
.
Happy coding ;)

Officialy the Material Design is backwards to the v7 appcompat Support Library.

Just to add on to Paresh's answer, not all the features of Material Design are available on older releases. Custom themes and activity transitions are only available for APIs > 21, however as others mentioned some of the features are available in support library.
https://developer.android.com/training/material/compatibility.html

The API is included since version 22. You need include this dependency in to gradle dependency:
com.android.support:design:22.2.0

Google design support library introduced in I/O 2015
http://android-developers.blogspot.gr/2015/05/android-design-support-library.html
You will find a lot of good stuff for material design there.
Navigation View
Snackbar
Floating Action Button
CoordinatorLayout, motion, and scrolling (the best part wich include parallax effect and pinned toolbars)
and much more ...

Related

In Android, how can I use TextInputLayout and Snackbar without the Design Support Library

I am developing a new Android project with a minimum SDK set at 5.0. I want to use material design, but it seems like many of the material design components are only included in the support library. I really want to theme the app as Material, not AppCompat.
When I try to add a layout from the support library, I get an error every time. What do I need to do to remove the support library dependencies?
The Snackbar is only available in the design support library - it is not baked into versions of Android like EditText/ImageView views.

Implement material design in android 5.0 and lower

I want to use Material Design in different devices including(i.e) Android 5.1 and Android 4.4.2.
So, after 5.0 android uses Material by default. But what about other devices?
Where I can get samples of such project? How to implement Button, side K and FAB.
Actually, what is the best and common way to implement material? I know that there are some libs to handle my task, but maybe there is the better way.
Please help me to figure out this issue.
Thanks.
You have to use AppCompat Library v21 for Material Design in Pre-Lollipop Device.
http://android-developers.blogspot.com/2014/10/appcompat-v21-material-design-for-pre.html
Additional, want to include ActionButton, Collapsible Toolbar, Floating EditText etc. are available with Design Support Library by Android Developers.
http://android-developers.blogspot.com/2015/05/android-design-support-library.html
You can use the AppCompact support library for that.
http://android-developers.blogspot.in/2014/10/appcompat-v21-material-design-for-pre.html

Android Design Support Library

I have found this after a google search about the android design support library.
It states: "Android Design Support Library brings a number of material design components that are compatiable [sic] with all Android 2.1 or higher devices."
I am wondering if this means that the android design support library should only be used with pre-lollipop devices or if it is the same thing as using material design in api-21 now.
Thanks for your help!
The Design Support Library only provides some components introduced by Material Design.
To use the Material Design theme, you have to use AppCompat Support Library (or set your minSdkVersion to 21 or higher).
So even if you are developing for API 21+, you still won't have access to those components (Floating Action Button, Snackbar, NavigationView, ...), as they are not included in Android.
You can get more information about the Design Support Library in the official announcement.

Is it possible for my app to appear material design on pre lollipop phones?

I am thinking of converting my app to material design, but at the moment only a small percentage of my users are on Lollipop.
My question is, is it possible for users with kitkat and jelly bean to see the Material design?
Yes. But you will have to use latest v7 support lib to do that. Chris Banes explained it on his blog:
https://chris.banes.me/2014/10/17/appcompat-v21/
Animations on Lollipop like Ripple and similar are not included in the support lib.
There is no foolproof approach for that. You will have to use appCompat and you can get some of "materialish" features. For others like Floating Action Button, ripple etc. use Material design library. I have been using it for 3 months and found it quite useful for UI development.
you can create widget using Design Support Library (official)
http://android-developers.blogspot.in/2015/05/android-design-support-library.html
Before implementation we must following steps:-
1.Add latest support design dependency - compile 'com.android.support:design:22.2.0'
2.Your activity is extending with AppCompatActivity
List of 3rd party library`s
https://github.com/wasabeef/awesome-android-ui
Use AppCompat (from android.support) and Design (from android.support)
These libraries are Google-official

Material Design backward compatibility

From examples provided on the Android Developer pages I see that new Views, like the RecyclerView, are backward compatible (android.support.v7.widget.RecyclerView).
Are all the new things introduced in Material Design backward compatible (to which version)?
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.+
Material Design from Android 2.2 (API 8) to present 5.0 (API 21)
Here is what you need:
Toolbar
Material Design Library for widgets (buttons, checkboxes, etc)
1. Toolbar
Just get the idea and you ready to go.
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimaryDark"/>
Setup guide: http://antonioleiva.com/material-design-everywhere/
Source with example: https://github.com/antoniolg/MaterialEverywhere
To make Toolbar work lower API 11 use Theme.AppCompat.Light.NoActionBar (instead windowActionBar set to false)
<style name="NoActionBarTheme" parent="Theme.AppCompat.Light.NoActionBar">
...
</style>
2. Material Design Library
Here is Material Design Library for pretty buttons, etc..
Guide, code, example - https://github.com/navasmdc/MaterialDesignLibrary
Guide how to add library to Android Studio 1.0 - How do I import material design library to Android Studio?
.
Happy coding ;)
Officialy the Material Design is backwards to the v7 appcompat Support Library.
Just to add on to Paresh's answer, not all the features of Material Design are available on older releases. Custom themes and activity transitions are only available for APIs > 21, however as others mentioned some of the features are available in support library.
https://developer.android.com/training/material/compatibility.html
The API is included since version 22. You need include this dependency in to gradle dependency:
com.android.support:design:22.2.0
Google design support library introduced in I/O 2015
http://android-developers.blogspot.gr/2015/05/android-design-support-library.html
You will find a lot of good stuff for material design there.
Navigation View
Snackbar
Floating Action Button
CoordinatorLayout, motion, and scrolling (the best part wich include parallax effect and pinned toolbars)
and much more ...

Categories

Resources