Android開源:TimeLineView - 一款仿外賣訂單進度的開源控件
TimeLineView
一款仿外賣訂單狀態的開源控件,支持自定義文字,顏色,字體大小等功能
顯示效果
USAGE
Gradle
compile 'com.wrbug:timelineview:1.0.0'
Maven
<dependency> <groupId>com.wrbug</groupId> <artifactId>timelineview</artifactId> <version>1.0.0</version> <type>pom</type> </dependency>
布局中添加
<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"/>
Activity添加
TimeLineView mView=(TimeLineView) findViewById(R.id.timeLineView3); List<String> data = new ArrayList<>(); data.add("等候支付"); data.add("等候商家接單"); data.add("等候配送"); data.add("等候送達"); mView.setPointStrings(data, 2);
添加更多設置
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(); //開始繪制
方法/字段說明
方法/字段 | 類型 | 說明 |
---|---|---|
pointStrings | List/String[] | 狀態文本 |
textSize | float | 文本大小 |
preLineColor | int | 未開始狀態線條顏色 |
startedLineColor | int | 已進行狀態線條顏色 |
preCircleColor | int | 未開始狀態圓顏色 |
underwayCircleColor | int | 進行中狀態圓顏色 |
startedCircleColor | int | 已進行狀態圓顏色 |
preStringColor | int | 未開始狀態文本顏色 |
underwayStringColor | int | 進行中狀態文本顏色 |
startedStringColor | int | 已進行狀態文本顏色 |
radius | int | 圓半徑 |
lineWidth | float | 線條寬度 |
License
Copyright 2017, YalantisLicensed 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.</pre>
本文由用戶 EarVanatta 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!