A copy of the takeout order status open source control, support custom text, color, font size and other functions

According to the effect

USAGE

Gradle

The compile 'com. Wrbug: timelineview: 1.0.0'Copy the code

Maven

< the dependency > < groupId > com. Wrbug < / groupId > < artifactId > timelineview < / artifactId > < version > 1.0.0 < / version > <type>pom</type> </dependency>Copy the code

Add to the layout

    <com.wrbug.opensources.TimeLineView
        android:id="@+id/timeLineView3"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_margin="20dp"
        app:preCircleColor="#0044ff"
        app:preLineColor="#333333"
        app:startedCircleColor="#880000"
        app:startedLineColor="#ff0000"
        app:textSize="12sp"/>Copy the code

The Activity to add

TimeLineView mView=(TimeLineView) findViewById(R.id.timeLineView3); List<String> data = new ArrayList<>(); Data.add (" waiting for payment "); Data.add (" waiting for orders "); Data.add (" waiting for delivery "); Data.add (" waiting for delivery "); mView.setPointStrings(data, 2);Copy the code

Add more Settings

TimeLineView mView=(TimeLineView) findViewById(R.id.timeLineView3); mView.builder() .pointStrings(txts, 1) .startedCircleColor(Color.BLUE) .underwayCircleColor(Color.BLUE) .preCircleColor(Color.GRAY) .startedLineColor(Color.BLUE) .preLineColor(Color.GRAY) .startedStringColor(Color.BLUE) .underwayStringColor(Color.BLUE)  .preStringColor(Color.GRAY) .load(); // Start drawingCopy the code

Method/field description

Methods/fields type instructions
pointStrings List/String[] State the text
textSize float Text size
preLineColor int Unstarted line color
startedLineColor int State line color has been carried out
preCircleColor int Unstarted state circle color
underwayCircleColor int Ongoing state circle color
startedCircleColor int State circle color has been carried out
preStringColor int Unstarted status text color
underwayStringColor int Ongoing state text color
startedStringColor int State text color has been carried out
radius int Circle radius
lineWidth float Line width

License

Copyright 2017, Yalantis

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.
Copy the code