Skip to content

Commit

Permalink
Merge pull request #1730 from Monkey-Matt/Monkey-Matt-patch-2
Browse files Browse the repository at this point in the history
[FlowLayout Documentation] Update flowlayout.md
  • Loading branch information
bentrengrove authored Nov 30, 2023
2 parents d7f9b98 + 2b2f956 commit 03a0a0a
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions docs/flowlayout.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,13 @@

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

Flow Layouts in Accompanist is now deprecated. Please see the migration guide below to begin using
Flow Layouts in Androidx.

The official `androidx.compose.foundation` FlowLayouts support is very similar to accompanist/flowlayouts, with a few changes.

It is most similar to `Row` and `Column` and shares similar modifiers and the scopes.
Unlike the standard `Row` and `Column` composables, if it runs out of space on the current row,
the children are placed in the next line, and this repeats until the children are fully placed.

## Usage

``` kotlin
FlowRow {
// row contents
}

FlowColumn {
// column contents
}
```
!!! warning
**This library is deprecated, with official FlowLayout support in androidx.compose.foundation.** The migration guide and original documentation is below.

## Migration Guide to the official FlowLayouts

The official `androidx.compose.foundation` FlowLayouts support is very similar to accompanist/flowlayouts, with a few changes.

1. Replace import packages to point to Androidx.Compose
``` kotlin
import androidx.compose.foundation.layout.FlowColumn
Expand Down Expand Up @@ -126,6 +110,24 @@ FlowRow(maxItemsInEachRow = 3) {
For examples, refer to the [Flow Row samples](https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-main/compose/foundation/foundation-layout/samples/src/main/java/androidx/compose/foundation/layout/samples/FlowRowSample.kt)
and the [Flow Column samples](https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-main/compose/foundation/foundation-layout/samples/src/main/java/androidx/compose/foundation/layout/samples/FlowColumnSample.kt).
## Original Docs
It is most similar to `Row` and `Column` and shares similar modifiers and the scopes.
Unlike the standard `Row` and `Column` composables, if it runs out of space on the current row,
the children are placed in the next line, and this repeats until the children are fully placed.
## Usage
``` kotlin
FlowRow {
// row contents
}
FlowColumn {
// column contents
}
```
## Download
[![Maven Central](https://img.shields.io/maven-central/v/com.google.accompanist/accompanist-flowlayout)](https://search.maven.org/search?q=g:com.google.accompanist)
Expand All @@ -136,7 +138,7 @@ repositories {
}
dependencies {
implementation "androidx.compose.foundation:foundation:<compose-version>"
implementation "com.google.accompanist:accompanist-flowlayout:<version>"
}
```
Expand Down

0 comments on commit 03a0a0a

Please sign in to comment.