项目作者: chilijung

项目描述 :
A more complete version of stepsViews in android
高级语言: Java
项目地址: git://github.com/chilijung/android-stepsview.git
创建时间: 2017-06-13T10:37:10Z
项目社区:https://github.com/chilijung/android-stepsview

开源协议:Apache License 2.0

下载


Android-stepsView

Release

A more complete version of android stepsView library.

Demo

Install

add your build.grade:

  1. allprojects {
  2. repositories {
  3. jcenter()
  4. maven { url "https://jitpack.io" }
  5. }
  6. }
  7. dependencies {
  8. compile 'com.github.canner:android-stepsview:<VERSION>'
  9. }

Usage

layout.xml

  1. <io.canner.stepsview.StepsView
  2. android:id="@+id/stepsView"
  3. android:layout_width="match_parent"
  4. android:layout_height="wrap_content"
  5. ></io.canner.stepsview.StepsView>

you could also set options using chain methods

  1. StepsView mStepsView = (StepsView) findViewById(R.id.stepview);
  2. mStepsView.setLabels(steps)
  3. .setBarColorIndicator(getContext().getResources().getColor(R.color.material_blue_grey_800))
  4. .setProgressColorIndicator(getContext().getResources().getColor(R.color.orange))
  5. .setLabelColorIndicator(getContext().getResources().getColor(R.color.orange))
  6. .setCompletedPosition(0)
  7. .drawView();

Setup options in layout

  1. <io.canner.stepsview.StepsView
  2. xmlns:custom="http://schemas.android.com/apk/res-auto"
  3. android:layout_width="match_parent"
  4. android:layout_height="wrap_content"
  5. custom:labels="@array/labels2" <====== set labels
  6. custom:labelSize="20" <================ set label size
  7. custom:numOfSteps="5" <================ set steps
  8. custom:circleRadius="40" <============= set radius
  9. custom:progressMargin="150" <========== set margin
  10. custom:completePosition="2" <========== set complete position
  11. custom:barColor="@color/orange" <====== set bar color
  12. custom:labelColor="@color/red" <======= set label color
  13. custom:progressColor="@color/blue" <=== set progress color
  14. custom:progressTextColor="@color/black" <= set progress text color
  15. style="@style/stepsView"
  16. ></io.canner.stepsview.StepsView>

Options

setting up stepviews we use chain methods such as example above. And here is more.

setLabels(String[] labels)

set labels

setBarColorIndicator(int ResId)

set bar color

setProgressColorIndicator(int ResId)

set progress color

setLabelColorIndicator(int ResId)

set label color

setCompletePosition(int pos)

set complete step position

setLabelTextSize(float size)

set label size

setProgressStrokeWidth(float width)

set the stroke width in between step progress.

setProgressMargins(float margin)

set margins of the view

setCircleRadius(float radius)

set the steps’ radius.

setProgressTextColor(int textColor)

set text color in the step.

hideProgressText(boolean hide)

hide the text in the progress.

Improvements

the original version is https://github.com/anton46/Android-StepsView with many improvements.

  • more concise text position and progress bar position
  • make labels align to center
  • add number in progress
  • add more customize options
  • support syntax in xml layout

License

Apache 2.0