https://github.com/kibotu/parallaxscrollingview
Parallax scrolling either by offset or automatically.
https://github.com/kibotu/parallaxscrollingview
acceleratered android gpu hacktoberfest hacktoberfest2023 kotlin parallax scrolling viewpager viewpager2
Last synced: 6 months ago
JSON representation
Parallax scrolling either by offset or automatically.
- Host: GitHub
- URL: https://github.com/kibotu/parallaxscrollingview
- Owner: kibotu
- License: apache-2.0
- Created: 2019-09-12T12:47:04.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-11-06T10:02:13.000Z (almost 2 years ago)
- Last Synced: 2025-03-27T18:21:39.234Z (7 months ago)
- Topics: acceleratered, android, gpu, hacktoberfest, hacktoberfest2023, kotlin, parallax, scrolling, viewpager, viewpager2
- Language: Kotlin
- Homepage:
- Size: 20.4 MB
- Stars: 102
- Watchers: 5
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.paypal.me/janrabe/5) [](https://about.me/janrabe)
# ParallaxScrollingView [](https://jitpack.io/#kibotu/ParallaxScrollingView) [](https://jitpack.io/#kibotu/ParallaxScrollingView) [](https://hitsofcode.com/view/github/kibotu/ParallaxScrollingView) [](https://jitpack.io/com/github/kibotu/ParallaxScrollingView/master-SNAPSHOT/javadoc/index.html) [](https://travis-ci.org/kibotu/ParallaxScrollingView) [](https://android-arsenal.com/api?level=15) [](https://docs.gradle.org/current/release-notes) [](https://kotlinlang.org/) [](https://raw.githubusercontent.com/kibotu/ParallaxScrollingView/master/LICENSE) [](https://developer.android.com/topic/libraries/support-library/refactor)Parallax Scrolling View.
- automatic scrolling with different speeds
- minimal integration
- gpu accelerated
- supports vector drawables
- supports bitmap drawables
- supports ViewPager2
- argb interpolated gradient on viewpager scrolling
- updates statusBar color on scroll[](https://github.com/kibotu/ParallaxScrollingView/raw/master/sample_big.gif)
### How to use
1 add ParallaxScrollingView to [your layout](app/src/main/res/layout/activity_main.xml#L21-L82)
```xml
```
2 (Optional) add [ParallaxScrollingViewOnPageScrollListener](app/src/main/java/net/kibotu/parallaxscrollingview/demo/MainActivity.kt#L28)) to ViewPager2
```kotlin
viewPager.registerOnPageChangeCallback(ParallaxScrollingViewOnPageScrollListener(listOf(wave1, wave2, wave3, wave4, wave5, wave6), 2f))
```3(Optional) add [OffsetOnPageScrollListener](app/src/main/java/net/kibotu/parallaxscrollingview/demo/MainActivity.kt#L30) to ViewPager2
```kotlin
viewPager.registerOnPageChangeCallback(OffsetOnPageScrollListener(this, root, items.indices.map { backgrounds[it] }, true))
```### How to install
```groovy
repositories {
maven {
url "https://jitpack.io"
}
}dependencies {
implementation 'com.github.kibotu:ParallaxScrollingView:-SNAPSHOT'
}
```### Notes
Follow me on Twitter: [@wolkenschauer](https://twitter.com/wolkenschauer)
Let me know what you think: [jan.rabe@kibotu.net](mailto:jan.rabe@kibotu.net)
Contributions welcome!
### License
Copyright 2019 Jan RabeLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.