Android library for showing progress in a highly customizable pie.

Overview

ProgressPieView

Android library for showing progress in a highly customizable pie.

ProgressPieView

Choose from the broad spectre of styleable elements:

  • ppvStrokeWidth - The width of stroke around the view.
  • ppvStrokeColor - The color of stroke around the view.
  • ppvBackgroundColor - The color of the views background.
  • ppvProgressColor - The color view of the views progress.
  • ppvInverted - Inverts the drawing of progress (fill radial only).
  • ppvCounterclockwise - Draws the progress counterclockwise (fill radial only).
  • ppvProgressFillType - Type for the progress fill (either fill radial at an angle or fill from center outwards).
  • ppvImage - image (can be hidden).
  • ppvTypeface - Font of the text.
  • text - text (can be hidden).
  • textSize - Size of the text.
  • textColor - Color of the text.

Usage

To get a feel of how it works you can also try out the sample:

Get it on Google Play

Find out the latest version from Maven Central or Gradle Please.

build.gradle:

dependencies {
    compile 'com.github.filippudak.progresspieview:library:1.0.+'
}

Example

        <com.filippudak.ProgressPieView.ProgressPieView
            android:layout_margin="8dp"
            android:layout_gravity="center"
            android:id="@+id/progressPieViewXml"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:textColor="@color/holo_orange_dark"
            android:textSize="18sp"
            android:text="Xml"
            ppv:ppvTypeface="fonts/Roboto/RobotoCondensed-Bold.ttf"
            ppv:ppvProgressFillType="center"
            ppv:ppvStrokeWidth="6dp"
            ppv:ppvStrokeColor="@color/holo_green_light"
            ppv:ppvBackgroundColor="@color/holo_purple"
            ppv:ppvProgressColor="@color/holo_red_light"/>

You can find more examples from code styling or xml styling in the sample that is provided.

Credits

Author : Filip Puđak ([email protected])

 Google+ LinkedIn

Thanks to +Gabriele Mariotti and +Chris Banes for the maven push gradle code!

Thanks to +Prateek Srivastava and +Roman Nurik for the base idea which was ProgressButton!

License

