Skip to content

Commit

Permalink
Ignore unnecessary layout step
Browse files Browse the repository at this point in the history
  • Loading branch information
BCsl committed Apr 9, 2017
1 parent 9f6cbd6 commit 9451b29
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 114 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ compile 'github.hellocsl:GalleryLayoutManager:1.0.3'
> Be care :if you have used `RecyclerView` in your project , maybe your should use this library as below and your recyclerview-v7 requires API level 24.2.0 or higher
```java
compile ('github.hellocsl:GalleryLayoutManager:1.0.3'){
compile ('github.hellocsl:GalleryLayoutManager:1.0.4'){
exclude group: 'com.android.support', module:'recyclerview-v7'
}
```
Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#### Gradle

```java
compile 'github.hellocsl:GalleryLayoutManager:1.0.3'
compile 'github.hellocsl:GalleryLayoutManager:1.0.4'
```

> 注意:如果你的项目已经引用了 `RecyclerView` ,那么应该这样引用,而且你的 `RecyclerView` 的引用版本必须大于 24.2.0
Expand Down
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ dependencies {

compile deps.butterKnife
annotationProcessor deps.butterKnifeProcessor
compile ('github.hellocsl:GalleryLayoutManager:1.0.3'){
exclude group: 'com.android.support', module:'recyclerview-v7'
}
// compile ('github.hellocsl:GalleryLayoutManager:1.0.3'){
// exclude group: 'com.android.support', module:'recyclerview-v7'
// }

// compile project(path: ':library')
compile project(path: ':library')

}

This file was deleted.

2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ publish {
userOrg = 'bcsl'
groupId = 'github.hellocsl'
artifactId = 'GalleryLayoutManager'
publishVersion = '1.0.3'
publishVersion = '1.0.4'
desc = 'A custom LayoutManager to build a Gallery or a ViewPager like widget with RecycleView in Android and ' +
'support both HORIZONTAL and VERTICAL scroll.'
website = 'https://github.com/BCsl/GalleryLayoutManager'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,12 @@ public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State
if (state.isPreLayout()) {
return;
}

if (state.getItemCount() != 0 && !state.didStructureChange()) {
if (BuildConfig.DEBUG) {
Log.d(TAG, "onLayoutChildren: ignore extra layout step");
}
return;
}
if (getChildCount() == 0 || state.didStructureChange()) {
reset();
}
Expand Down

0 comments on commit 9451b29

Please sign in to comment.