Android Material Design on KitKat (and lower) devices

南楼画角 提交于 2019-12-03 03:32:09

Currently the Android-L contains the Material Theme which works only on Android-L release.

You can build a Material Style without this Theme. For example:

  • you can use a custom ActionBar (it is a customView) with a solid color, without shadow and with the navdrawer icon insted of standard icon app.

  • You can build a subheader bar with a LinearLayout below the actionBar with the same color.

  • You can build a Floating Action Button with a floating circle (and a shadow in png)

  • and so on...

We don't know what will be available for older releases. May be something as the new class Toolbar will be available in support library (and it will semplify the actionbar). I suggest you waiting a month.

appcompat v21 supports the toolbar on pre-lollipop devices as well.

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

Of course, the elevation attributes does not work on pre-lollipop devices, so you need to implement custom shadow for version < 21. I would suggest a gradient drawable with height around 4dp works fine.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!