Skip to content

Commit

Permalink
[Badge][NavRail][BottomNavBar] Adjust badge vertical offset for certa…
Browse files Browse the repository at this point in the history
…in components to fit design requirements

PiperOrigin-RevId: 569527192
  • Loading branch information
imhappi authored and dsn5ft committed Oct 2, 2023
1 parent 094e3e2 commit 78cc54b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Expand Up @@ -44,4 +44,6 @@
<dimen name="m3_badge_with_text_offset">12dp</dimen>
<dimen name="m3_large_text_vertical_offset_adjustment">4dp</dimen>
<dimen name="m3_badge_with_text_vertical_padding">2dp</dimen>

<dimen name="m3_nav_badge_with_text_vertical_offset">14dp</dimen>
</resources>
Expand Up @@ -87,9 +87,14 @@
</style>

<style name="ThemeOverlay.Material3.BottomNavigationView" parent="">
<item name="badgeStyle">@style/Widget.Material3.Badge.AdjustToBounds</item>
<item name="badgeStyle">@style/Widget.Material3.BottomNavigation.Badge</item>
</style>

<style name="Widget.Material3.BottomNavigation.Badge" parent="Widget.Material3.Badge.AdjustToBounds">
<item name="verticalOffsetWithText">@dimen/m3_nav_badge_with_text_vertical_offset</item>
</style>


<style name="Widget.Material3.BottomNavigationView.ActiveIndicator" parent="">
<item name="android:width">@dimen/m3_bottom_nav_item_active_indicator_width</item>
<item name="android:height">@dimen/m3_bottom_nav_item_active_indicator_height</item>
Expand Down
Expand Up @@ -98,6 +98,7 @@

<style name="Widget.Material3.NavigationRailView.Badge" parent="Widget.Material3.Badge.AdjustToBounds">
<item name="largeFontVerticalOffsetAdjustment">@dimen/m3_large_text_vertical_offset_adjustment</item>
<item name="verticalOffsetWithText">@dimen/m3_nav_badge_with_text_vertical_offset</item>
</style>

</resources>

0 comments on commit 78cc54b

Please sign in to comment.