Skip to content

Commit 37a85c3

Browse files
manabu-nakamurakendrickumstattd
authored andcommitted
[Docs] update BottomAppBar.md
Resolves #4476 GIT_ORIGIN_REV_ID=c46c76160a0245e3c9e864ad047d443ef48e4b0c PiperOrigin-RevId: 711809552
1 parent cfe6dce commit 37a85c3

File tree

1 file changed

+15
-30
lines changed

1 file changed

+15
-30
lines changed

docs/components/BottomAppBar.md

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -327,22 +327,22 @@ bottom app bars and FABs and affects other components:
327327
```xml
328328
<style name="Theme.App" parent="Theme.Material3.*">
329329
...
330-
<item name="colorPrimary">@color/shrine_pink_100</item>
331-
<item name="colorOnPrimary">@color/shrine_pink_900</item>
332-
<item name="colorSecondary">@color/shrine_pink_50</item>
333-
<item name="colorOnSecondary">@color/shrine_pink_900</item>
330+
<item name="colorSurfaceContainer">@color/shrine_pink_100</item>
331+
<item name="colorOnSurface">@color/shrine_pink_900</item>
332+
<item name="colorPrimaryContainer">@color/shrine_pink_50</item>
333+
<item name="colorOnPrimaryContainer">@color/shrine_pink_900</item>
334334
<item name="textAppearanceTitleMedium">@style/TextAppearance.App.Medium</item>
335-
<item name="shapeAppearanceSmallComponent">@style/ShapeAppearance.App.SmallComponent</item>
335+
<item name="shapeAppearanceCornerLarge">@style/ShapeAppearance.App.Corner.Large</item>
336336
</style>
337337

338338
<style name="TextAppearance.App.Medium" parent="TextAppearance.Material3.TitleMedium">
339339
<item name="fontFamily">@font/rubik</item>
340340
<item name="android:fontFamily">@font/rubik</item>
341341
</style>
342342

343-
<style name="ShapeAppearance.App.SmallComponent" parent="ShapeAppearance.Material3.SmallComponent">
343+
<style name="ShapeAppearance.App.Corner.Large" parent="ShapeAppearance.Material3.Corner.Large">
344344
<item name="cornerFamily">cut</item>
345-
<item name="cornerSize">4dp</item>
345+
<item name="cornerSize">50%</item>
346346
</style>
347347
```
348348

@@ -360,20 +360,20 @@ theme to all bottom app bars and FABs but does not affect other components:
360360
<item name="materialThemeOverlay">@style/ThemeOverlay.App.BottomAppBar</item>
361361
</style>
362362

363-
<style name="Widget.App.FloatingActionButton" parent="Widget.Material3.FloatingActionButton">
363+
<style name="Widget.App.FloatingActionButton" parent="Widget.Material3.FloatingActionButton.Primary">
364364
<item name="materialThemeOverlay">@style/ThemeOverlay.App.FloatingActionButton</item>
365365
</style>
366366

367-
<style name="ThemeOverlay.App.BottomAppBar" parent="">
368-
<item name="colorPrimary">@color/shrine_pink_100</item>
369-
<item name="colorOnPrimary">@color/shrine_pink_900</item>
367+
<style name="ThemeOverlay.App.BottomAppBar" parent="ThemeOverlay.Material3.BottomAppBar">
368+
<item name="colorSurfaceContainer">@color/shrine_pink_100</item>
369+
<item name="colorOnSurface">@color/shrine_pink_900</item>
370370
<item name="textAppearanceTitleMedium">@style/TextAppearance.App.TitleMedium</item>
371371
</style>
372372

373-
<style name="ThemeOverlay.App.FloatingActionButton" parent="">
374-
<item name="colorSecondary">@color/shrine_pink_50</item>
375-
<item name="colorOnSecondary">@color/shrine_pink_900</item>
376-
<item name="shapeAppearanceSmallComponent">@style/ShapeAppearance.App.SmallComponent</item>
373+
<style name="ThemeOverlay.App.FloatingActionButton" parent="ThemeOverlay.Material3.FloatingActionButton.Primary">
374+
<item name="colorPrimaryContainer">@color/shrine_pink_50</item>
375+
<item name="colorOnPrimaryContainer">@color/shrine_pink_900</item>
376+
<item name="shapeAppearanceCornerLarge">@style/ShapeAppearance.App.Corner.Large</item>
377377
</style>
378378
```
379379

@@ -390,18 +390,3 @@ Use the styles in the layout, which affects only this bottom app bar and FAB:
390390
style="@style/Widget.App.FloatingActionButton"
391391
/>
392392
```
393-
394-
In code:
395-
396-
```kt
397-
val topEdge = BottomAppBarCutCornersTopEdge(
398-
bottomAppBar.fabCradleMargin,
399-
bottomAppBar.fabCradleRoundedCornerRadius,
400-
bottomAppBar.cradleVerticalOffset
401-
)
402-
val background = bottomAppBar.background as MaterialShapeDrawable
403-
background.shapeAppearanceModel = background.shapeAppearanceModel.toBuilder().setTopEdge(topEdge).build()
404-
```
405-
406-
**Note:** Using `BottomAppBarCutCornersTopEdge` is not necessary with rounded
407-
shapeAppearance corners.

0 commit comments

Comments
 (0)