Created
February 9, 2020 09:46
-
-
Save sidhuparas/0fa91ce7c02acb8e7c9bd72ad30e01d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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