Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Commit

Permalink
fix crash which caused by wrong position calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
leochuan committed Jun 26, 2017
1 parent 9fac93e commit d8cc5e6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ ViewPager-Layout-Manager
如果想要自定义效果请在build.gradle文件中引入:

```Java
compile 'rouchuan.viewpagerlayoutmanager:viewpagerlayoutmanager-core:1.2.1'
compile 'rouchuan.viewpagerlayoutmanager:viewpagerlayoutmanager-core:1.3.0'
```
[自定义教程](http://www.jianshu.com/p/b193319d35cf)

如果你想用上面提供的效果,请引入(不需要再引用core):

```groovy
compile 'rouchuan.viewpagerlayoutmanager:viewpagerlayoutmanager-support:1.0.3'
compile 'rouchuan.viewpagerlayoutmanager:viewpagerlayoutmanager-support:1.3.0'
```

### 注意!!!
Expand Down
4 changes: 2 additions & 2 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ All you need to concern about is which the property you want to change and how i
if you want custom your own layout manager please add code below:

```Java
compile 'rouchuan.viewpagerlayoutmanager:viewpagerlayoutmanager-core:1.2.1'
compile 'rouchuan.viewpagerlayoutmanager:viewpagerlayoutmanager-core:1.3.0'
```
or if you want use the effect above please import(No need to import core):

```groovy
compile 'rouchuan.viewpagerlayoutmanager:viewpagerlayoutmanager-support:1.0.3'
compile 'rouchuan.viewpagerlayoutmanager:viewpagerlayoutmanager-support:1.3.0'
```

### Attention!!!
Expand Down
2 changes: 1 addition & 1 deletion viewpagerlayoutmanager-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

version = "1.2.1"
version = "1.3.0"

android {
compileSdkVersion 25
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public abstract class ViewPagerLayoutManager extends RecyclerView.LayoutManager
private boolean enableEndlessScroll = false;

/**
*
* @return the interval of each item's offset
*/
protected abstract float setInterval();
Expand Down Expand Up @@ -293,7 +292,9 @@ private void layoutItems(RecyclerView.Recycler recycler,
if (i >= itemCount) {
realIndex %= itemCount;
} else if (i < 0) {
realIndex += itemCount - (-realIndex) % itemCount;
int delta = (-realIndex) % itemCount;
if (delta == 0) delta = itemCount;
realIndex = itemCount - delta;
}
if (findViewByPosition(i) == null) {
View scrap = recycler.getViewForPosition(realIndex);
Expand Down
2 changes: 1 addition & 1 deletion viewpagerlayoutmanager-support/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies {
compile project(path: ':viewpagerlayoutmanager-core')
}

version = "1.0.3"
version = "1.3.0"

apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
Expand Down

0 comments on commit d8cc5e6

Please sign in to comment.