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. LeetCode 三角形最小路径和

    给定一个三角形,找出自顶向下的最小路径和.每一步只能移动到下一行中相邻的结点上. 例如,给定三角形: [ [2], [3,4], [6,5,7], [4,1,8,3] ] 自顶向下的最小路径和为 11 ...

  2. Mac OSX: 有线共享WiFi

    首先连上有线 系统偏好设置->网络->点击左侧WiFi,再点击右下角[高级] 勾选[创建电脑对电脑网络],然后单击[好] 在顶部菜单栏击WiFi图标,如果WiFi未打开,则单击打开,如果已 ...

  3. 如何用纯 CSS 创作一个菱形 loader 动画

    效果预览 在线演示 按下右侧的"点击预览"按钮可以在当前页面预览,点击链接可以全屏预览. https://codepen.io/comehope/pen/eKzjqK 可交互视频教 ...

  4. bash初识,特性,用法/网站

    目录 一.Bash初识 Bash Shell介绍 Bash Shell的作用 Bash 两种方式 命令提示符 二.Shell的基本语法 三.Shell的基本特性 1.命令补全 tab 2. Linux ...

  5. 日志logging

    日志: 日志分为5个级别:debug(10),info(20),warning(30),error(40),critical(50) 日志四个组成部分:logger,handler,filter,fo ...

  6. [转]python开发_shelve_完整版

    ''' python中的shelve模块,可以提供一些简单的数据操作 他和python中的dbm很相似. 区别如下: 都是以键值对的形式保存数据,不过在shelve模块中, key必须为字符串,而值可 ...

  7. rocketmq 问题

    1. 收不到消息-consumerOffset.json 信息错位 这种情况一般是,手动删除了store/commitlog目录里的数据等非常规手段造成了consumerOffset.json中记录的 ...

  8. python pdb模块

    参考文件http://pythonconquerstheuniverse.wordpress.com/category/Python-debugger/ 翻译不是一一对应 Debug功能对于devel ...

  9. POJ 1543 Perfect Cubes

    Perfect Cubes Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 12595   Accepted: 6707 De ...

  10. CentOS 7.0如何安装配置iptables和seLinux以及firewalld

    一.配置防火墙,开启80端口.3306端口 CentOS .0默认使用的是firewall作为防火墙,这里改为iptables防火墙. .关闭firewall: systemctl stop fire ...