Material Theme
来源:互联网 发布:淘宝商品广告违规 编辑:程序博客网 时间:2024/06/06 03:51
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。
- <resources>
- <!-- inherit from the material theme -->
- <style name="AppTheme" parent="android:Theme.Material">
- <!-- Main theme colors -->
- <!-- your app's branding color (for the app bar) -->
- <item name="android:colorPrimary">@color/primary</item>
- <!-- darker variant of colorPrimary (for status bar, contextual app bars) -->
- <item name="android:colorPrimaryDark">@color/primary_dark</item>
- <!-- theme UI controls like checkboxes and text fields -->
- <item name="android:colorAccent">@color/accent</item>
- </style>
- </resources>
Customize the Status and Navigation Bar
使用material theme可以简单的自己定制status bar,可以让status bar适应你的产品,这个在iOS中也是可以实现的。可以设置android:statusBarColor属性来设置status bar的颜色。前面看到的
- android:colorPrimaryDark
会默认设置为status bar的颜色。
java方法中可以使用Window.setStatusBarColor方法改变status bar来改变色彩。
Theme Individual Views
XML布局中定义的元素可以指定android主题属性。就是可以为你的views在Theme中声明各种属性的值。
这一点,说的最主要的是可以改变status bar的颜色,以前的版本是不可以的。
0 0
- Material Theme
- Material Theme
- Material Theme
- Material design之Material Theme
- Using the Material Theme
- Material Design 之 Theme
- Android Material Design theme
- Using the Material Theme
- Material Design Theme
- Android Material Design theme
- Android Material Design 之 Material Theme
- 自定义material theme的属性
- AndroidStudio使用Material Theme UI
- Material Design 实现之主题使用Theme
- Material Design之Theme样式及切换
- Material Design 实现之主题使用Theme
- android material theme 分享一张图片
- Android Material Design-Using the Material Theme(使用Material主题)-(二)
- 在WebView中如何让JS与Java安全地互相调用
- ServiceStack.Redis 之 IRedisTypedClient<第四篇>
- linux多线程
- Universal Windows App Development with Cortana and the Speech SDK 5
- ServiceStack.Redis常用操作 - 事务、并发锁
- Material Theme
- Mac下安装MySQLdb(包含有eclipse中关于MySQLdb的设置)
- cache性能优化
- asp.net 页面导出word
- Public Repositories仓库中的jar包来源问题
- swift UI专项训练10 视图共性
- Android Volley完全解析(一),初识Volley的基本用法
- sqoop--1.99.3--安装
- Material Design UI Widgets