Skip to content

Commit 752e04c

Browse files
committed
Address additional PR comments and add markdown description
1 parent 3bbd1eb commit 752e04c

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

adaptive/src/main/java/com/google/accompanist/adaptive/FoldAwareColumn.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ private class FoldAwareColumnMeasurementHelper(
310310
*/
311311
@VisibleForTesting
312312
internal fun LayoutCoordinates.trueBoundsInWindow(): Rect {
313-
this.boundsInWindow()
314313
val root = findRootCoordinates()
315314
val bounds = boundsInRoot()
316315
val rootWidth = root.size.width.toFloat()
@@ -375,7 +374,7 @@ internal class IgnoreFoldModifier(
375374
}
376375

377376
override fun hashCode(): Int {
378-
return hashCode()
377+
return 0
379378
}
380379

381380
override fun toString(): String =

docs/adaptive.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ the [`TwoPane`](../api/adaptive/com.google.accompanist.adaptive/-two-pane.html)
3030

3131
When there is no fold, the default supplied strategy will be used instead.
3232

33+
## FoldAwareColumn
34+
35+
[`FoldAwareColumn`](../api/adaptive/com.google.accompanist.adaptive/-fold-aware-column.html) is a simplified version of [Column](https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/package-summary#Column(androidx.compose.ui.Modifier,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.ui.Alignment.Horizontal,kotlin.Function1)) that places children in a fold-aware manner.
36+
37+
[`FoldAwareColumn`](../api/adaptive/com.google.accompanist.adaptive/-fold-aware-column.html) requires a list of display features (to be retrieved with [`calculateDisplayFeatures`](#calculatedisplayfeatures)) to determine which folds to handle automatically.
38+
39+
The built-in `foldPadding` parameter is zero, and the values of the vertical padding are used in the layout determine how much space should be left around a fold when placing children.
40+
41+
When there is a horizontal fold that is obscuring or separating, the layout will begin placing children from the top of the available space. If a child is projected to overlap the fold, then its y-coordinate is increased so it will be placed fully below the fold, as will any other remaining children.
42+
43+
When there is no fold, the children will be placed consecutively with no y-coordinate adjustments.
44+
45+
Optionally, children can be modified with the `ignoreFold()` attribute, which means that they will be placed as if no fold is present even if they overlap a fold.
46+
3347
## Download
3448

3549
[![Maven Central](https://img.shields.io/maven-central/v/com.google.accompanist/accompanist-adaptive)](https://search.maven.org/search?q=g:com.google.accompanist)

0 commit comments

Comments
 (0)