# ParallaxViewPager
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![](https://jitpack.io/v/demoNo/ParallaxViewPager.svg)](https://jitpack.io/#demoNo/ParallaxViewPager)
README: [English](https://github.com/demoNo/ParallaxViewPager/blob/master/README.md)
图 1
前景速度是背景速度的2倍 当前 `speedRatio = 0.5` | 图 2
前后速度一致(会有些误差),当前 `speedRatio = 1`
---|---
![](https://raw.githubusercontent.com/demoNo/ParallaxViewPager/master/art/rate_0.5.gif) | ![](https://raw.githubusercontent.com/demoNo/ParallaxViewPager/master/art/rate_1.gif)
## 添加依赖
Gradle
* 在工程的根目录`build.gralde`配置
```Gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
* 在app目录的`build.gralde`配置
```Gradle
dependencies {
compile 'com.github.demoNo:ParallaxViewPager:v1.0.0'
}
```
## 使用
* 像正常使用ViewPager一样
```xml