Skip to content

Instantly share code, notes, and snippets.

@ricknout
Created July 31, 2020 20:23
Show Gist options
  • Save ricknout/0f43afeaa9b90c2c067e2b9be946a1c2 to your computer and use it in GitHub Desktop.
Save ricknout/0f43afeaa9b90c2c067e2b9be946a1c2 to your computer and use it in GitHub Desktop.
MDC-Android shape in custom views
<!-- Copyright 2020 Google LLC.
SPDX-License-Identifier: Apache-2.0 -->
<!-- In res/values/attrs.xml -->
<declare-styleable name="AppCustomView">
<attr name="shapeAppearance" />
...
</declare-styleable>
<!-- In res/values/styles.xml -->
<style name="Widget.App.CustomView" parent="android:Widget">
<item name="android:background">@null</item>
<item name="shapeAppearance">?attr/shapeAppearanceMediumComponent</item>
...
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment