Android Material Design on KitKat (and lower) devices

后端 未结 2 1696
感情败类
感情败类 2021-02-06 10:43

I\'m going to develop an android application in our school as a project.

I want to use the new Material Design by Google but i know its only available on Android-L Devi

相关标签:
2条回答
  • 2021-02-06 11:18

    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.

    0 讨论(0)
  • 2021-02-06 11:18

    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.

    0 讨论(0)
提交回复
热议问题