• Stars
    star
    3,774
  • Rank 11,084 (Top 0.3 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Android Timeline View is used to display views like Tracking of shipment/order, steppers etc.

Timeline-View

Android Timeline View Library (Using RecyclerView) is simple implementation used to display view like Tracking of shipment/order, steppers etc.

Specs

Maven Central License

Badges/Featured In

Timeline View Android Arsenal AndroidWeekly AndroidDev Digest

showcase

Sample Project

For information : checkout Example Screen Code in repository.

Download

TimelineView on Google Play

Quick Setup

1. Include library

Using Gradle

dependencies {
    implementation 'com.github.vipulasri:timelineview:1.1.5'
}

What's New

See the project's Releases page for a list of versions with their change logs.

If you Watch this repository, GitHub will send you an email every time I publish an update.

2. Usage

  • In XML Layout :
<com.github.vipulasri.timelineview.TimelineView
    android:id="@+id/timeline"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    app:markerSize="20dp"
    app:lineWidth="2dp"
    app:startLineColor="@color/colorPrimary"
    app:endLineColor="@color/colorPrimary"/>
Line Padding around marker
<com.github.vipulasri.timelineview.TimelineView
    android:id="@+id/timeline"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    app:markerSize="20dp"
    app:lineWidth="2dp"
    app:startLineColor="@color/colorPrimary"
    app:endLineColor="@color/colorPrimary"
    app:linePadding="5dp"/>
  • Configure using xml attributes or setters in code:

    Attribute Name Default Value Description
    app:marker="@drawable/marker" Green Colored Oval Drawable sets marker drawable
    app:markerSize="25dp" 25dp sets marker size
    app:markerInCenter="false" true sets the marker in center of line if `true`
    app:markerPaddingLeft="0dp" 0dp sets the marker left padding, applicable only with horizontal orientation
    app:markerPaddingTop="0dp" 0dp sets the marker top padding, applicable only with vertical orientation
    app:markerPaddingRight="0dp" 0dp sets the marker right padding, applicable only with horizontal orientation
    app:markerPaddingBottom="0dp" 0dp sets the marker bottom padding, applicable only with vertical orientation
    app:startLineColor="@color/primarColor" Dark Grey Line sets start line color
    app:endLineColor="@color/primarColor" Dark Grey Line sets end line color
    app:lineWidth="2dp" 2dp sets line width
    app:lineOrientation="horizontal" vertical sets orientation of line ie `horizontal` or `vertical`
    app:linePadding="5dp" 0dp sets line padding around marker
    app:lineStyle="dash" normal sets line style ie `normal` or `dashed`
    app:lineStyleDashGap="4dp" 4dp sets line dash gap
    app:lineStyleDashLength="8dp" 8dp sets line dash length
  • RecyclerView Holder : Your RecyclerViewHolder should have an extra parameter in constructor i.e viewType from onCreateViewHolder. You would also have to call the method initLine(viewType) in constructor definition.

    public class TimeLineViewHolder extends RecyclerView.ViewHolder {
        public  TimelineView mTimelineView;

        public TimeLineViewHolder(View itemView, int viewType) {
            super(itemView);
            mTimelineView = (TimelineView) itemView.findViewById(R.id.timeline);
            mTimelineView.initLine(viewType);
        }
    }
  • RecyclerView Adapter : override getItemViewType method in Adapter
    @Override
    public int getItemViewType(int position) {
        return TimelineView.getTimeLineViewType(position, getItemCount());
    }

And pass the viewType from onCreateViewHolder to its Holder.

    @Override
    public TimeLineViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = View.inflate(parent.getContext(), R.layout.item_timeline, null);
        return new TimeLineViewHolder(view, viewType);
    }

Apps that use this library

If you're using this library in your app and you'd like to list it here, Please let me know via email, pull requests or issues.

Apps using Timeline-View, via AppBrain Stats

License

Copyright 2018 Vipul Asri

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More Repositories

1

TicketView

An Android library to implement TicketView in android with normal, rounded and scallop corners
Java
1,283
star
2

JetInstagram

JetInstagram is an Instagram UI clone app built with Jetpack Compose.
Kotlin
748
star
3

JetDelivery

JetDelivery is a sample food delivery app, built with Jetpack Compose
Kotlin
367
star
4

ComposeSlackDesktop

A Slack demo app for desktop using Jetpack Compose UI toolkit
Kotlin
279
star
5

flutter_bubble_tab_indicator

A Flutter library to add bubble tab indicator to TabBar
Dart
189
star
6

Layout-to-Image

Android Layout (Relative Layout, Linear Layout etc) to Image
Java
165
star
7

Serene

Serene is a white noise app developed with Flutter. It helps you meditate, sleep better, focus, relax and be calm.
Dart
97
star
8

Multiple-Backstack-Navigation

Handling multiple backstack histories for each tab in Bottom Navigation using Navigation Component.
Kotlin
63
star
9

Toolbar-Elevation-Pre-Lollipop

Toolbar Elevation on Pre-lollipop devices
54
star
10

Artisto_capstone

This is Capstone Project of Android Developer Nanodegree program.
Java
36
star
11

Udacity-Popular-Movies

This is an android app which I made from scratch as a part of Android Developer Nanodegree program.
Java
33
star
12

LocationUpdates

A service running in background gives location updates and displays a notification.
Java
32
star
13

PuppyCo

Kotlin
4
star
14

Staggered-View-Native-Advanced-Ads

Native Advanced Ads implementation in Staggered RecyclerView
Java
4
star
15

Posty

A sample app that showcases the use of the latest technologies following MVVM with Clean Architecture.
Kotlin
4
star
16

Expense-Manager

Kotlin
3
star
17

BintrayHelper

2
star
18

XYZ-Reader

Java
1
star
19

Streamer

Kotlin
1
star
20

vipulasri

1
star
21

Pelm

Kotlin
1
star
22

Build-It-Bigger

Build It Bigger is a joke telling app having free & paid version and configured with google cloud endpoints.
Java
1
star
23

Inshorts-Challenge

This code was developed for Inshorts Android App Development Hiring Challenge on HackerEarth.
Java
1
star
24

Bottom-Navigation-View-Sample

Its Bottom Navigation View Sample introduced in Android Support Library v25.0.0
Java
1
star