Skip to content
Cute timeline view for android
Branch: master
Clone or download
Latest commit a592328 Feb 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Fix none status Feb 12, 2019
config
gradle/wrapper
scripts
timeline Update to RC2 Feb 12, 2019
.gitignore Update buildToolsVersion Jan 26, 2016
.travis.yml
LICENSE updates Feb 17, 2016
README.md Add badges Jan 25, 2019
build.gradle Update bintray config Jan 25, 2019
gradle.properties
gradlew
gradlew.bat first commit Apr 6, 2014
screenshot.png Update README.md Jan 26, 2016
settings.gradle

README.md

TimelineView

Codacy Badge Download Build Status

This library provide android View to add Timeline to your application.

image

Download

Via gradle:

dependencies {
	compile 'com.github.alorma:timelineview:2.3.0'
}

Usage

Add View to your layout

<Layout 
    xmlns:app="http://schemas.android.com/apk/res-auto">
...
<com.alorma.timeline.RoundTimelineView
	android:id="@+id/timeline1"
   	android:layout_width="?android:listPreferredItemHeight"
   	android:layout_height="?android:listPreferredItemHeight"
   	app:timeline_indicatorSize="20dp"
   	app:timeline_lineStyle="linear"
   	app:timeline_type="middle"/>
...
</Layout>

Or

<Layout 
    xmlns:app="http://schemas.android.com/apk/res-auto">
...
<com.alorma.timeline.SquareTimelineView
	android:id="@+id/timeline1"
   	android:layout_width="?android:listPreferredItemHeight"
   	android:layout_height="?android:listPreferredItemHeight"
   	app:timeline_indicatorSize="20dp"
   	app:timeline_lineStyle="linear"
   	app:timeline_type="middle"/>
...
</Layout>

Custom attributes

Line

Attr name Attr format Example
timeline_lineWidth dimension 20dp
timeline_lineColor color @color/red / #FF0000
timeline_lineStyle enum dashed / linear
timeline_type enum hidden / start / middle / line / end

Indicator

Attr name Attr format Example
timeline_indicatorSize dimension 20dp
timeline_indicatorColor color @color/red / #FF0000
timeline_alignment enum start / middle / end
timeline_drawInternal boolean true / false
timeline_internalColor color @color/red / #FF0000
timeline_internalDrawable reference @drawable / @color
timeline_internalPadding dimension 20dp

Advanced - Custom shape

If you want to create a new shape for indicator (like a diamond), you can! Just extends TimelineView and implement the following methods:

protected abstract void drawIndicator(Canvas canvas, Paint paintStart, float centerX,
	float centerY, float size);
protected abstract void drawInternal(Canvas canvas, Paint paintInternal, float centerX,
	float centerY, float size);
protected abstract void drawBitmap(Canvas canvas, float left, float top, int size);

Contributors

License

TimelineView by Bernat Borras is licensed under a Apache License 2.0.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.