未验证 提交 c6791713 编写于 作者: T Takeshi Hagikura 提交者: GitHub

Preparation for 2.0.0 (#518)

Update README
上级 86ed7ce5
......@@ -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)
......
......@@ -22,7 +22,7 @@ ext {
mavenGroup = 'com.google.android'
mavenArtifactId = 'flexbox'
mavenVersion = '1.1.1'
mavenVersion = '2.0.0'
bintrayOrg = 'google'
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册