TimeLineView
A simple Timeline View that demonstrates the power of ConstraintLayout and RecyclerView. No drawing, just plug in and play.
Quick Setup
1. Include library
Using Gradle
TimelineView is currently available in on Jitpack so add the following line before every other thing if you have not done that already.
Then add the following line
Using Maven
Also add the following lines before adding the maven dependency
Then add the dependency
2. Usage
In your XML layout include the TimelineView as follows:
Then in your Kotlin code, do the following:
Create a class that extends TimeLine
TimeLine has three Statuses:
- Status.COMPLETED
- Status.UN_COMPLETED
- Status.ATTENTION
You can choose from any of the statuses depending on the status of the item you want to represent.
Create an Array of your TimeLine
Create the IndicatorAdapter and add it to the TimeLineView
IndicatorAdapter
This extends RecyclerView.Adapter and exposes the following functions:
- Swaps the old items with the new items
- Update a single item given the index
- Adds a list of items to the list starting from the given index