Skip to content

chenxinxun/ReviewPDesignLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android P support 28.0.0-alpha1 Design 库预览

2018三月,发布了Android p 预览版。想了解具体变化可以查看 release notes 这里重点看下MD设计相关的内容

  • 加入了新的主题
Theme.MaterialComponents
  • 新添加Components
BottomAppBar
Chip
ChipGroup
MaterialButton
MaterialCardView

效果如下

开发过程中需要做的调整

    compileSdkVersion 'android-P'
    implementation"com.android.support:appcompat-v7:$support_version"
    implementation"com.android.support:design:$support_version"
(ext.support_version = '28.0.0-alpha1')
  • BottomAppBar (官方说法是说BottomAppBar 像是FloatingActionButton的摇篮(翻译的有点怪不过看效果好像有那么点意思)) Bottom App bar 是Toolbar一种拓展,配合FloatingActionButton使用,FloatingActionButton 设置关联 到BottomAppBar,当然需要用到CoordinatorLayout作为它们的父级元素。
    • 要更改背景,您应该调用app:backgroundTint而不是android:background
    • setTitlesetSubTitle被覆盖不再起作用
  • Chip ChipGroup 标签和标签组 Chip 通过设置
    • style="@style/Widget.MaterialComponents.Chip.Filter"
    • style="@style/Widget.MaterialComponents.Chip.Action"
    • style="@style/Widget.MaterialComponents.Chip.Choice" 来决定Chip类型,ChipGroup 可以设置为标签组为单选标签 app:singleSelection="true"
  • MaterialCardView 添加了添加了strokeColor ,strokeWidth属性
  • MaterialButton
    • 本身圆角按钮 app:cornerRadius
    • 图标按钮 app:icon 可以控制图标位置和颜色
    • 要更改背景,您应该调用app:backgroundTint而不是android:background

About

android P 预览版的md新增

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages