Home

Awesome

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.

View Releases

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

2. Usage

<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"/>

    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);
        }
    }


    @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.