上文 ,对Android 5.X特性,主要是Material Design的特性进行了介绍,这篇文章我们来使用Material Design主题。

  Material Design 现在有三种默认的主题可以设置,相应源代码如下所示:

@android:style/Theme.Material (dark version)@android:style/Theme.Material.Light (light version)@android:style/Theme.Material.Light.DarkActionBar

  效果图如下所示:

Android 5.x特性概览二_第1张图片

  在Android5.x中引入了colour Palette的概念,Color Palette让app的开发者自己设定系统区域颜色,从而使整个app的颜色与系统区域的颜色来保持相互的统一。

  

    <style name="AppBaseTheme" parent="android:Theme.Material">        <!--            Theme customizations available in newer API levels can go in            res/values-vXX/styles.xml, while customizations related to            backward-compatibility can go here.        -->    </style>    <!-- Application theme. -->    <style name="AppTheme" parent="AppBaseTheme">        <!-- All customizations that are NOT specific to a particular API-level can go here. -->        <item name="android:colorPrimary">#bebebe</item>        <item name="android:colorPrimaryDark">#FF5AEBFF</item>        <!-- theme UI controls like checkboxes and text fields -->        <item name="android:navigationBarColor">#FFFF4130</item>    </style>

  譬如,使用上述xml代码,用户就能够自定义自己的Style 来创建自己的Palette,从而实现不同的颜色风格。效果图如下所示:

Android 5.x特性概览二_第2张图片

更多相关文章

  1. android 中使用TextView实现分段显示不同颜色的字符串
  2. Android Studio 修改 Logcat 颜色
  3. Android Bitmap换背景颜色
  4. android 颜色采摘
  5. Android中颜色值列表
  6. android spinner 选中后显示字体的颜色设置

随机推荐

  1. 深入探索Redis的五种基础数据类型
  2. C语言学习笔记 第三天
  3. KMP算法的JAVA实现
  4. 太赞了!机器学习基础核心算法:贝叶斯分类!(
  5. 原子操作是如何实现的?
  6. Docker学习笔记:(1)Docker基础知识
  7. 用sa-token轻松解决网站权限验证
  8. Java中的 Switch 是如何支持 String 的?为
  9. sa-token v1.8.0 版本已发布,带来大量激动
  10. 一个登录功能也能玩出这么多花样?sa-token