Git Product home page Git Product logo

zzhorizontalprogressbar's Introduction

ZzHorizontalProgressBar

A Horizontal ProgressBar that is customized easily.

Github地址:https://github.com/zhouzhuo810/ZzHorizontalProgressBar

功能简介: 1.支持自定义进度颜色; 2.支持自定义背景颜色; 3.支持自定义背景与进度之间的内间距大小; 4.支持自定义最大值和默认进度值。

与系统控件相比的优势:属性配置更简单、大小适配更方便。

Gradle:

compile 'me.zhouzhuo.zzhorizontalprogressbar:zz-horizontal-progressbar:1.0.0'

Maven:

<dependency>
  <groupId>me.zhouzhuo.zzhorizontalprogressbar</groupId>
  <artifactId>zz-horizontal-progressbar</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

What does it look like?

这里写图片描述

How to use it ?

1.xml

    <me.zhouzhuo.zzhorizontalprogressbar.ZzHorizontalProgressBar
        android:id="@+id/pb"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        app:zpb_padding="0dp"
        app:zpb_pb_color="@android:color/holo_green_dark"
        app:zpb_bg_color="@android:color/holo_blue_bright"
        app:zpb_max="100"
        app:zpb_progress="30"
        />

2.java

        final ZzHorizontalProgressBar pb = (ZzHorizontalProgressBar) findViewById(R.id.pb);

		//set progress value
        pb.setProgress(progress);

		//set padding
        pb.setPadding(0);		

		//set bacground color
        pb.setBgColor(Color.RED);

		//set progress color
        pb.setProgressColor(Color.BLUE);

		//set max value
        pb.setMax(100);		

属性说明:

属性 作用 类型
zpb_padding 背景与进度之间的内间距大小 dimension
zpb_bg_color 背景颜色 color
zpb_pb_color 进度颜色 color
zpb_max 进度最大值 int
zpb_progress 默认进度值 int

zzhorizontalprogressbar's People

Watchers

James Cloos avatar maoqisheng 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.