Skip to content

Commit 67491fc

Browse files
cketchamhunterstich
authored andcommitted
Add paddingBottomSystemWindowInsets to public attrs and update documentation
PiperOrigin-RevId: 281120848
1 parent b200a3b commit 67491fc

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

docs/components/BottomAppBar.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,16 @@ style="@style/Widget.MaterialComponents.BottomAppBar"
7272

7373
### Bottom App Bar Attributes
7474

75-
Feature | Relevant attributes
76-
:----------------------- | :---------------------------------
77-
Background Tint | `app:backgroundTint`
78-
FAB Alignment Mode | `app:fabAlignmentMode`
79-
FAB Cradle Margin | `app:fabCradleMargin`
80-
FAB Cradle Corner Radius | `app:fabCradleRoundedCornerRadius`
81-
FAB Vertical Offset | `app:fabCradleVerticalOffset`
82-
Hide on scroll | `app:hideOnScroll`
75+
Feature | Relevant attributes
76+
:---------------------------- | :------------------------------------
77+
Background Tint | `app:backgroundTint`
78+
FAB Alignment Mode | `app:fabAlignmentMode`
79+
FAB Animation Mode | `app:fabAnimationMode`
80+
FAB Cradle Margin | `app:fabCradleMargin`
81+
FAB Cradle Corner Radius | `app:fabCradleRoundedCornerRadius`
82+
FAB Vertical Offset | `app:fabCradleVerticalOffset`
83+
Hide on scroll | `app:hideOnScroll`
84+
Add Padding for Bottom Insets | `app:paddingBottomSystemWindowInsets`
8385

8486
#### Background Tint
8587

@@ -89,13 +91,14 @@ means that you shouldn't call `setBackground()` or use the `android:background`
8991
attribute in xml. Instead, the `app:backgroundTint` attribute will allow you to
9092
set a tint.
9193

92-
#### `FloatingActionButton` Alignment Modes
94+
#### `FloatingActionButton` Alignment/Animation Modes
9395

9496
The `FloatingActionButton` can be aligned either to the center
9597
(`FAB_ALIGNMENT_MODE_CENTER`) or to the end (`FAB_ALIGNMENT_MODE_END`) by
96-
calling `setFabAlignmentMode(int)`. The default animation will automatically be
97-
run. This can be coordinated with a `Fragment` transition to allow for a smooth
98-
animation from a primary screen to a secondary screen.
98+
calling `setFabAlignmentMode(int)`. The animation specified by
99+
`fabAnimationMode` will automatically be run. The fab animation can be set to
100+
`scale` or `slide`. This can be coordinated with a `Fragment` transition to
101+
allow for a smooth animation from a primary screen to a secondary screen.
99102

100103
#### `FloatingActionButton` Attributes
101104

@@ -118,6 +121,11 @@ is in a `NestedScrollView`. There's no need to wrap the `BottomAppBar` in an
118121
`AppBarLayout` or use any of the scroll flags associated with `AppBarLayout`
119122
such as `app:layout_scrollFlags`.
120123

124+
#### Add Padding for Bottom insets
125+
126+
The `BottomAppBar` can be set to automatically add insets for system navigation
127+
that appears on the bottom of the screen. By default, padding will be added.
128+
121129
### Handling Menu Options
122130

123131
There are two ways to handle menu options. The first way is to directly call

lib/java/com/google/android/material/bottomappbar/BottomAppBar.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
* @attr ref
106106
* com.google.android.material.R.styleable#BottomAppBar_fabCradleVerticalOffset
107107
* @attr ref com.google.android.material.R.styleable#BottomAppBar_hideOnScroll
108+
* @attr ref com.google.android.material.R.styleable#BottomAppBar_paddingBottomSystemWindowInsets
108109
*/
109110
public class BottomAppBar extends Toolbar implements AttachedBehavior {
110111

lib/java/com/google/android/material/bottomappbar/res-public/values/public.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<public name="fabCradleRoundedCornerRadius" type="attr"/>
2323
<public name="fabCradleVerticalOffset" type="attr"/>
2424
<public name="hideOnScroll" type="attr"/>
25+
<public name="paddingBottomSystemWindowInsets" type="attr"/>
2526
<public name="Widget.MaterialComponents.BottomAppBar" type="style"/>
2627
<public name="Widget.MaterialComponents.BottomAppBar.Colored" type="style"/>
2728
<public name="Widget.MaterialComponents.BottomAppBar.PrimarySurface" type="style"/>

0 commit comments

Comments
 (0)