Copyright 2014 Filip Puđak

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Inverted radial progress drawing

    Inverted radial progress drawing

    Thank you for the great library! We had the requirement to invert the way the progress is drawing in radial mode, so here is a corresponding pull request of a working version. Hopefully you can include this upstream. Feel free to comment on this request.

    More pull requests may follow...

    opened by rzimmer 2
  • stop previous animation when animateProgressFill() is called while an animation is happening

    stop previous animation when animateProgressFill() is called while an animation is happening

    When I call animateProgressFill(n) and then call animateProgressFill(n+10) (where n = {0> n > max-10}) before the the first animation completes, this is thrown:

    //The numbers are made up java.lang.IllegalArgumentException: Animation progress (16) is lower than the current progress (17) at com.filippudak.ProgressPieView.ProgressPieView$AnimationRunnable.run(ProgressPieView.java:555) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method)

    animateProgressFill() and animateProgressFill(int) should check for running runnables and stop them first, then start the current animation

    Also, is there any reasons why animating decrements are are not allowed?

    opened by tom91136 2
  • Cannot Render it in Eclipse Project

    Cannot Render it in Eclipse Project

    Hi, Nice Plugin...I saw your sample app...I want to implement the same in my project but it is in eclipse..it gives error...in init method...can you provide Eclipse version of it library...thanks

    opened by sha2nkk 1
  • Why the progress is int?!?!

    Why the progress is int?!?!

    Thanks for a great progress pie!!! It's really awesome!

    But why the progress is an int and not a double ?! It's really help if it will be a double...

    Thanks again!

    opened by gran33 1
  • Rendering problem with Android Studio 0.8.4

    Rendering problem with Android Studio 0.8.4

    I'm not exactly sure if this is a library problem or an Android Studio problem because custom views that work with eclipse preview would break in Android Studio for no reasons....

    But anyway, here's the stack trace from Android Studio 0.8.4:

    java.lang.ClassNotFoundException: com.filippudak.ProgressPieView.R$styleable
    at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:148)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at com.filippudak.ProgressPieView.ProgressPieView.init(ProgressPieView.java:95)
    at com.filippudak.ProgressPieView.ProgressPieView.<init>(ProgressPieView.java:86)
    at com.filippudak.ProgressPieView.ProgressPieView.<init>(ProgressPieView.java:81)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:375)
    at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:100)
    at com.android.tools.idea.rendering.LayoutlibCallback.loadView(LayoutlibCallback.java:172)
    at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
    at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:132)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:778)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:805)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:778)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:500)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:381)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:400)
    at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:329)
    at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:332)
    at com.android.tools.idea.rendering.RenderService$3.compute(RenderService.java:575)
    at com.android.tools.idea.rendering.RenderService$3.compute(RenderService.java:564)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932)
    at com.android.tools.idea.rendering.RenderService.createRenderSession(RenderService.java:564)
    at com.android.tools.idea.rendering.RenderService.render(RenderService.java:691)
    at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:604)
    at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1900(AndroidLayoutPreviewToolWindowManager.java:80)
    at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:546)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
    at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
    at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:541)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
    at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
    at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
    at com.intellij.util.Alarm$Request$1.run(Alarm.java:327)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
    

    You may close this if it's an Android Studio issue...(or suppress it with View.isInEditMode()...)

    And this is how I used it:

        <com.filippudak.ProgressPieView.ProgressPieView
            android:id="@+id/progress"
            android:layout_width="36dp"
            android:layout_height="36dp"
            android:layout_gravity="center"
            android:layout_margin="8dp"
            android:textColor="@android:color/white"
            android:textSize="12sp"
            ppv:backgroundColor="#333333"
            ppv:progressColor="#33DDDDDD"
            ppv:progressFillType="radial"
            ppv:showStroke="true"
            ppv:strokeColor="#33DDDDDD"
            ppv:strokeWidth="1dp" />
    
    opened by tom91136 1
  • OnProgressCompleted verification

    OnProgressCompleted verification

    Hello mate! Nice work there! Just have to point something out in your example! I think you need to set up a boolean flag and check if the progressCompleted method has been reached and then if the progressChanged is called again remove the drawable that you set and enable the text!

    opened by pavlospt 1
  • attrs showText conflict with appcompat-v7:21

    attrs showText conflict with appcompat-v7:21

    This problem does not exist when using appcompat-v7:20 but with appcompat-v7:21 build fails. Solution, rename attrs "showText" to something diff

    opened by AndroidGecko 0
  • Bugfix: Correctly honor showStroke property

    Bugfix: Correctly honor showStroke property

    Currently, space for a stroke is reserved even if no stroke is to be drawn. You have to manually set strokeWidth to 0 to prevent this. This pull requests is taking into account the showStroke property correctly. It will only reserve space for the stroke if a stroke is requested to be drawn.

    opened by rzimmer 0
  • Added an animation that fills the ProgressPieView.

    Added an animation that fills the ProgressPieView.

    This animation is used to fill the remaining of the unfilled pieview. There are 3 defined animation speeds included and the default is set to FAST_ANIMATION_SPEED.

    opened by pavlospt 0
  • Unexpected behavior when setting progress outside set min (0) and max

    Unexpected behavior when setting progress outside set min (0) and max

    I ran into a crash that was a stupid error on my part, but perhaps could be handled more gracefully by the library or at least be well-documented. If I set a progress value that is outside the range of 0 to max, I get a crash.

    I could see perhaps a modification to this library that, when receiving a progress value, floors or ceilings it to the acceptable range. For example, if a progress of 6 is set on a pie view with a max of 4, the effective progress value would become 4. Likewise for negative numbers, if progress is set as -3, then the effective progress for display becomes 0.

    If you'd rather not sanitize inputs in that way, I'd suggest either a note about it in the documentation and/or a RuntimeException subclass that is thrown when this occurs, and a throws declaration on the setProgress and setMax signatures.

    opened by josefdlange 0
  • Hint of animating image view like progress fill animation

    Hint of animating image view like progress fill animation

    Thanks a lot for this awesome library. Is there anyway we can animate the ppvImage just like we animate or make progress for progress fill color. Right now the image is drawn directly. Any hint would be great. Lastly great work

    opened by leapfrog-santosh 4
  • Clarity over use of param startAngle - values of 0 to 360

    Clarity over use of param startAngle - values of 0 to 360

    from code: "startAngle start angle in degrees"

    It's not clear to me how this is "human readable". Maybe I'm making a big geometry mistake in asking this question, but here goes ;)

    1. Is it not the natural common-sense thinking that the value of an angle should be 0..360?
    2. Is there some kind of multiplication going on to account for screen density? Should the factor be adjusted/variable?
    3. Comments could explain home/origin position? is it at 12-o'clock or 3-o'clock?

    The sample application uses 720 as a value. Currently line 48 of MainActivity.java code. It just doesn't seem intuitive to me why that ends up at the 3-o'clock position of a pie... for multiple reasons given. Would it not seem more like this is 90 using a compass?

    Thank you for the code and time.

    opened by RoundSparrow 0
  • Draw background image instead of color when set

    Draw background image instead of color when set

    This pull request allows drawing an image in the background instead of just specifying only a background color. A background image takes precedence over a background color.

    The background image is not rounded by this pull request, but you may set an RoundedDrawable found in the RoundedImageView library.

    opened by rzimmer 2
