Coder Social home page Coder Social logo

android-stepsview-1's Introduction

Android-stepsView

Release

A more complete version of android stepsView library.

Demo

Install

add your build.grade:

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}
dependencies {
    compile 'com.github.canner:android-stepsview:<VERSION>'
}

Usage

layout.xml

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

you could also set options using chain methods

StepsView mStepsView = (StepsView) findViewById(R.id.stepview);

mStepsView.setLabels(steps)
        .setBarColorIndicator(getContext().getResources().getColor(R.color.material_blue_grey_800))
        .setProgressColorIndicator(getContext().getResources().getColor(R.color.orange))
        .setLabelColorIndicator(getContext().getResources().getColor(R.color.orange))
        .setCompletedPosition(0)
        .drawView();

Setup options in layout

<io.canner.stepsview.StepsView
    xmlns:custom="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    custom:labels="@array/labels2"      <====== set labels
    custom:labelSize="20"     <================ set label size
    custom:numOfSteps="5"     <================ set steps
    custom:circleRadius="40"     <============= set radius
    custom:progressMargin="150"     <========== set margin
    custom:completePosition="2"     <========== set complete position
    custom:barColor="@color/orange"     <====== set bar color
    custom:labelColor="@color/red"     <======= set label color
    custom:progressColor="@color/blue"     <=== set progress color
    custom:progressTextColor="@color/black"  <= set progress text color
    style="@style/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

android-stepsview-1's People

Contributors

chilijung avatar

Watchers

 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.