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. NOIP 2017 D2T1 奶酪

    #include<iostream> #include<cstdio> #include<cstdlib> #include<algorithm> #i ...

  2. 前端开发中提到的“脚手架”到底指什么,CLI?gulp 和 gulp-cli有什么区别

    一般来说,脚手架是帮你减少「为减少重复性工作而做的重复性工作」的工具. gulp和gulp-cli的区别可以看这个task - what does gulp-"cli" stand ...

  3. Objective-C 正则表达式使用(1)

    学习了一下OC的正则表达式备忘一下 使用正则表达式的步骤: 创建一个一个正则表达式对象:定义规则. 利用正则表达式对象测试,相应的字符串. NSString *userName = @"12 ...

  4. foxmial 和 outlook设置问题

    您可以使用支持POP3的客户端软件(例如Foxmail或Outlook)收发您的邮件.请配置您的电子邮件客户端,以下载QQ邮箱邮件. 了解如何进行配置,请单击您的电子邮件客户端名称: Foxmail设 ...

  5. u-boot顶层Makefile分析

    1.u-boot制作命令 make forlinx_nand_ram256_config: make all; 2.顶层mkconfig分析,参考 U-BOOT顶层目录mkconfig分析 mkcon ...

  6. stm32单片机的C语言优化

    对于有些单片机,自身容量是很有限的,有的仅仅只有8k.16k的flash等,但是对32位mcu来说,这点空间实在有点小.不像计算机一样内存和rom都很多,因此有时候就需要进行代码优化.大家都知道,单片 ...

  7. JavaScript脚本在页面中放置的位置

    JavaScript脚本通常放置在三个位置: 1.head部分JavaScript脚本. 2.body部分JavaScript脚本. 3.单独以.js结尾的文件中的JavaScript脚本. 客户端会 ...

  8. 学习笔记3——WordPress文件目录结构详解

    **********根目录********** 1.index.php:WordPress核心索引文件,即博客输出文件.2.license.txt:WordPress GPL许可证文件.3.my-ha ...

  9. 学习笔记1——下载和安装WordPress

    首先,到WordPress官方网站下载WordPress,下载地址https://cn.wordpress.org/txt-download/ 然后,将下载后的文件夹放在www目录下,到浏览器中输入l ...

  10. Codeforces Round #305 (Div. 2) D. Mike and Feet

    D. Mike and Feet time limit per test 1 second memory limit per test 256 megabytes input standard inp ...