A beautiful, slim Android ProgressBar.

Overview

Android NumberProgressBar Build Status

Insight.io

The NumberProgressBar is a bar, slim and sexy (every man wants! ).

I decided to do this because I was really tired of android original progress bar. So, I made some change, added more color style for this.

And also you can contribute more color style, or new idea to me.

BTW. My friends also made some other platform's NumberProgressBar:


Demo

NumberProgressBar

Download Demo

Usage


Gradle

dependencies {
   compile 'com.daimajia.numberprogressbar:library:1.4@aar'
}

Maven

<dependency>
    <groupId>com.daimajia.numberprogressbar</groupId>
    <artifactId>library</artifactId>
    <version>1.4</version>
    <type>apklib</type>
</dependency>

Use it in your own code:

	<com.daimajia.numberprogressbar.NumberProgressBar
		android:id="@+id/number_progress_bar"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
	/>

I made some predesign style. You can use them via style property.

Preset color

Use the preset style just like below:

	<com.daimajia.numberprogressbar.NumberProgressBar
		android:id="@+id/number_progress_bar"
		style="@style/NumberProgressBar_Default"
	/>

In the above picture, the style is :

NumberProgressBar_Default NumberProgressBar_Passing_Green NumberProgressBar_Relax_Blue NumberProgressBar_Grace_Yellow NumberProgressBar_Warning_Red NumberProgressBar_Funny_Orange NumberProgressBar_Beauty_Red NumberProgressBar_Twinkle_Night

You can get more beautiful color from kular, and you can also contribute your color style to NumberProgressBar!

Build

run ./gradlew assembleDebug (Mac/Linux)

or

run gradlew.bat assembleDebug (Windows)

Attributes

There are several attributes you can set:

The reached area and unreached area:

  • color
  • height

The text area:

  • color
  • text size
  • visibility
  • distance between reached area and unreached area

The bar:

  • max progress
  • current progress

for example, the default style:

	<com.daimajia.numberprogressbar.NumberProgressBar
	        android:layout_width="wrap_content"
	        android:layout_height="wrap_content"
	        
	        custom:progress_unreached_color="#CCCCCC"
	        custom:progress_reached_color="#3498DB"
	        
	        custom:progress_unreached_bar_height="0.75dp"
	        custom:progress_reached_bar_height="1.5dp"
	        
	        custom:progress_text_size="10sp"
	        custom:progress_text_color="#3498DB"
	        custom:progress_text_offset="1dp"
	        custom:progress_text_visibility="visible"
	        
	        custom:progress_max="100"
	        custom:progress_current="80"
	         />

About me:

A student in China mainland, I like Google, like Android, like open source, like doing something interesting. :)

If you have some new idea or internship opportunity, please email me !

