Skip to content

Commit

Permalink
merge dev , fix initial position
Browse files Browse the repository at this point in the history
* dev:
  update version
  The initial position works now.
  • Loading branch information
BCsl committed Jun 17, 2017
2 parents 3f1e949 + 0c8660d commit ed1ac29
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ A custom LayoutManager to build a Gallery or a ViewPager like RecyclerView that
#### Gradle

```java
compile 'github.hellocsl:GalleryLayoutManager:{lastest-version}'
compile 'github.hellocsl:GalleryLayoutManager:{lastest-release-version}'
```

> 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.4'){
compile ('github.hellocsl:GalleryLayoutManager:{lastest-release-version}'){
exclude group: 'com.android.support', module:'recyclerview-v7'
}
```
Expand Down
4 changes: 2 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
#### Gradle

```java
compile 'github.hellocsl:GalleryLayoutManager:{lastest-version}'
compile 'github.hellocsl:GalleryLayoutManager:{lastest-release-version}'
```

> 注意:如果你的项目已经引用了 `RecyclerView` ,那么应该这样引用,而且你的 `RecyclerView` 的引用版本必须大于 24.2.0
```java
compile ('github.hellocsl:GalleryLayoutManager:1.0.4'){
compile ('github.hellocsl:GalleryLayoutManager:{lastest-release-version}'){
exclude group: 'com.android.support', module:'recyclerview-v7'
}
```
Expand Down
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.5'
publishVersion = '1.0.6'
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 @@ -136,11 +136,11 @@ private void reset() {
if (mState != null) {
mState.mItemsFrames.clear();
}
//when data set update keep the last selected position
if (mCurSelectedPosition != -1) {
mInitialSelectedPosition = mCurSelectedPosition;
} else {
mInitialSelectedPosition = 0;
}
mInitialSelectedPosition = Math.min(Math.max(0, mInitialSelectedPosition), getItemCount() - 1);
mFirstVisiblePosition = mInitialSelectedPosition;
mLastVisiblePos = mInitialSelectedPosition;
mCurSelectedPosition = -1;
Expand Down

0 comments on commit ed1ac29

Please sign in to comment.