Material Theme提供了一下功能:

1、系统widgets可以设置调色板

2、系统widgets的触摸反馈

3、Activity过渡动画

你可以根据你品牌的色彩来定义Material Theme,可以使用Material Theme的色彩为status bar、action bar着色。参考下图。

系统Widgets有新的设计和触摸动画,你也可以在自己的应用中自定义色彩调色板、触摸反馈动画、Activity过渡。

Material Theme的定义如下:

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

你可以使用一系列的material styles,查看 android.R.style 参考。

Customize the Color Palette

自定义主题的基础颜色,以适应你的品牌,使用Theme属性自定义颜色,Theme继承自Material Theme。

  1. <resources>
  2. <!-- inherit from the material theme -->
  3. <style name="AppTheme" parent="android:Theme.Material">
  4. <!-- Main theme colors -->
  5. <!--   your app's branding color (for the app bar) -->
  6. <item name="android:colorPrimary">@color/primary</item>
  7. <!--   darker variant of colorPrimary (for status bar, contextual app bars) -->
  8. <item name="android:colorPrimaryDark">@color/primary_dark</item>
  9. <!--   theme UI controls like checkboxes and text fields -->
  10. <item name="android:colorAccent">@color/accent</item>
  11. </style>
  12. </resources>

Customize the Status and Navigation Bar

使用material theme可以简单的自己定制status bar,可以让status bar适应你的产品,这个在iOS中也是可以实现的。可以设置android:statusBarColor属性来设置status bar的颜色。前面看到的

  1. android:colorPrimaryDark

会默认设置为status bar的颜色。

java方法中可以使用Window.setStatusBarColor方法改变status bar来改变色彩。

Theme Individual Views

XML布局中定义的元素可以指定android主题属性。就是可以为你的views在Theme中声明各种属性的值。

这一点,说的最主要的是可以改变status bar的颜色,以前的版本是不可以的。

Material Theme的更多相关文章

  1. 使用Material Design 创建App翻译系列----材料主题的使用(Using Material Theme)

    上一篇是使用Material Design 创建App翻译系列--開始学习篇,进入正题: 新的材料主题提供了下面内容: 1. 提供了同意设置颜色板的系统部件组件. 2. 为这些系统组件提供了触摸反馈动 ...

  2. Material Theme 文件名的标签(tab)被大写了

    我们平时使用的都是小写的,今天第一次使用Material Theme 这个发现标签被大写了,百度后没找到然后自己找了找设置,解决了 原来是这样的, 设置如下 设置后: 希望能帮到有同样问题的同学

  3. webstorm离线装载Material Theme UI

    首先说说需求,由于直接用webstorm听说VS挺火的,但是初恋的感觉是其他任何编辑器无法替代的 瞎说了一些话,新公司内网开发,用的是vscode,但是我还是喜欢用webstorm,连不上网,所以不能 ...

  4. Material Design系列第三篇——Using the Material Theme

    Using the Material Theme This lesson teaches you to Customize the Color Palette Customize the Status ...

  5. Android Studio 换主题(Material Theme..)

    1.去如下网址下载自己喜欢的主题文件xx.jar http://color-themes.com/?view=index 2. 导入方式 下载主题—xxx.jar 注意:如果我们下载下来的jar名字如 ...

  6. Material design之Material Theme

    Material Theme提供了三方面的内容: 系统组件的颜色可以自定义更改 系统组件添加了触摸反馈动画效果 Activity切换动画效果 系统主题默认被定义在以下三个样式中: 使用Material ...

  7. webstorm2017.02版本如何使用material theme

    本想废话一番,表达对material theme的喜欢.还是直接说方法吧~ file-settings-Plugins-Browse repositories-搜索 material theme -选 ...

  8. 使用 Hexo,Material Theme 以及 Github Pages 搭建个人博客

    准备条件 Node.js npm Git GitHub账号 开始搭建 hexo init Blog cd Blog npm install hexo-deployer-git --save npm i ...

  9. Android Material Design 学习笔记 - Matrial Theme

    google在2014年 I/O大会上推出了一种新的设计设计语言—Material design,这种设计语言语言旨在为手机.平板电脑.台式机和“其他平台”提供更一致.更广泛的“外观和感觉”(附上官方 ...

随机推荐

  1. 【数论】贝壳找房计数比赛&&祭facinv

    震惊!阶乘逆元处理背后竟有如此玄机…… 题目描述 贝壳找房举办了一场计数比赛,比赛题目如下. 给一个字符串 s 和字符串 t,求出 s 的所有去重全排列中 t 出现的次数.比如aab的去重全排列为aa ...

  2. 破解点触码的识别之第三方平台超级鹰的SDK(python3版本)

    import requestsfrom hashlib import md5 class Chaojiying(object): def __init__(self, username, passwo ...

  3. grafana绘制图表

    安装方法 系统为ubuntu16 1首先添加以下到/etc/apt/sources.list: deb https://packagecloud.io/grafana/stable/debian/ s ...

  4. RN调试

    https://facebook.github.io/react-native/docs/debugging.html 热加载 RN的目标是极致的开发体验,修改文件后能在1秒内看到变化,通过以下三个特 ...

  5. 【php】png 图片压缩 透明底色变黑

    需要使用gd库的方法 php需要引入gd扩展支持 /* * 图片压缩 ----------------------------------------------------------------- ...

  6. Lex与Yacc学习(六)之lex & yacc (简单计算器程序) 运行

    词法分析程序ch3-01.l %{ #include "ch3-01.tab.h" extern int yylval; %} %% [0-9]+ { yylval = atoi( ...

  7. POJ:2406-Power Strings(寻找字符串循环节)

    Power Strings Time Limit: 3000MS Memory Limit: 65536K Description Given two strings a and b we defin ...

  8. Python内置函数(4)

    Python内置函数(4) 1.copyright 交互式提示对象打印许可文本,一个列表贡献者和版权声明 2.credits 交互式提示对象打印许可文本,一个贡献者和版权声明的列表 3.delattr ...

  9. 11g自动分区超过最大限制

    公司业务系统一张表按时间每天分区 写入数据时报错:ORA-14300: 分区关键字映射到超出允许的最大分区数的分区 ORA-14300: partitioning key maps to a part ...

  10. 【Luogu】P1850换教室(期望DP)

    题目链接 又一道面向题解编程的恶心神题.真是叫人质壁分离…… 设f[i][j][k]表示考虑了前i节课,尝试了j次,当前申请结果为k时消耗的体力值. 对于f[i][j][0]有两种情况:一是我们的主角 ...