Skip to content

Commit cfeb31a

Browse files
pekingmeleticiarossi
authored andcommitted
[Shape][NavView] Migrate M3 NavigationView style to new shape system.
PiperOrigin-RevId: 448042553
1 parent 85c40a6 commit cfeb31a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

docs/components/NavigationDrawer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ Element | Attribute
281281
Element | Attribute(s) | Related method(s) | Default value
282282
---------------------- | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -------------
283283
**Color** | `app:itemShapeFillColor` | N/A | `?attr/colorSecondaryContainer`
284-
**Shape** | `app:itemShapeAppearance`<br>`app:itemShapeAppearanceOverlay` | N/A | `?attr/shapeAppearanceSmallComponent`<br>`Corner size: 50%`
284+
**Shape** | `app:itemShapeAppearance`<br>`app:itemShapeAppearanceOverlay` | N/A | `@style/ShapeAppearance.Material3.Corner.Full` <br>(`?attr/shapeCornerFamily` and corner size `50%`)
285285
**Insets** | `app:itemShapeInsetStart`<br>`app:itemShapeInsetTop`<br>`app:itemShapeInsetEnd`<br>`app:itemShapeInsetBottom` | N/A | `12dp`<br>`0dp`<br>`12dp`<br>`0dp`
286286
**Horizontal padding** | `app:itemHorizontalPadding` | `setItemHorizontalPadding`<br>`setItemHorizontalPaddingResource`<br>`getItemHorizontalPadding` | `28dp`
287287
**Vertical padding** | `app:itemVerticalPadding` | `setItemVerticalPadding`<br>`setItemVerticalPaddingResource`<br>`getItemVerticalPadding` | `4dp`

lib/java/com/google/android/material/navigation/res/values/styles.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<item name="subheaderTextAppearance">?attr/textAppearanceTitleSmall</item>
5858
<item name="elevation">@dimen/m3_sys_elevation_level0</item>
5959
<item name="materialThemeOverlay">@style/ThemeOverlay.Material3.NavigationView</item>
60-
<item name="itemShapeAppearanceOverlay">@style/ShapeAppearanceOverlay.Material3.NavigationView.Item</item>
60+
<item name="itemShapeAppearance">@style/ShapeAppearance.Material3.Corner.Full</item>
6161
<item name="itemShapeInsetStart">@dimen/m3_navigation_item_shape_inset_start</item>
6262
<item name="itemShapeInsetTop">@dimen/m3_navigation_item_shape_inset_top</item>
6363
<item name="itemShapeInsetEnd">@dimen/m3_navigation_item_shape_inset_end</item>
@@ -87,9 +87,7 @@
8787
<item name="android:listDivider">?attr/colorOutline</item>
8888
</style>
8989

90-
<style name="ShapeAppearance.Material3.NavigationBarView.ActiveIndicator" parent="ShapeAppearance.Material3.SmallComponent">
91-
<item name="cornerSize">50%</item>
92-
</style>
90+
<style name="ShapeAppearance.Material3.NavigationBarView.ActiveIndicator" parent="ShapeAppearance.Material3.Corner.Full"/>
9391

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

0 commit comments

Comments
 (0)