Skip to content

Instantly share code, notes, and snippets.

@sidhuparas
Created February 9, 2020 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sidhuparas/0fa91ce7c02acb8e7c9bd72ad30e01d3 to your computer and use it in GitHub Desktop.
Save sidhuparas/0fa91ce7c02acb8e7c9bd72ad30e01d3 to your computer and use it in GitHub Desktop.
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/storyModeRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent" />
val layoutManager =
CarouselLayoutManager(CarouselLayoutManager.HORIZONTAL, true)
layoutManager.setPostLayoutListener(CarouselZoomPostLayoutListener())
val list = listOf(
R.drawable.story_text,
R.drawable.story_camera,
R.drawable.story_video
)
storyModeAdapter.setItems(list)
storyModeRecyclerView.layoutManager = layoutManager
storyModeRecyclerView.setHasFixedSize(true)
storyModeRecyclerView.adapter = storyModeAdapter
storyModeRecyclerView.addOnScrollListener(CenterScrollListener())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment