NativeScript: Instructions on how to use Material Design on Android <5 - android

How to use Material Design on Android < 5? I added app.gradle to app/App_Resources/Android. This is what I have in there:
dependencies {
compile "com.android.support:appcompat-v7:21.0.+"
compile "com.android.support:design:23.2.1"
}
But still no luck getting Material Design slider and textfield. Could someone give precise instructions on how to add Material Design in NativeScript apps. Better a link to a repo with an example. Especially I'm interested in slider and textfield elements. Thanks.

Based on the guidance in developer.android.com here :
To use material design in your Android apps, follow the guidelines defined in the material design specification and use the new components and functionality available in Android 5.0 (API level 21) and above.
So basicly the native API is supporting Material design with version 5 and above so you can't implement it on lower versions.
Check also this link for further information about maintaining compatibility in different android versions.
EDIT: There are many plugins that are bringing material-design functionallity in NativeScript (for example cardview) - however notice that material design is more concept based on different rules so one technique can be considered material desing if used in place and anti-material if used wrong..

Related

How to migrate from Material Design 2 to Material Design 3

I have an application which is designed using Material Design 2. I have not submitted that to Playstore yet.
I am now trying to upgrade that application to Material Design 3. AFAIK, the themes etc present in Material Design 3 will not work on below Android 12 devices. So, I am not able to understand how to support Material Design 2(for below Android 12) and Material Design 3(for above Android 12) in my app.
I understand that this must be some basic question but I am not sure how to achieve this. Do I submit different APKs to Playstore with MD2 and MD3 or within code, do I somehow check the version and decide what to apply?
No, you don't need to submit different versions to Google Play. Take a look at migration article from material blog.

Material Design Components Site

Today I was Googling for "material design components" I ended up at this site:
https://material.io/components/
As I remember, I've never seen it before.
In the Android section there are instruction to use the components and ok, it seems to be the well-known Android Design Support Library:
But what intrigues me is that there are components there that are not in the design library, such as:
Back Layer Layout, Material Card and Material Button.
The docs for these classes seems to be not ready yet and the links points to nowhere, like: material button doc.
There is something in the github site.
Sorry for ignorance, but what is the purpose of this site? Is it something future or something left behind?
The Android Design Support Library was the precursor of the Material Design Components. As of the Support Library 28.0.0-alpha1 release, the Design Library now contains all of the new components introduced in the Material Design Components:
We’ve introduced a new application theme, Theme.MaterialComponents, with new attributes and updated styles for components.
We’ve added the following components:
BottomAppBar
Chip
ChipGroup
MaterialButton
MaterialCardView
While the 28.0.0-alpha1 release does contain all of the new classes, the documentation on developer.android.com does not yet contain the updates from the Design Library (keeping the docs effectively on what was publically available previously), but they are definitely there if you use that dependency.
The support libraries are now available through Google's Maven repository. We no longer support downloading the libraries through the SDK Manager, and that functionality will be removed soon..
as the Support Library Setup says. And this repository and material library within it will be offical to use.
Latest dependencies to use material components is:
com.google.android.material:material:1.0.0-alpha1
Getting started with Material Components for Android will help you to setup your project.

Libraries for Material Design

Where can I get list of libraries/resources which help for incorporating Material Design in pre-lollipop devices? A link for a single library you are familiar with could help. I am familiar with the following
https://github.com/makovkastar/FloatingActionButton
https://github.com/keithellis/MaterialWidget
https://github.com/navasmdc/MaterialDesignLibrary
http://www.google.co.uk/design/spec/material-design/introduction.html and
AppCompat v21
You can take look at https://android-arsenal.com/. It's much easier to find something there.
Here's mine:
https://github.com/ZieIony/Carbon. The good thing about the library is that is supports realtime, animated shadows and ripples (soon there will be borderless mode as well) back to Android 2.1. The bad thing is that it's still under development, so there are some things missing.
#makata
Just try to change with Android Studio, you can get Material Design easily.
Here is the android official design library.
You need a single line of codes to add to your build.gradle as a dependency
compile 'com.android.support:design:22.2.0'
Here is the blog for the material design library.
Here is the sample blogpost from a GDE (Thailand)

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

How to apply Material Design to android versions < 5.0?

I given my application target as 21. So I can use the Material Design API's. But when I run the same on older devices whether I have to define different layout or theme or how it could me.
And also I have read the official document Maintaining Compatibility.
But still I was not clear to use the material theme on android devices less than 5 os.
And also where can I find the Android 5 related XML tags. And how the same tags applied when running on devices less than 5.
Please help me on this. Thanks in advance.
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.

Categories

Resources