Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,27 @@ viewPager.setAdapter(wrappedAdapter);
```


### Gradle build
### Installation

To install the demo application to your device run the following task:
To use the library in your project add the following to your project `build.gradle`:

```
$ ./gradlew installDebug
```

To deploy the library to your local Maven repository run the following task:

```
$ ./gradlew install
```groovy
dependencies {
compile 'com.github.antonyt:InfiniteViewPager:v1.0.0'
}
```

Then, to use the library in your project add the following to your `build.gradle`:

And add JitPack repository into your root `build.gradle`:
```groovy
dependencies {
compile 'com.antonyt.infiniteviewpager:library:1.0.0'
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
```

Wrapped scrolling should now be possible with your `ViewPager`. The pages you see are not duplicates - each page from your `PagerAdapter` is only created once and then reused. This means you do not have to worry about managing multiple instances of the same `Fragment`.

## Caveats
It is only possible to achieve wrapping when you have at least 4 pages. This is because of the way the `ViewPager` creates, destroys, and displays the pages. No fix for the general case has been found.
It is only possible to achieve wrapping when you have at least 4 pages. This is because of the way the `ViewPager` creates, destroys, and displays the pages. No fix for the general case has been found.