Timeline View
June 13, 2020 · View on GitHub
Android view for timeline purpose. Ideally made for bank statement or sequential data, for example.

Usage
For a working implementation, please take a look at the sample
- Include library
// project/build.gradle
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
// app/build.gradle
dependencies {
implementation "com.github.anacoimbrag:timeline-view:$latest_version"
}
Add to your layout
It is very easy to use this lib, you just need to add <Timeline> tag in your XML layout or instantiate in your code using the default constructor Timeline(context).
<com.anacoimbra.android.timeline.Timeline
android:layout_width="wrap_content"
android:layout_height="100dp"
app:bulletIcon="@drawable/ic_expense"
app:bulletType="round"
app:linePadding="4dp" />
Timeline Attributes
| Attribute | Type | Default | Setter |
|---|---|---|---|
bulletIcon | drawable | - | setIconTint(@DrawableRes Int) |
bulletIconTint | color | - | setIconTint(colorStateList) setIconTint(@ColorRes Int) |
bulletSize | dimension | 30dp | setBulletSize(@DimenRes Int) |
bulletIconPadding | dimension | 4dp | setIconPadding(@DimenRes Int) |
bulletCornerRadius1 | dimension | 6dp | setBulletCornerRadius(@DimenRes Int) |
bulletBackground | color | drawable | primaryColor #7E57C2 | setBulletBackground(@ColorRes Int) setBulletBackground(@DrawableRes Int) |
bulletType | BulletType | round | bulletType = BulletType.ROUND |
bulletGravity | BulletGravity | center | bulletGravity = BulletGravity.CENTER |
lineWidth | dimension | 2dp | setLineWidth(@DimenRes Int) |
lineColor | color | colorAccent #B9B9B9 | setLineColorResource(@ColorRes Int) |
linePadding | dimension | 0dp | setLinePadding(@DimenRes Int) |
lineDashSize2 | dimension | 4dp | setLineDashSize(@DimenRes Int) |
lineDashGap3 | dimension | 4dp | setLineDashGap(@DimenRes Int) |
lineType | LineType | solid | lineType = LineType.SOLID |
lineVisibility | LineVisibility | both | lineVisibility = LineVisibility.CENTER |
BulletType
| Code | XML | |
|---|---|---|
BulletType.ICON | icon | |
BulletType.SQUARE | square | ![]() |
BulletType.CIRCLE | circle | ![]() |
BulletType.ROUND | round | ![]() |
BulletGravity
| Code | XML | |
|---|---|---|
BulletGravity.TOP | top | ![]() |
BulletGravity.CENTER | center | ![]() |
BulletGravity.BOTTOM | bottom | ![]() |
LineType
| Code | XML | |
|---|---|---|
LineType.SOLID | solid | ![]() |
LineType.DASHED | dashed | ![]() |
LineType.DOTTED | dotted | ![]() |
LineVisibility
| Code | XML | |
|---|---|---|
LineVisibility.BOTH | both | ![]() |
LineVisibility.TOP | top | ![]() |
LineVisibility.BOTTOM | bottom | ![]() |
LineVisibility.NONE | none | ![]() |
1 • Only works with BulletType round
2 • Only works with LineType dashed
3 • Only works with LineType dashed or dotted










