Giter Site home page Giter Site logo

ericacx / timelineview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wrbug/timelineview

0.0 2.0 0.0 13.17 MB

一款仿外卖订单状态的开源控件,支持自定义文字,颜色,字体大小等功能

License: Apache License 2.0

Java 100.00%

timelineview's Introduction

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

timelineview's People

Contributors

wrbug avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.