Material design for Android on KitKat devices (and below)

I am going to develop an Android application in our school as a project.

I want to use the new Material Design from Google, but I know that it is only available on Android-L devices. Jack Underwood recently released the Calendar Today calendar, which is material-style and works on Kitkat and lower devices.

I know that the height of the Actionbar is slightly larger than the older one, and the navigation box switch has a new style. And here is one ...

How do I implement this?

+6
source share
2 answers

Android-L currently contains a material theme that only works with the release of Android-L.

You can create a material style without this theme. For instance:

  • you can use a custom ActionBar (this is customView) with solid color, no shadow, and with the navdrawer icon set in the standard icon app.

  • You can create a subtitle panel with a LinearLayout below the actionBar with the same color.

  • You can create a floating action button with a floating circle (and a shadow in png)

  • etc.

We do not know what will be available for older versions. Maybe something, because the toolbar of the new class will be available in the support library (and it will smooth the action panel). I suggest you wait a month.

+5
source

appcompat v21 also supports the toolbar on devices with pre-Lellipop.

You can check out Chris's blog for help on this https://chris.banes.me/2014/10/17/appcompat-v21/

Of course, elevation attributes do not work on devices with a preliminary lobe, so you need to implement a custom shadow for version <21. I would suggest that a gradient that can be drawn with a height around 4dp works fine.

+3
source

Source: https://habr.com/ru/post/976052/


All Articles