How to implement an android delivery tracker using

2019-09-22 09:03发布

问题:

I want a similar progress bar tracker like shown in the pic below for an android delivery app.

See this

回答1:

Try Timeline-View

In XML

<com.github.vipulasri.timelineview.TimelineView
android:id="@+id/time_marker"
android:layout_width="wrap_content"
android:layout_height="match_parent"
app:markerSize="20dp"
app:lineSize="2dp"
app:line="@color/colorPrimary"
app:linePadding="5dp"/>

RecyclerView Holder

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

    public TimeLineViewHolder(View itemView, int viewType) {
        super(itemView);
        mTimelineView = (TimelineView) itemView.findViewById(R.id.time_marker);
        mTimelineView.initLine(viewType);
    }
}

For full implementation look at this