Skip to content

Commit

Permalink
Preparation for 2.0.0 (#518)
Browse files Browse the repository at this point in the history
Update README
  • Loading branch information
thagikura authored Nov 22, 2019
1 parent 86ed7ce commit c679171
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ Add the following dependency to your `build.gradle` file:

```
dependencies {
implementation 'com.google.android:flexbox:1.1.1'
implementation 'com.google.android:flexbox:2.0.0'
}
```

**Note that the default values for `alignItems` and `alignContent` for `FlexboxLayout` have been changed from `stretch` to `flex_start` starting from 2.0.0, it may break the existing apps.
Please make sure to set `stretch` explicitly if you want to apply the behavior of `stretch`.**


**Note that starting from 1.1.0, the library is expected to use with AndroidX. Please migrate to [AndroidX](https://developer.android.com/jetpack/androidx/migrate) if you use 1.1.0 or above.**

**Please use 1.0.0 if you haven't migrated to AndroidX.**
Expand Down Expand Up @@ -162,23 +166,23 @@ Here is a quick overview of the attributes/features comparison between the two i

* __alignItems__
* This attribute controls the alignment along the cross axis. Possible values are:
* stretch (default)
* flex_start
* flex_start (default)
* flex_end
* center
* baseline
* stretch

![Align Items explanation](/assets/align-items.gif)

* __alignContent__
* This attribute controls the alignment of the flex lines in the flex container. Possible values
are:
* stretch (default)
* flex_start
* flex_start (default)
* flex_end
* center
* space_between
* space_around
* stretch

![Align Content explanation](/assets/align-content.gif)

Expand Down Expand Up @@ -369,6 +373,9 @@ equivalent attribute
but as explained above, Android developers will benefit by having this attribute for having
more control over when a wrapping happens.

(5) Default values for `alignItems` and `alignContent` are set to `flex_start` instead of `stretch`.
* Setting `stretch` for the `alignItems` is expensive because the children of `FlexboxLayout` are calculated more than twice. The difference is more obvious when the layout hierarchy is deeply nested.

## Xamarin Binding
Xamarin binding is now available on [NuGet](https://www.nuget.org/packages/FlexboxLayoutXamarinBindingAndroid/) thanks to [@btripp](https://github.com/btripp)

Expand Down
2 changes: 1 addition & 1 deletion flexbox/constants.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ext {

mavenGroup = 'com.google.android'
mavenArtifactId = 'flexbox'
mavenVersion = '1.1.1'
mavenVersion = '2.0.0'

bintrayOrg = 'google'
}

0 comments on commit c679171

Please sign in to comment.