RoomPager is 4-directional recycle pager view for create shortform video platform like youtube shorts and reels.
implementation("com.github.DYGames:roompager:1.0.3@aar")
You can use it by implementing an Adapter and a ViewHolder, just like Android RecyclerView (not exactly the same. sry)
app module of this repository contains sample usage of this
classDiagram
RoomPager *-- VerticalScrollPager
VerticalScrollPager *-- HorizontalScrollPager
HorizontalScrollPager *-- RoomRecycler
RoomRecycler "1" *-- "n" RoomPlayer
ScrollPager <|-- VerticalScrollPager
ScrollPager <|-- HorizontalScrollPager
RoomPlayer <|-- YoutubeRoomPlayer
- calls when RoomPager is initialized. adpater should provide viewholder instance
- adpater should returns number of item in data set
- calls when recycling is done (user scrolled). usually adapter play/pause video player here.
- load next room (video) data from server/local. you can update adapter's data set here.
- define each View on RoomPager (usually full-screen video player)