anacoimbrag / timeline-view

Andrdoid view for timeline purpose. Ideally made for bank statement, sequential data, etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

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 #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 #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 Bullet Type Icon
BulletType.SQUARE square Bullet Type Square
BulletType.CIRCLE circle Bullet Type Circle
BulletType.ROUND round Bullet Type Round

BulletGravity

Code XML
BulletGravity.TOP top Bullet Gravity Top
BulletGravity.CENTER center Bullet Gravity Center
BulletGravity.BOTTOM bottom Bullet Gravity Bottom

LineType

Code XML
LineType.SOLID solid Line Type Solid
LineType.DASHED dashed Line Type Dashed
LineType.DOTTED dotted Line Type Dotted

LineVisibility

Code XML
LineVisibility.BOTH both Line Visiblity Both
LineVisibility.TOP top Line Visibility Top
LineVisibility.BOTTOM bottom Line Visibility Bottom
LineVisibility.NONE none Line Visibility None

1 • Only works with BulletType round

2 • Only works with LineType dashed

3 • Only works with LineType dashed or dotted

About

Andrdoid view for timeline purpose. Ideally made for bank statement, sequential data, etc.

License:Apache License 2.0


Languages

Language:Kotlin 100.0%