GithubHelp home page GithubHelp logo

hellohudi / stepbar Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 2.0 15.56 MB

step-by-step that can control progress, support static and dynamic display

License: Apache License 2.0

Kotlin 1.12% Java 98.88%
view step-by-step progress

stepbar's Introduction

StepBar

step-by-step that can control progress, support static and dynamic display

horizontal and vertical static effect

horizontal and vertical dynamic effect

How to use

add the dependency

dependencies {
    compile 'com.hd.stepbar:stepbar:1.4'
}

in xml

 <com.hd.stepbar.StepBar
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="horizontal"/>

StepBar extends LinearLayout,so,can be adjust the display direction by setting orientation attribute.

set horizontal show or vertical show:
//int xml 
android:orientation="horizontal | vertical" 

//or use code
StepBar.setOrientation(LinearLayout.HORIZONTAL | LinearLayout.VERTICAL);

code (main code)

StepBarConfig config = new StepBarConfig();
config.setBeanList(LinkedList<StepBarBean> beanList);
StepBar.addConfig(config);

StepBarBean:

StepBarBean bean = new StepBarBean.Builder(getActivity())
                  .setState(StepBarConfig.StepSate.COMPLETED)
                  .setRunningIcon(ContextCompat.getDrawable(getActivity(), R.drawable.running))
                  .setWaitingIcon(ContextCompat.getDrawable(getActivity(), R.drawable.waiting))
                  .setCompletedIcon(ContextCompat.getDrawable(getActivity(), R.drawable.complete))
                  .setFailedIcon(ContextCompat.getDrawable(getActivity(), R.drawable.fail))
                  .setOutsideIconRingForegroundColor(Color.RED)
                  .setOutsideIconRingBackgroundColor(Color.parseColor("#EEEE00"))
                  .setConnectLineColor(Color.WHITE)
                  .setRunningTextColor(Color.YELLOW)
                  .setCompletedTextColor(Color.GREEN)
                  .setWaitingTextColor(Color.DKGRAY)
                  .setFailedTextColor(Color.RED)
                  .setCompletedText("completed text")
                  .setRunningText("running text")
                  .setWaitingText("waiting text")
                  .setFailedText("failed text")
                  .build();

StepBarConfig:

StepBarConfig config = new StepBarConfig()
                      .setBeanList(LinkedList<StepBarBean> beanList)
                      //if the value is not set, the icon will be automatically resized in the allowable range
                      .setIconCircleRadius()
                      //if the value is not set, then will be adjust automatically
                      .setOutsideIconRingWidth()
                      //set the text size in pixel units
                      .setTextSize()
                      //set StepBar show state
                      .setShowState(StepBarConfig.StepShowState.DYNAMIC)
                      //add progress control call back
                      .addStepCallback(StepBarConfig.StepCallback);

using mobile browser scan the QRcode to download demo

stepbar's People

Contributors

hellohudi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

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