diff --git a/README.md b/README.md index 5993aa3d..addad7a2 100644 --- a/README.md +++ b/README.md @@ -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.** @@ -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) @@ -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) diff --git a/flexbox/constants.gradle b/flexbox/constants.gradle index 6deae2c6..fd199f82 100644 --- a/flexbox/constants.gradle +++ b/flexbox/constants.gradle @@ -22,7 +22,7 @@ ext { mavenGroup = 'com.google.android' mavenArtifactId = 'flexbox' - mavenVersion = '1.1.1' + mavenVersion = '2.0.0' bintrayOrg = 'google' }