Home

Awesome

Timeline View

Deploy Min SDK codecov

Android view for timeline purpose. Ideally made for bank statement or sequential data, for example.

Timeline Sample

Usage

For a working implementation, please take a look at the sample

  1. Include library
// project/build.gradle
allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}
// app/build.gradle
dependencies {
    implementation "com.github.anacoimbrag:timeline-view:$latest_version"
}

Latest version is

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

AttributeTypeDefaultSetter
bulletIcondrawable-setIconTint(@DrawableRes Int)
bulletIconTintcolor-setIconTint(colorStateList) <br/> setIconTint(@ColorRes Int)
bulletSizedimension30dpsetBulletSize(@DimenRes Int)
bulletIconPaddingdimension4dpsetIconPadding(@DimenRes Int)
bulletCornerRadius<sup>1</sup>dimension6dpsetBulletCornerRadius(@DimenRes Int)
bulletBackgroundcolor | drawableprimaryColor <br/> #7E57C2 #7E57C2setBulletBackground(@ColorRes Int) <br/> setBulletBackground(@DrawableRes Int)
bulletTypeBulletTyperoundbulletType = BulletType.ROUND
bulletGravityBulletGravitycenterbulletGravity = BulletGravity.CENTER
lineWidthdimension2dpsetLineWidth(@DimenRes Int)
lineColorcolorcolorAccent <br/>#B9B9B9 #B9B9B9setLineColorResource(@ColorRes Int)
linePaddingdimension0dpsetLinePadding(@DimenRes Int)
lineDashSize<sup>2</sup>dimension4dpsetLineDashSize(@DimenRes Int)
lineDashGap<sup>3</sup>dimension4dpsetLineDashGap(@DimenRes Int)
lineTypeLineTypesolidlineType = LineType.SOLID
lineVisibilityLineVisibilitybothlineVisibility = LineVisibility.CENTER

BulletType

CodeXML
BulletType.ICONiconBullet Type Icon
BulletType.SQUAREsquareBullet Type Square
BulletType.CIRCLEcircleBullet Type Circle
BulletType.ROUNDroundBullet Type Round

BulletGravity

CodeXML
BulletGravity.TOPtopBullet Gravity Top
BulletGravity.CENTERcenterBullet Gravity Center
BulletGravity.BOTTOMbottomBullet Gravity Bottom

LineType

CodeXML
LineType.SOLIDsolidLine Type Solid
LineType.DASHEDdashedLine Type Dashed
LineType.DOTTEDdottedLine Type Dotted

LineVisibility

CodeXML
LineVisibility.BOTHbothLine Visiblity Both
LineVisibility.TOPtopLine Visibility Top
LineVisibility.BOTTOMbottomLine Visibility Bottom
LineVisibility.NONEnoneLine Visibility None

<sup>1 • Only works with BulletType round</sup>

<sup>2 • Only works with LineType dashed</sup>

<sup>3 • Only works with LineType dashed or dotted</sup>