parallaxdecoration

A special item decoration for recyclerView, it can display any bitmaps by looper as background of recyclerView. The bitmaps of background can opt to be scrolled within this recyclerView in a parallax fashion.

License

License

GroupId

GroupId

io.github.seagazer
ArtifactId

ArtifactId

parallaxdecoration
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

aar
Description

Description

parallaxdecoration
A special item decoration for recyclerView, it can display any bitmaps by looper as background of recyclerView. The bitmaps of background can opt to be scrolled within this recyclerView in a parallax fashion.
Project URL

Project URL

https://github.com/seagazer

Download parallaxdecoration

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.seagazer/parallaxdecoration/ -->
<dependency>
    <groupId>io.github.seagazer</groupId>
    <artifactId>parallaxdecoration</artifactId>
    <version>1.0.1</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/io.github.seagazer/parallaxdecoration/
implementation 'io.github.seagazer:parallaxdecoration:1.0.1'
// https://jarcasting.com/artifacts/io.github.seagazer/parallaxdecoration/
implementation ("io.github.seagazer:parallaxdecoration:1.0.1")
'io.github.seagazer:parallaxdecoration:aar:1.0.1'
<dependency org="io.github.seagazer" name="parallaxdecoration" rev="1.0.1">
  <artifact name="parallaxdecoration" type="aar" />
</dependency>
@Grapes(
@Grab(group='io.github.seagazer', module='parallaxdecoration', version='1.0.1')
)
libraryDependencies += "io.github.seagazer" % "parallaxdecoration" % "1.0.1"
[io.github.seagazer/parallaxdecoration "1.0.1"]

Dependencies

compile (5)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-android-extensions-runtime jar 1.4.10
» unspecified jar
org.jetbrains.kotlin : kotlin-stdlib jar 1.4.10
androidx.core » core-ktx jar 1.3.2
androidx.appcompat » appcompat jar 1.2.0

Project Modules

There are no modules declared in this project.

parallaxdecoration

  • A special item decoration for recyclerView, it can display any bitmaps by looper as background of recyclerView. The bitmaps of background can opt to be scrolled within this recyclerView in a parallax fashion.

  • How to use:

// step1. add config in build.gradle of the root project
allprojects {
    repositories {
        maven { url 'https://www.jitpack.io' }
        google()
        jcenter()
    }
}

// step2. add the library in your app module
implementation 'com.github.seagazer:parallaxdecoration:latestVersion'

// step3. create a parallaxdecoration for your recyclerView
private val bgs = intArrayOf(
    R.drawable.rd_gua_seed_1, R.drawable.rd_gua_seed_2, R.drawable.rd_gua_seed_3
)

val parallaxItemDecoration = ParallaxDecoration(context).apply {
        setupResource(bgs.asList())// init the bitmaps of background
        parallax = 0.3f// set the parallax fashion(the range is [0,1])
        autoFill = true// set the bitmap auto scale to fill the size of recyclerView
    }
recycler_view.addItemDecoration(parallaxItemDecoration)
  • Example demo:

Versions

Version
1.0.1