Skip to content

Commit

Permalink
[Shape][NavView] Migrate M3 NavigationView style to new shape system.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 448042553
  • Loading branch information
pekingme authored and leticiarossi committed May 11, 2022
1 parent 85c40a6 commit cfeb31a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/components/NavigationDrawer.md
Expand Up @@ -281,7 +281,7 @@ Element | Attribute
Element | Attribute(s) | Related method(s) | Default value
---------------------- | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -------------
**Color** | `app:itemShapeFillColor` | N/A | `?attr/colorSecondaryContainer`
**Shape** | `app:itemShapeAppearance`<br>`app:itemShapeAppearanceOverlay` | N/A | `?attr/shapeAppearanceSmallComponent`<br>`Corner size: 50%`
**Shape** | `app:itemShapeAppearance`<br>`app:itemShapeAppearanceOverlay` | N/A | `@style/ShapeAppearance.Material3.Corner.Full` <br>(`?attr/shapeCornerFamily` and corner size `50%`)
**Insets** | `app:itemShapeInsetStart`<br>`app:itemShapeInsetTop`<br>`app:itemShapeInsetEnd`<br>`app:itemShapeInsetBottom` | N/A | `12dp`<br>`0dp`<br>`12dp`<br>`0dp`
**Horizontal padding** | `app:itemHorizontalPadding` | `setItemHorizontalPadding`<br>`setItemHorizontalPaddingResource`<br>`getItemHorizontalPadding` | `28dp`
**Vertical padding** | `app:itemVerticalPadding` | `setItemVerticalPadding`<br>`setItemVerticalPaddingResource`<br>`getItemVerticalPadding` | `4dp`
Expand Down
Expand Up @@ -57,7 +57,7 @@
<item name="subheaderTextAppearance">?attr/textAppearanceTitleSmall</item>
<item name="elevation">@dimen/m3_sys_elevation_level0</item>
<item name="materialThemeOverlay">@style/ThemeOverlay.Material3.NavigationView</item>
<item name="itemShapeAppearanceOverlay">@style/ShapeAppearanceOverlay.Material3.NavigationView.Item</item>
<item name="itemShapeAppearance">@style/ShapeAppearance.Material3.Corner.Full</item>
<item name="itemShapeInsetStart">@dimen/m3_navigation_item_shape_inset_start</item>
<item name="itemShapeInsetTop">@dimen/m3_navigation_item_shape_inset_top</item>
<item name="itemShapeInsetEnd">@dimen/m3_navigation_item_shape_inset_end</item>
Expand Down Expand Up @@ -87,9 +87,7 @@
<item name="android:listDivider">?attr/colorOutline</item>
</style>

<style name="ShapeAppearance.Material3.NavigationBarView.ActiveIndicator" parent="ShapeAppearance.Material3.SmallComponent">
<item name="cornerSize">50%</item>
</style>
<style name="ShapeAppearance.Material3.NavigationBarView.ActiveIndicator" parent="ShapeAppearance.Material3.Corner.Full"/>

<!-- Style for Material3 DrawerLayout. -->
<style name="Widget.Material3.DrawerLayout" parent="android:Widget">
Expand Down

0 comments on commit cfeb31a

Please sign in to comment.