Home Design

by Androidhunt

Shape theming on Android using the MDC library

Nick Rout
Image for post

Image for post

Image for post

Image for post

MDC shape attributes with baseline values
Image for post

Image for post

Shape attributes used by a button
app:shapeAppearance=”?attr/shapeAppearanceSmallComponent”

 ...

@style/ShapeAppearance.MaterialComponents.MediumComponent

Image for post

Image for post

Shape customization tool

XML shapes and android:background


...


...
android:background=”@drawable/shape_background” />

ShapeAppearance styles

ShapeAppearance overlays

Fill and stroke


...

?attr/colorSurface

?attr/colorOnSurface
1dp


?attr/shapeAppearanceLargeComponent

Image for post

Image for post

Material Design components responding to theme-level shape overrides
Image for post

Image for post

MaterialShapeDrawable and ShapeAppearanceModel visualized

ShapeAppearanceModel

Fill and stroke

Elevation and overlays

Shadow rendering

Corner interpolation

Build a Material Theme

Image for post

Image for post

Changes in shape values in Build a Material Theme

MDC developer docs

Image for post

Image for post

MDC button dev doc attribute table with default shape values

Source code

Image for post

Image for post

MDC button default style with shape values

Use MDC attrs in s and default styles

Keep elevation and overlays in mind

You may also like

Leave a Reply