Owner
Filip Puđak
Filip Puđak
A highly configurable library to do loading progress with animated balls

Loading Balls A highly configurable library to do loading progress with animated balls for Android How to use Custom attributes lib:path="triangle" Th

Adrián Lomas 930 Dec 7, 2022
Android loading or progress dialog widget library, provide efficient way to implement iOS like loading dialog and progress wheel

ACProgressLite English Version / 中文版本 An Android loading widget library. Lite and easy to use, strong customizability. Can be used to implement 'iOS'

Cloudist Technology Co., Ltd. 234 Nov 24, 2022
:barber: [Android Library] Stacked dual progress indicator progress-bar

StackedHorizontalProgressBar Specs Featured in Show some ❤️ Android library with ability to show two progress indicators in one horizontal progress ba

Nishant Srivastava 98 Nov 11, 2022
A customizable, animated progress bar that features rounded corners. This Android library is designed to look great and be simple to use 🎉

RoundedProgressBar Easy, Beautiful, Customizeable The RoundedProgressBar library gives you a wide range of customizable options for making progress ba

null 541 Jan 1, 2023
A progress wheel for android, intended for use instead of the standard progress bar.

Deprecation warning This project is no-longer maintained, and has not been maintained for a few years now. If you're looking for an alternative librar

Todd Davies 2.7k Dec 29, 2022
IOSProgressBar is a progress-bar lib for android. And the progress-bar looks like iOS system style

IOSProgressBar is a progress-bar lib for android. And the progress-bar looks like iOS system style

heyangyang 6 Aug 25, 2022
Completely customizable progress based loaders drawn using custom CGPaths written in Swift

FillableLoaders Completely customizable progress based loaders drawn using custom CGPaths written in Swift Waves Plain Spike Rounded Demo: Changelog:

Pol Quintana 2.1k Dec 31, 2022
A customizable indeterminate progress bar

DilatingDotsProgressBar Installation compile 'com.github.justzak:dilatingdotsprogressbar:1.0.1' Usage <com.zl.reik.dilatingdotsprogressbar.DilatingDo

Zachary Reik 628 Sep 24, 2022
Completely customizable progress based loaders drawn using custom CGPaths written in Swift

FillableLoaders Completely customizable progress based loaders drawn using custom CGPaths written in Swift Waves Plain Spike Rounded Demo: Changelog:

Pol Quintana 2.1k Dec 31, 2022
ProgressDialog that waits a minimum time to be dismissed before showing. Once visible, the ProgressDialog will be visible for a minimum amount of time to avoid "flashes" in the UI.

DelayedProgress ProgressBar and ProgressDialog that waits a minimum time to be dismissed before showing. Once visible, the they will be visible for a

Said Tahsin Dane 95 Nov 25, 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
A circular android ProgressBar library which extends View, and the usage same as ProgressBar, It has solid,line and solid_line three styles. Besides, progress value can be freely customized.

CircleProgressBar 中文版文档 The CircleProgressBar extends View, It has both solid and line two styles. Besides, progress value can be freely customized. I

dinus_developer 1.2k Jan 3, 2023
DownloadProgressBar is an android library that delivers awesome custom progress bar. You can manipulate it's state in every way.

Download Progress Bar Android progress bar with cool animation, inspired by : https://dribbble.com/shots/2012292-Download-Animation ###Attributes Attr

Mariusz Brona 978 Nov 10, 2022
Open source android library for different progress bar designs

MultiProgressBar A progress bar library for Android that provides customized progress bars. Built with ❤︎ by Aseem Khare ?? Installation Add this in y

Aseem Khare 124 Nov 15, 2022
Android library with collection of cool progress views.

CoolProgressViews Android library with collection of cool progress views. DEMO LINK Also Mention in: Android Library Hunt MaterialUp DEMO DOWNLOAD Add

Amanjeet Singh 83 Nov 29, 2022
Progress Button is a android library for hanling different types state like active, finished, enabled, disabled and reset with a single line of code.

Progress Button is a android library for hanling different types state like active, finished, enabled, disabled and reset with a single line of code.

Sagar Khurana 38 Nov 15, 2022
An android library to easily add circular progress bar into your Jetpack Compose apps.

CircularProgressBar for Jetpack Compose An android library to easily add circular progress bar into your Jetpack Compose apps. Have a Look Usage Circu

Hitanshu Dhawan 38 Oct 30, 2022