Comments
  • Attributes not work?

    Attributes not work?

    Hi!

    <com.daimajia.numberprogressbar.NumberProgressBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
    
            custom:progress_unreached_bar_height="4dp"
            custom:progress_reached_bar_height="8dp"
    
            custom:max="100"
            custom:progress="80"
             />
    

    Unfortunately the height of the bar does not change. Is this a bug?

    opened by crysan 30
  •  java.lang.NoSuchFieldError: com.daimajia.numberprogressbar.R$attr.numberProgressBarStyle

    java.lang.NoSuchFieldError: com.daimajia.numberprogressbar.R$attr.numberProgressBarStyle

    I've tried adding library to my project. I am facing some problem, I clicked 'Syns now', and I also downloaded library locally and added it to project, and ... I've tried every thing but I still got this error, any advice ?

        09-07 02:03:34.091    2976-2976/com.ghaleh.minifc E/AndroidRuntime﹕ FATAL EXCEPTION: main
        java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ghaleh.minifc/com.ghaleh.minifc.activities.MainActivity}: android.view.InflateException: Binary XML file line #18: Error inflating class com.daimajia.numberprogressbar.NumberProgressBar
                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
                at android.app.ActivityThread.access$600(ActivityThread.java:123)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
                at android.os.Handler.dispatchMessage(Handler.java:99)
                at android.os.Looper.loop(Looper.java:137)
                at android.app.ActivityThread.main(ActivityThread.java:4424)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:511)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
                at dalvik.system.NativeStart.main(Native Method)
         Caused by: android.view.InflateException: Binary XML file line #18: Error inflating class com.daimajia.numberprogressbar.NumberProgressBar
                at android.view.LayoutInflater.createView(LayoutInflater.java:606)
                at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
                at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
                at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
                at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
                at com.ghaleh.minifc.activities.Drawer1.onCreateView(Drawer1.java:102)
                at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:828)
                at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1032)
                at android.app.BackStackRecord.run(BackStackRecord.java:622)
                at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1382)
                at android.app.Activity.performStart(Activity.java:4501)
                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1929)
                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
                at android.app.ActivityThread.access$600(ActivityThread.java:123)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
                at android.os.Handler.dispatchMessage(Handler.java:99)
                at android.os.Looper.loop(Looper.java:137)
                at android.app.ActivityThread.main(ActivityThread.java:4424)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:511)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
                at dalvik.system.NativeStart.main(Native Method)
         Caused by: java.lang.reflect.InvocationTargetException
                at java.lang.reflect.Constructor.constructNative(Native Method)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
                at android.view.LayoutInflater.createView(LayoutInflater.java:586)
                at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
                at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
                at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
                at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
                at com.ghaleh.minifc.activities.Drawer1.onCreateView(Drawer1.java:102)
                at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:828)
                at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1032)
                at android.app.BackStackRecord.run(BackStackRecord.java:622)
                at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1382)
                at android.app.Activity.performStart(Activity.java:4501)
                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1929)
                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
                at android.app.ActivityThread.access$600(ActivityThread.java:123)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
                at android.os.Handler.dispatchMessage(Handler.java:99)
                at android.os.Looper.loop(Looper.java:137)
                at android.app.ActivityThread.main(ActivityThread.java:4424)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:511)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
                at dalvik.system.NativeStart.main(Native Method)
         Caused by: java.lang.NoSuchFieldError: com.daimajia.numberprogressbar.R$attr.numberProgressBarStyle
                at com.daimajia.numberprogressbar.NumberProgressBar.<init>(NumberProgressBar.java:167)
                at java.lang.reflect.Constructor.constructNative(Native Method)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
                at android.view.LayoutInflater.createView(LayoutInflater.java:586)
                at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
                at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
                at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
                at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
                at com.ghaleh.minifc.activities.Drawer1.onCreateView(Drawer1.java:102)
                at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:828)
                at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1032)
                at android.app.BackStackRecord.run(BackStackRecord.java:622)
                at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1382)
                at android.app.Activity.performStart(Activity.java:4501)
                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1929)
                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
                at android.app.ActivityThread.access$600(ActivityThread.java:123)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
                at android.os.Handler.dispatchMessage(Handler.java:99)
                at android.os.Looper.loop(Looper.java:137)
                at android.app.ActivityThread.main(ActivityThread.java:4424)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:511)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
                at dalvik.system.NativeStart.main(Native Method)'
    
    opened by Reza-Rg 25
  • Attributes already defined

    Attributes already defined

    When using NumberProgressBar library with MaterialDesign library, this error popups up

    Error:(1) Attribute "progress" has already been defined Error:(1) Attribute "max" has already been defined

    It is recomended to have prefixes as explained here https://code.google.com/p/android/issues/detail?id=22576

    opened by willylatorre 5
  • Not Working with ButterKnifeZelezny

    Not Working with ButterKnifeZelezny

    I try to bind the control to butterKnief through annotation is not binding @BindView(R.id.NmumberProgressBar) NumberProgressBar bn;

    Overide Oncreate bn(this);

    and it throw null error argument Any Suggesting Please

    opened by segunmicheal27 4
  • I can't use the method

    I can't use the method "setOnProgressBarListener"

    Excusme!daimajia. I hava a issue that I cant use the method 'setOnProgressBarListener'. image and I can't import the package : image can you tell me how to use this method? my email adress is [email protected].

    opened by lihongxiangleo 4
  • Cannot compile project against 1.3 release - proguard issue

    Cannot compile project against 1.3 release - proguard issue

    Warning:Exception while processing task java.io.IOException: proguard.ParseException: Expecting java type before ';' in line 18 of file '/Users/alex/Projects/myproject/app/build/intermediates/exploded-aar/com.daimajia.numberprogressbar/library/1.3/proguard.txt'
    

    Looks like instead of

    -keep interface com.daimajia.numberprogressbar.* { *; }
    

    should be

    -keep interface com.daimajia.numberprogressbar.** { ; }
    
    opened by alexeyvasilyev 2
  • no OnProgressBarListener

    no OnProgressBarListener

    I add below to build.gradle compile 'com.daimajia.numberprogressbar:library:1.2@aar'

    however, when to build, there's no progress_max and progress_current attribute and can not reach to OnProgressBarListener.

    when I go to NumberProgressBar.java, it is different from what I can see in this repository.

    May I get any help? is it matter of different version?

    opened by jy617lee 2
  • 描述中的例子和资源定义不一致

    描述中的例子和资源定义不一致

    例子中:
    custom:progress_max="100" custom:progress_curent="80"

    declare-styleable中: name="progress" format="integer" name="max" format="integer"

    opened by GKerison 2
  • Can't use setUnreachedBarColor

    Can't use setUnreachedBarColor

    Hello, there.

    First of all, awesome library, it works great ;)

    But I have a problem setting the unreached bar color, it doesn't work exactly as expected :

    private void initColors() {
        _progress.setReachedBarColor(getResources().getColor(R.color.blue));
        _progress.setUnreachedBarColor(getResources().getColor(R.color.white));
    }
    

    Here, the reached color is good, but the unreached color isn't white, but blue (as the reached color).

    And if we look at your code, we can see a little mistake :

    public void setUnreachedBarColor(int BarColor) {
        this.mUnreachedBarColor = BarColor;
        mUnreachedBarPaint.setColor(mReachedBarColor);
        invalidate();
    }
    

    In the setUnreachedBarColor function, you update mUnreachedBarColor, but you don't use it to color the unreached bar, you use mReachedBarColor.

    Hope you'll fix this soon ;)

    Android Studio 1.4 Grade : compile 'com.daimajia.numberprogressbar:library:1.2@aar'

    bug 
    opened by TCleard 2
  • Can't implement OnProgressBarListener

    Can't implement OnProgressBarListener

    Excuse Me I have a issue I can't implement OnProgressBarListener after import your library from gradle,Can tell me how to implement for fix the issue please sorry my english is bad [email protected]

    opened by AbhiratTermsirichit 2
  • Fails to Render in Android Studio

    Fails to Render in Android Studio

    When using the library as described, with the following XML: <com.daimajia.numberprogressbar.NumberProgressBar android:id="@+id/summary_card_monthly_progress" android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/NumberProgressBar_Default" />

    Android Studio gives the following Rendering error:

    Missing styles. Is the correct theme chosen for this layout? Use the Theme combo box above the layout to choose a different layout, or fix the theme style references. Failed to find style 'numberProgressBarStyle' in current theme (2 similar errors not shown)

    opened by BobG1983 2
  • How to set corner radius to progress reached area?

    How to set corner radius to progress reached area?

    Hi, I am using your library in my android application to show some progress bar. It is a wonderful library. I am expecting a function, How can I set a corner radius to progress reached area only? Is there any way I can do that? or can you suggest me a trick to do this? Thanks

    opened by waseem786 0
  • when i use it in Notification,it can't be inflated.

    when i use it in Notification,it can't be inflated.

    I want to use NumProgressBar to show progress in notification, it show an error: Couldn't inflate contentViewsandroid.view.InflateException: Binary XML file line #37: Binary XML file line #37: Error inflating class com.daimajia.numberprogressbar.NumberProgressBar

    opened by user8361 0
  • 当进度走到80%,为什么会变成-%79, - %78 .......

    当进度走到80%,为什么会变成-%79, - %78 .......

    myBody = new MyBody(requestBody, new MyBody.ProgressListener() { @Override public void onProgress(long currentBytes, long contentLength) { int current = new Long(currentBytes).intValue(); int total = new Long(contentLength).intValue(); if (seted) { numberProgressBar.setMax(total); //只设置一次最大值 seted = false; } numberProgress.setProgress(current); } }); mShow = builder.show();

    opened by roybill 1
Releases(v1.2)
Owner
代码家
Zhenfund Associate, bp [email protected]
代码家
Some beautiful android loading drawable, can be combined with any view as the LoadingView or the ProgressBar. Besides, some Drawable can customize the loading progress too.

LoadingDrawable: Android cool animation collection 前言 CircleRotate源码解析 Fish源码解析 LoadingDrawable is some android animations implement of drawable: a li

dinus_developer 4.1k Dec 27, 2022
Now deprecated. A small Android library allowing you to have a smooth and customizable horizontal indeterminate ProgressBar

Description Small library allowing you to make a smooth indeterminate progress bar. You can either user your progress bars and set this drawable or us

Antoine Merle 4.4k Dec 30, 2022
An android library to display a progressbar that goes around an image.

android-square-progressbar First things first This library is setup to work with the Android Studio and Gradle. If you're using the Eclipse environmen

Yannick Signer 1.3k Nov 15, 2022
Android ProgressBar that "bends" under its own weight. Inspired by http://drbl.in/nwih

RopeProgressBar Android ProgressBar that "bends" under its own weight. Attributes Attribute Type Default Usage app:ropeMax integer 0 The max value of

Christian De Angelis 206 Dec 18, 2022
Android library to realize the various states and transitions in a ProgressBar.

StateProgressBar StateProgressBar is an Android library to realize the various states and transitions in a ProgressBar. Quick Start Get a feel of how

Kofi Gyan 1.5k Jan 9, 2023
ArcProgressbar project let create Arc progressbar in android in simplest way.

Arc Progressbar In Android ArcProgressbar project let create Arc progressbar in android in simplest way. USAGE To make a Arc Progressbar add ArcProgre

Manish 40 Dec 11, 2022
Holo Circular ProgressBar

HoloCircularProgressBar What is HoloCircularProgressBar HoloCircularProgressBar is a Custom View implementation for Android you might know from the An

Pascal Welsch 957 Nov 15, 2022
MaterialLoadingProgressBar provide a styled ProgressBar which looks like SwipeRefreshLayout's loading indicator(support-v4 v21+)

MaterialLoadingProgressBar MaterialLoadingProgressBar provide a styled ProgressBar which looks like SwipeRefreshLayout's loading indicator(support-v4

lsjwzh 1.1k Nov 19, 2022
Progressbar with whorl style

WhorlView 一个加载View 预览 使用 step1 添加gradle配置 dependencies { compile 'com.tt:whorlviewlibrary:1.0.3' } step2 在xml中添加WhorlView <com.tt.whorlviewli

AndroidKy 409 Dec 3, 2022
Material Design ProgressBar with consistent appearance

MaterialProgressBar Material Design ProgressBar with consistent appearance on Android 4.0+. Why MaterialProgressBar? Consistent appearance on Android

Hai Zhang 2.2k Jan 1, 2023
This is beautiful color arc progress bar.

ColorArcProgressBar 中文版 This is a customizable circular progressbar.It can achieve the effect of the QQ health's arc progress with XML. What's more, w

PASSION 928 Dec 6, 2022
Beautiful progress bar with segments. Highly customizable. Fully written with Jetpack Compose

?? SegmentedProgressBar ?? Beautiful progress bar split into several segments. Highly customizable. Fully written with Jetpack Compose. Why this libra

Stephen Vinouze 90 Dec 15, 2022
[Android] Round Corner Progress Bar Library for Android

RoundCornerProgressBar Round corner is cool. Let's make your progress bar to round corner Colorful progress bar with round corner on progress which yo

Akexorcist 2.3k Dec 31, 2022
[Android] Round Corner Progress Bar Library for Android

RoundCornerProgressBar Round corner is cool. Let's make your progress bar to round corner Colorful progress bar with round corner on progress which yo

Akexorcist 2.3k Jan 7, 2023
Android library to display progress like google does in some of his services.

GoogleProgressBar This library is not maintained anymore and there will be no further releases Android library to display different kind of google rel

JPARDOGO 1.3k Dec 27, 2022
Android loading view

Loading Loading is a poject with kinds of Android loading view. Yan can see the wiki for more detail. RotateLoading BookLoading NewtonCradleLoading Us

null 1.2k Jan 1, 2023
Android fillable progress view working with SVG paths. This is a nice option too if you want to create an interesting branding logo for your app. Based on the iOS project: https://github.com/poolqf/FillableLoaders

Android FillableLoaders Android Open Source library providing an interesting fillable progress view working with SVG paths. This is a nice option too

Jorge Castillo 2k Jan 1, 2023
Android AlertDialog with moving dots progress indicator

Spots progress dialog Android AlertDialog with moving spots progress indicator packed as android library. =========== Usage The library available in m

Maksym Dybarskyi 1.1k Dec 26, 2022
An Android library providing to realize wave loading effect.

WaveLoadingView WaveLoadingView - An Android library that provides a realistic wave-loading effect. Sample Usage For a working implementation of this

Tang 1.7k Jan 2, 2023