In Android development, how can Material Design be supported while being compatible with Android versions below 4.4?

  android, question

New Beginner Android Development, Please Lead the Way Greatly. . .

According to the official description, API 19 and below cannot use Material Design, but there is a method of Backwards compatibility and using Holo theme instead:

The material theme is only available in the Android L Developer Preview. To configure your app to use the material theme on devices running the Android L Developer Preview and an older theme on devices running earlier versions of Android:

Define a theme that inherits from an older theme (like Holo) in res/values/ styles.xml. Define a theme with the same name that inherits from the material theme in res/values-v21/styles.xml. Set this theme as your app’s theme in the manifest file.

Then I tried to add the corresponding files to the res/values folder to support downward, and found that if I defined the color Action Bar, the application would be beautifully Flashback (5.1 test machine) …

Of course, it is ok not to define the color, but the result is ugly.

The question now is:

  1. If supported by native Material Design, how should the color be set to ensure interpretation below API 19 and above API 21?
  2. What can I do below API 19 if I want to support Material Design?

Again, Kneeling xie.

Material Design can be made in Backwards compatibility. Add in Project Dependency insideappcompat-v7The 21 plus version of this library, and then useTheme.AppCompatThe topic in the can.

This only looks like Material Design on 4.x, but touch feedback, animation, etc. are the same as 4. x.