@@ -20,6 +20,7 @@ See [Bottom Sheet documentation](BottomSheet.md) for documentation about
20
20
* [ Using side sheets] ( #using-side-sheets )
21
21
* [ Standard side sheet] ( #standard-side-sheet )
22
22
* [ Modal side sheet] ( #modal-side-sheet )
23
+ * [ Coplanar side sheet] ( #coplanar-side-sheet )
23
24
* [ Anatomy and key properties] ( #anatomy-and-key-properties )
24
25
* [ Theming] ( #theming-side-sheets )
25
26
@@ -211,6 +212,37 @@ You can then show the side sheet with `sideSheetDialog.show()` and dismiss it
211
212
with ` sideSheetDialog.hide() ` . ` SideSheetDialog ` has built in functionality to
212
213
automatically cancel the dialog after it is swiped off the screen.
213
214
215
+ ## Coplanar side sheet
216
+
217
+ Coplanar side sheets are standard side sheets that "squash" a sibling view's
218
+ content as the side sheet expands. Coplanar side sheets are on the same plane as
219
+ their sibling, as opposed to standard side sheets, which are displayed above the
220
+ screen content.
221
+
222
+ Note: Coplanar side sheets are not recommended for narrow screens.
223
+
224
+ ### Coplanar side sheet example
225
+
226
+ To add a coplanar side sheet to your app, follow the steps to [ add a standard
227
+ side sheet to your layout] ( #standard-side-sheet-example ) , above, and simply set
228
+ ` app:coplanarSiblingViewId ` on the ` View ` that has the side sheet
229
+ ` layout_behavior ` set on it. You can point the coplanar sibling view id to any
230
+ child of the ` CoordinatorLayout ` . Make sure to set
231
+ ` style="@style/Widget.Material3.SideSheet" ` on your side sheet view, as well.
232
+
233
+ Alternatively, you can set the coplanar sibling view programmatically:
234
+
235
+ ``` kt
236
+ coplanarSideSheet.setCoplanarSiblingView(coplanarSiblingView)
237
+ ```
238
+
239
+ To remove coplanar functionality from a side sheet, simply set the coplanar
240
+ sibling view to ` null ` :
241
+
242
+ ``` kt
243
+ coplanarSideSheet.setCoplanarSiblingView(null )
244
+ ```
245
+
214
246
## Anatomy and key properties
215
247
216
248
Side sheets have a sheet, content, and, if modal, a scrim.
@@ -221,13 +253,14 @@ Side sheets have a sheet, content, and, if modal, a scrim.
221
253
222
254
### Sheet attributes
223
255
224
- Element | Attribute | Related method(s) | Default value
225
- -------------- | --------------------- | --------------------------------- | -------------
226
- ** Color** | ` app:backgroundTint ` | N/A | ` ?attr/colorSurface `
227
- ** Shape** | ` app:shapeAppearance ` | N/A | ` ?attr/shapeAppearanceLargeComponent `
228
- ** Elevation** | ` android:elevation ` | N/A | 0dp
229
- ** Max width** | ` android:maxWidth ` | ` setMaxWidth ` <br />` getMaxWidth ` | N/A
230
- ** Max height** | ` android:maxHeight ` | ` setMaxHeight ` <br />` getMaxHeight ` | N/A
256
+ Element | Attribute | Related method(s) | Default value
257
+ -------------- |-----------------------------|---------------------------------------------------------| -------------
258
+ ** Color** | ` app:backgroundTint ` | N/A | ` ?attr/colorSurface `
259
+ ** Coplanar sibling view id** | ` app:coplanarSiblingViewId ` | ` setCoplanarSiblingViewId ` <br />` setCoplanarSiblingView ` | N/A
260
+ ** Shape** | ` app:shapeAppearance ` | N/A | ` ?attr/shapeAppearanceLargeComponent `
261
+ ** Elevation** | ` android:elevation ` | N/A | 0dp
262
+ ** Max width** | ` android:maxWidth ` | ` setMaxWidth ` <br />` getMaxWidth ` | N/A
263
+ ** Max height** | ` android:maxHeight ` | ` setMaxHeight ` <br />` getMaxHeight ` | N/A
231
264
232
265
### Behavior attributes
233
266
0 commit comments