Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1.27 KB

README.md

File metadata and controls

46 lines (33 loc) · 1.27 KB

SimpleCarousel for Android

SimpleCarousel is an Android library contains components for carousel UI.

Installation

Add following dependency to download this library:

dependencies {
    implementation("com.cheonjaeung.simplecarousel.android:simplecarousel:<version>")
}

Getting Started

You can just set the CarouselLayoutManager to make your RecyclerView work as a carousel. It can be set programmatically or as a XML attribute.

<androidx.recyclerview.widget.RecyclerView
    android:id="@+id/recyclerView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layoutManager="com.cheonjaeung.simplecarousel.android.CarouselLayoutManager" />
val recyclerView = findViewById<RecyclerView>(R.id.recyclerView)
recyclerView.layoutManager = CarouselLayoutManager()

There is circular mode in the CarouselLayoutManager, enabled as default. When it is enabled, the layout manager places first/last item next to last/first item. You can set circular programmatically.

val layoutManager = CarouselLayoutManager()
layoutManager.circular = true|false

License

Copyright 2024 Cheon Jaeung.

SimpleCarousel is licensed under the Apache License 2.0. See license for more details.