Skip to content

Commit 3b2b56e

Browse files
committed
[NavigationRail] Updated documentation to include window inset attributes.
PiperOrigin-RevId: 431462467
1 parent a81a658 commit 3b2b56e

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

docs/components/NavigationRail.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ Which results in:
112112

113113
![The navigation rail container is 72 dp wide by default.](assets/navigationrail/navigation-rail-demo.png)
114114

115+
By default, Navigation rail adds top and bottom padding according to top and
116+
bottom window insets—helping the header layout and menu items dodge system
117+
spaces. This is controlled by the `android:fitsSystemWindowInsets` attribute,
118+
which is set to true by default. To remove this behavior, set
119+
`android:fitsSystemWindowInsets` to `false` or opt in or out of the top and
120+
bottom insets independently by using `app:paddingTopSystemWindowInsets` and
121+
`app:paddingBottomSystemWindowInsets`.
122+
115123
### Making navigation rail accessible
116124

117125
You should set an `android:title` for each of your `menu` items so that screen
@@ -273,10 +281,13 @@ The following is an anatomy diagram for the navigation rail:
273281

274282
#### Container attributes
275283

276-
**Element** | **Attribute** | **Related methods** | **Default value**
277-
------------- | -------------------- | ------------------- | -----------------
278-
**Color** | `app:backgroundTint` | N/A | `?attr/colorSurface`
279-
**Elevation** | `app:elevation` | `setElevation` | `0dp`
284+
**Element** | **Attribute** | **Related methods** | **Default value**
285+
--------------------------------------- | ------------------------------------- | ------------------------------------------------- | -----------------
286+
**Color** | `app:backgroundTint` | N/A | `?attr/colorSurface`
287+
**Elevation** | `app:elevation` | `setElevation` | `0dp`
288+
**Fits system windows** | `android:fitsSystemWindows` | `getFitsSystemWindows`<br/>`setFitsSystemWindows` | `true`
289+
**Padding top system window insets** | `app:paddingTopSystemWindowInsets` | N/A | `null`
290+
**Padding bottom system window insets** | `app:paddingBottomSystemWindowInsets` | N/A | `null`
280291

281292
#### Header attributes
282293

0 commit comments

Comments
 (0)