[Android] Round Corner Progress Bar Library for Android

Overview

Android Arsenal Download Minimum SDK Version Build Status

RoundCornerProgressBar

Round corner is cool. Let's make your progress bar to round corner

Round Corner Progress Bar Sample

Colorful progress bar with round corner on progress which you can customized a color and corner radius

Installation

implementation 'com.akexorcist:round-corner-progress-bar:2.1.1'

Migrate from 2.0.x to 2.1.x or higher

Moving from MavenCentral to JCenter with new artifact ID

From (MavenCentral)

// Old (MavenCentral)
implementation 'com.akexorcist:RoundCornerProgressBar:2.0.3'

// New (JCenter)
implementation 'com.akexorcist:round-corner-progress-bar:2.1.1'

BaseRoundCornerProgressBar.OnProgressChangedListener

Change the view ID parameter in onProgressChanged to View class

// Old
fun onProgressChanged(
    viewId: Int, 
    progress: Float, 
    isPrimaryProgress: Boolean, 
    isSecondaryProgress: Boolean
)

// New
fun onProgressChanged(
    view: View, 
    progress: Float, 
    isPrimaryProgress: Boolean, 
    isSecondaryProgress: Boolean
)

Custom your own progress bar by extends BaseRoundCornerProgressBar

Use AnimatedRoundCornerProgressBar instead of BaseRoundCornerProgressBar for progress change animation support.

class CustomRoundCornerProgressBar: AnimatedRoundCornerProgressBar() {
    ...
}

And you do not have to create the GradientDrawable by yourself anymore. drawProgress will send it as parameter.

// Old
fun drawProgress(
    layoutProgress: LinearLayout,
    max: Float,
    progress: Float,
    totalWidth: Float,
    radius: Int,
    padding: Int,
    progressColor: Int,
    isReverse: Boolean
)

// New
fun drawProgress(
    layoutProgress: LinearLayout,
    progressDrawable: GradientDrawable,
    max: Float,
    progress: Float,
    totalWidth: Float,
    radius: Int,
    padding: Int,
    isReverse: Boolean
)

Release Notes

2.1.1

2.1.0

  • CenteredRoundCornerProgressBar added (#42)
  • IndeterminateRoundCornerProgressBar and IndeterminateCenteredRoundCornerProgressBar added
  • IconRoundCornerProgressBar now support for Bitmap and Drawable for icon
  • Animation for progress update (disable by default) added. This feature applied to all progress bars
  • Gradient progress color support (both primary and secondary progress) added. This feature applied to all progress bars ((#39))
  • Text gravity when inside/outside and text position priority attribute in TextRoundCornerProgressBar added
  • Integer value support for progress setter (convert to float inside) added
  • Update to Gradle Plugin 3.6.3 and Gradle 5.6.4
  • Migrate from Android Support to AndroidX
  • Still in Java! (will be Kotlin in next version)
  • Fix bug in (#43) (#20) (#74)
  • Moved from MavenCentral to JCenter. Please see "Installation" section for new artifact ID
  • All new sample code. You should try it!
  • Add useful annotations for Kotlin

2.0.X

  • New code structure, Easy for further development

Demo

Round Corner Progress Bar Demo (Google Play)

Overview

Round Corner Progress Bar

Simple round corner progress bar

Round Corner Progress Bar

CenteredRoundCornerProgressBar

Round corner progress bar with progress expands from the center

Centered Round Corner Progress Bar

Icon Round Corner Progress Bar

Round corner progress bar with heading icon

Icon Round Corner Progress Bar

TextRoundCornerProgressBar

Round corner progress bar with text inside the progress

Icon Round Corner Progress Bar

IndeterminateRoundCornerProgressBar and IndeterminateCenteredRoundCornerProgressBar

Simple round corner progress bar and centered round corner progress bar with indeterminate animation

Indeterminate Round Corner Progress Bar and Indeterminate Centered Round Corner Progress Bar

Feature

Standard Features

  • Primary progress and secondary progress supported
  • Primary progress, secondary progress and progress background color are customizable
  • Customize your own progress background padding
  • Customize your own progress's corner radius
  • Reversing progress bar supported
  • Progress bar with gradient color? Yes!
  • Progress change animation? Absolutely yes!

Component Features

  • Progress expanding from center with CenteredRoundCornerProgressBar
  • Heading icon supported with IconRoundCornerProgressBar
  • Text inside progress supported with TextRoundCornerProgressBar
  • Indeterminate animation supported with IndeterminateRoundCornerProgressBar or IndeterminateCenteredRoundCornerProgressBar

Usage

For using custom attribute of progress bar, define 'app' namespace as root view attribute in your layout

xmlns:app="http://schemas.android.com/apk/res-auto"

RoundCornerProgressBar

Example

<com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar
    android:layout_width="260dp" 
    android:layout_height="30dp"
    app:rcBackgroundColor="#0A000000"
    app:rcBackgroundPadding="2dp"
    app:rcMax="100"
    app:rcProgress="40"
    app:rcProgressColor="#EF5350"
    app:rcRadius="10dp"
    app:rcSecondaryProgress="60"
    app:rcSecondaryProgressColor="#40EF5350" />

Round Corner Progress Bar

Layout XML

<com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar
    app:rcProgress="float"
    app:rcSecondaryProgress="float"
    app:rcMax="float"
    app:rcRadius="dimension"
    app:rcBackgroundPadding="dimension"
    app:rcReverse="boolean"
    app:rcProgressColor="color"
    app:rcSecondaryProgressColor="color"
    app:rcBackgroundColor="color"
    app:rcAnimationEnable="boolean"
    app:rcAnimationSpeedScale="float" />

Public Methods

// Progress
fun getMax(): Float
fun setMax(max: Float)
fun getProgress(): Float
fun setProgress(progress: Int)
fun setProgress(progress: Float)
fun getSecondaryProgress(): Float
fun setSecondaryProgress(secondaryProgress: Int)
fun setSecondaryProgress(secondaryProgress: Float)

// Dimension
fun getRadius(): Int
fun setRadius(radius: Int)
fun getPadding(): Int
fun setPadding(padding: Int)
fun getLayoutWidth(): Float

// Animation
fun enableAnimation()
fun disableAnimation()
fun getAnimationSpeedScale(): Float
fun setAnimationSpeedScale(scale: Float)
fun isProgressAnimating(): Boolean
fun isSecondaryProgressAnimating(): Boolean

// Reversing Progress
fun isReverse(): Boolean
fun setReverse(isReverse: Boolean)

// Color
fun getProgressBackgroundColor(): Int
fun setProgressBackgroundColor(color: Int)
fun getProgressColor(): Int
fun setProgressColor(color: Int)
fun getProgressColors(): IntArray
fun setProgressColors(colors: IntArray)
fun getSecondaryProgressColor(): Int
fun setSecondaryProgressColor(color: Int)
fun getSecondaryProgressColors(): IntArray
fun setSecondaryProgressColors(colors: IntArray)

// Listener
fun setOnProgressChangedListener(listener: OnProgressChangedListener)

CenteredRoundCornerProgressBar

Same as RoundCornerProgressBar but reversing does not supported.

Example

<com.akexorcist.roundcornerprogressbar.CenteredRoundCornerProgressBar
    android:layout_width="260dp" 
    android:layout_height="30dp"
    app:rcBackgroundColor="#0A000000"
    app:rcBackgroundPadding="2dp"
    app:rcMax="100"
    app:rcProgress="40"
    app:rcProgressColor="#EF5350"
    app:rcRadius="10dp"/>

Centerd Round Corner Progress Bar

Layout XML

<com.akexorcist.roundcornerprogressbar.CenteredRoundCornerProgressBar
    app:rcProgress="float"
    app:rcSecondaryProgress="float"
    app:rcMax="float"
    app:rcRadius="dimension"
    app:rcBackgroundPadding="dimension"
    app:rcProgressColor="color"
    app:rcSecondaryProgressColor="color"
    app:rcBackgroundColor="color"
    app:rcAnimationEnable="boolean"
    app:rcAnimationSpeedScale="float" />

Public Methods

// Progress
fun getMax(): Float
fun setMax(max: Float)
fun getProgress(): Float
fun setProgress(progress: Int)
fun setProgress(progress: Float)
fun getSecondaryProgress(): Float
fun setSecondaryProgress(secondaryProgress: Int)
fun setSecondaryProgress(secondaryProgress: Float)

// Dimension
fun getRadius(): Int
fun setRadius(radius: Int)
fun getPadding(): Int
fun setPadding(padding: Int)
fun getLayoutWidth(): Float

// Animation
fun enableAnimation()
fun disableAnimation()
fun getAnimationSpeedScale(): Float
fun setAnimationSpeedScale(scale: Float)
fun isProgressAnimating(): Boolean
fun isSecondaryProgressAnimating(): Boolean

// Color
fun getProgressBackgroundColor(): Int
fun setProgressBackgroundColor(color: Int)
fun getProgressColor(): Int
fun setProgressColor(color: Int)
fun getProgressColors(): IntArray
fun setProgressColors(colors: IntArray)
fun getSecondaryProgressColor(): Int
fun setSecondaryProgressColor(color: Int)
fun getSecondaryProgressColors(): IntArray
fun setSecondaryProgressColors(colors: IntArray)

// Listener
fun setOnProgressChangedListener(listener: OnProgressChangedListener)

IconRoundCornerProgressBar

Icon size is required for this progress bar. Use wrap_content for layout_height is recommended.

<com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar
        android:layout_height="wrap_content"
        app:rcIconSize="40dp"
        ... />

Example

<com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar
    android:layout_width="260dp" 
    android:layout_height="wrap_content"
    app:rcBackgroundColor="#0A000000"
    app:rcBackgroundPadding="2dp"
    app:rcIconBackgroundColor="#00796B"
    app:rcIconPadding="5dp"
    app:rcIconSize="40dp"
    app:rcIconSrc="@drawable/ic_android"
    app:rcMax="150"
    app:rcProgress="90"
    app:rcProgressColor="#EF5350"
    app:rcRadius="5dp"
    app:rcReverse="true" />

Icon Round Corner Progress Bar

Layout XML

<com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar
        app:rcProgress="float"
        app:rcSecondaryProgress="float"
        app:rcMax="float"
        app:rcRadius="dimension"
        app:rcBackgroundPadding="dimension"
        app:rcReverse="boolean"
        app:rcProgressColor="color"
        app:rcSecondaryProgressColor="color"
        app:rcBackgroundColor="color"
        app:rcAnimationEnable="boolean"
        app:rcAnimationSpeedScale="float" 
        app:rcIconSrc="reference"
        app:rcIconSize="dimension"
        app:rcIconWidth="dimension"
        app:rcIconHeight="dimension"
        app:rcIconPadding="dimension"
        app:rcIconPaddingLeft="dimension"
        app:rcIconPaddingRight="dimension"
        app:rcIconPaddingTop="dimension"
        app:rcIconPaddingBottom="dimension"
        app:rcIconBackgroundColor="color" />

Public Methods

// Progress
fun getMax(): Float
fun setMax(max: Float)
fun getProgress(): Float
fun setProgress(progress: Int)
fun setProgress(progress: Float)
fun getSecondaryProgress(): Float
fun setSecondaryProgress(secondaryProgress: Int)
fun setSecondaryProgress(secondaryProgress: Float)

// Dimension
fun getRadius(): Int
fun setRadius(radius: Int)
fun getPadding(): Int
fun setPadding(padding: Int)
fun getLayoutWidth(): Float

fun getIconSize(): Int
fun setIconSize(size: Int)
fun getIconPadding(): Int
fun setIconPadding(padding: Int)
fun getIconPaddingLeft(): Int
fun setIconPaddingLeft(padding: Int)
fun getIconPaddingTop(): Int
fun setIconPaddingTop(padding: Int)
fun getIconPaddingRight(): Int
fun setIconPaddingRight(padding: Int)
fun getIconPaddingBottom(): Int
fun setIconPaddingBottom(padding: Int)

// Animation
fun enableAnimation()
fun disableAnimation()
fun getAnimationSpeedScale(): Float
fun setAnimationSpeedScale(scale: Float)
fun isProgressAnimating(): Boolean
fun isSecondaryProgressAnimating(): Boolean

// Reversing Progress
fun isReverse(): Boolean
fun setReverse(isReverse: Boolean)

// Color
fun getProgressBackgroundColor(): Int
fun setProgressBackgroundColor(color: Int)
fun getProgressColor(): Int
fun setProgressColor(color: Int)
fun getProgressColors(): IntArray
fun setProgressColors(colors: IntArray)
fun getSecondaryProgressColor(): Int
fun setSecondaryProgressColor(color: Int)
fun getSecondaryProgressColors(): IntArray
fun setSecondaryProgressColors(colors: IntArray)
fun getColorIconBackground(): Int
fun setIconBackgroundColor(color: Int)

// Icon
fun getIconImageResource(): Int
fun setIconImageResource(resId: Int)
fun getIconImageBitmap(): Birmap
fun setIconImageBitmap(bitmap: Bitmap)
fun getIconImageDrawable(): Drawable
fun setIconImageDrawable(drawable: Drawable)

// Listener
fun setOnProgressChangedListener(listener: OnProgressChangedListener)
fun setOnIconClickListener(listener: OnIconClickListener)

TextRoundCornerProgressBar

Example

<com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar
    android:layout_width="260dp" 
    android:layout_height="30dp"
    app:rcBackgroundColor="#0A000000"
    app:rcBackgroundPadding="2dp"
    app:rcMax="100"
    app:rcProgress="40"
    app:rcProgressColor="#EF5350"
    app:rcRadius="80dp"
    app:rcReverse="true"
    app:rcSecondaryProgress="60"
    app:rcSecondaryProgressColor="#40009688"
    app:rcTextPositionPriority="outside"
    app:rcTextProgress="40"
    app:rcTextProgressColor="#111111" />

Text Round Corner Progress Bar

Layout XML

<com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar
        app:rcProgress="float"
        app:rcSecondaryProgress="float"
        app:rcMax="float"
        app:rcRadius="dimension"
        app:rcBackgroundPadding="dimension"
        app:rcReverse="boolean"
        app:rcProgressColor="color"
        app:rcSecondaryProgressColor="color"
        app:rcBackgroundColor="color"
        app:rcAnimationEnable="boolean"
        app:rcAnimationSpeedScale="float"
        app:rcTextProgressColor="color"
        app:rcTextProgressSize="dimension"
        app:rcTextProgressMargin="dimension"
        app:rcTextProgress="String"
        app:rcTextInsideGravity="start|end"
        app:rcTextOutsideGravity="start|end"
        app:rcTextPositionPriority="inside|outside" />

Public Methods

// Progress
fun getMax(): Float
fun setMax(max: Float)
fun getProgress(): Float
fun setProgress(progress: Int)
fun setProgress(progress: Float)
fun getSecondaryProgress(): Float
fun setSecondaryProgress(secondaryProgress: Int)
fun setSecondaryProgress(secondaryProgress: Float)

// Dimension
fun getRadius(): Int
fun setRadius(radius: Int)
fun getPadding(): Int
fun setPadding(padding: Int)
fun getLayoutWidth(): Float
fun getTextProgressSize(): Int
fun setTextProgressSize(size: Int)
fun getTextProgressMargin(): Int
fun setTextProgressMargin(margin: Int)

// Animation
fun enableAnimation()
fun disableAnimation()
fun getAnimationSpeedScale(): Float
fun setAnimationSpeedScale(scale: Float)
fun isProgressAnimating(): Boolean
fun isSecondaryProgressAnimating(): Boolean

// Reversing Progress
fun isReverse(): Boolean
fun setReverse(isReverse: Boolean)

// Color
fun getProgressBackgroundColor(): Int
fun setProgressBackgroundColor(color: Int)
fun getProgressColor(): Int
fun setProgressColor(color: Int)
fun getProgressColors(): IntArray
fun setProgressColors(colors: IntArray)
fun getSecondaryProgressColor(): Int
fun setSecondaryProgressColor(color: Int)
fun getSecondaryProgressColors(): IntArray
fun setSecondaryProgressColors(colors: IntArray)
fun getTextProgressColor(): Int
fun setTextProgressColor(color: Int)

// Text
fun getProgressText(): String
fun setProgressText(text: String)

// Position
fun getTextPositionPriority(): Int
fun setTextPositionPriority(priority: Int)
fun getTextInsideGravity(): Int
fun setTextInsideGravity(gravity: Int)
fun getTextOutsideGravity(): Int
fun setTextOutsideGravity(gravity: Int)

// Listener
fun setOnProgressChangedListener(listener: OnProgressChangedListener)

IndeterminateRoundCornerProgressBar

Example

<com.akexorcist.roundcornerprogressbar.indeterminate.IndeterminateRoundCornerProgressBar
    android:layout_width="260dp" 
    android:layout_height="10dp"
    app:rcAnimationSpeedScale="3"
    app:rcBackgroundColor="#0A000000"
    app:rcProgressColor="#EF5350" />

Indeterminate Round Corner Progress Bar

Layout XML

<com.akexorcist.roundcornerprogressbar.indeterminate.IndeterminateRoundCornerProgressBar
        app:rcRadius="dimension"
        app:rcBackgroundPadding="dimension"
        app:rcReverse="boolean"
        app:rcProgressColor="color"
        app:rcSecondaryProgressColor="color"
        app:rcBackgroundColor="color"
        app:rcAnimationSpeedScale="float" />

Public Methods

// Dimension
fun getRadius(): Int
fun setRadius(radius: Int)
fun getPadding(): Int
fun setPadding(padding: Int)
fun getLayoutWidth(): Float

// Animation
fun getAnimationSpeedScale(): Float
fun setAnimationSpeedScale(scale: Float)

// Reversing Progress
fun isReverse(): Boolean
fun setReverse(isReverse: Boolean)

// Color
fun getProgressBackgroundColor(): Int
fun setProgressBackgroundColor(color: Int)
fun getProgressColor(): Int
fun setProgressColor(color: Int)
fun getProgressColors(): IntArray
fun setProgressColors(colors: IntArray)
fun getSecondaryProgressColor(): Int
fun setSecondaryProgressColor(color: Int)
fun getSecondaryProgressColors(): IntArray
fun setSecondaryProgressColors(colors: IntArray)

IndeterminateCenteredRoundCornerProgressBar

Same as IndeterminateRoundCornerProgressBar

Example

<com.akexorcist.roundcornerprogressbar.indeterminate.IndeterminateCenteredRoundCornerProgressBar
    android:layout_width="260dp" 
    android:layout_height="10dp"
    app:rcAnimationSpeedScale="0.75"
    app:rcBackgroundColor="#0A000000"
    app:rcProgressColor="#EF5350" />

Indeterminate Centered Round Corner Progress Bar

Layout XML

<com.akexorcist.roundcornerprogressbar.IndeterminateCenteredRoundCornerProgressBar
        app:rcRadius="dimension"
        app:rcBackgroundPadding="dimension"
        app:rcReverse="boolean"
        app:rcProgressColor="color"
        app:rcSecondaryProgressColor="color"
        app:rcBackgroundColor="color"
        app:rcAnimationSpeedScale="float" />

Public Methods

// Dimension
fun getRadius(): Int
fun setRadius(radius: Int)
fun getPadding(): Int
fun setPadding(padding: Int)
fun getLayoutWidth(): Float

// Animation
fun getAnimationSpeedScale(): Float
fun setAnimationSpeedScale(scale: Float)

// Reversing Progress
fun isReverse(): Boolean
fun setReverse(isReverse: Boolean)

// Color
fun getProgressBackgroundColor(): Int
fun setProgressBackgroundColor(color: Int)
fun getProgressColor(): Int
fun setProgressColor(color: Int)
fun getProgressColors(): IntArray
fun setProgressColors(colors: IntArray)
fun getSecondaryProgressColor(): Int
fun setSecondaryProgressColor(color: Int)
fun getSecondaryProgressColors(): IntArray
fun setSecondaryProgressColors(colors: IntArray)

Apply Gradient Progress Bar Color

Gradient color for progress bar must be in int array resource. At least 2 colors.

<!-- Color Resource -->
<resources>
    <array name="sample_progress_gradient">
        <item>#009688</item>
        <item>#80CBC4</item>
    </array>
</resources>

<!-- Layout -->
<com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar
    ...
    app:rcBackgroundColor="#0A000000"
    app:rcBackgroundPadding="4dp"
    app:rcMax="100"
    app:rcProgress="50"
    app:rcProgressColors="@array/sample_progress_gradient"
    app:rcRadius="30dp" />

Gradient Progress Bar Color

Progress bar does not clipped when size changed. So the gradient color will fully display without clipping also.

Apply Progress Change Animation

Animation when progress change is disabled by default (exclude IndeterminateProgressBar and IndeterminateCenteredProgressBar).

So you have to enable the animation by XML attribute or programmatically

<com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar
    ...
    app:rcAnimationEnable="true"
    app:rcAnimationSpeedScale="1" />

When progress changed, the animation will applied automatically.

Comparison Between With/Without Animation

Animation speed scale's value is float betweeen 0.2 - 5.0 (default is 1.0). Higher for slow down the animation, lower for speed up.

Related Articles

Thai Language : Round Corner Progress Bar สำหรับคนบ้าขอบมน

Special Thanks

@first087, @redsanso

What's Next

  • IconTextRoundCornerProgressBar (#69)
  • Support color resource in color related attributes
  • Add set max progress with integer
  • Set outside/inside text color in TextRoundCornerProgressBar separately

Known Issues

  • Incorrect progress showing in CenteredRoundCornerProgressBar with 1%-2% value
  • Incorrect text's width in TextRoundCornerProgressBar when outside priority and value close to 100%
  • setProgress(progress: Int) does not update text position

Licence

Copyright 2020 Akexorcist

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or 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
  • Filling progress with drawable texture

    Filling progress with drawable texture

    Hello. Tell me please, can I set drawable resource for progress, not color? Something like rcProgressDrawable attribute. I would like to fill progress with drawable texture with tile mode. Can your library provide this feature? If not, is it planned in the future? Thanks in advance.

    enhancement 
    opened by victor-semenovich-dev 20
  • Rendering problem

    Rendering problem

    Hi! I have this error on preview layout: java.lang.NullPointerException   at com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar.setBackgroundLayoutSize(RoundCornerProgressBar.java:50)   at com.akexorcist.roundcornerprogressbar.common.BaseRoundCornerProgressBar.onMeasure(BaseRoundCornerProgressBar.java:220)

    this is my layout file:

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center">
        <com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar
            android:id="@+id/progress_splash_screen"
            android:layout_height="32dp"
            android:layout_width="match_parent"
            app:backgroundPadding="5dp" />
    </LinearLayout>
    

    why??

    bug 
    opened by maurosoft1973 11
  • Problem with RecyclerView not rendering the progress.

    Problem with RecyclerView not rendering the progress.

    So.. I'm using CardsLib with a CardRecyclerViewList and I'm having problems with the rendering of the ProgressBar.

    The only elements that get rendered are the elements that are visible on the first screen. But as I scroll down all of the remaining cards only show a grey background.

    unnamed

    bug 
    opened by fnk0 9
  • Can't build TextRoundCornerProgressBar

    Can't build TextRoundCornerProgressBar

    Included com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar into xml.

    compile 'com.akexorcist:RoundCornerProgressBar:2.0.3'
    classpath 'com.android.tools.build:gradle:1.5.0'
    buildToolsVersion '23.0.2'
    
    
    Warning: com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$2: can't find referenced method 'android.widget.TextView access$000(com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar)' in program class com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar
    Warning: com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$2: can't find enclosing method 'void setTextProgressAlign()' in program class com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar
    
    
    help wanted 
    opened by IonAalbers 7
  • Attribute

    Attribute "..." has already been defined

    When I want to build my project only with the gradle addition of your project I receive the following errors...

    \app\build\intermediates\res\debug\values\values.xml:497: error: Attribute "progress" has already been defined
    
    \app\build\intermediates\res\debug\values\values.xml:497: error: Attribute "max" has already been defined
    
    \app\build\intermediates\res\debug\values\values.xml:497: error: Attribute "iconSize" has already been defined
    
    \app\build\intermediates\res\debug\values\values.xml:497: error: Attribute "iconPadding" has already been defined
    

    Maybe add a prefix to all your custom attributes?

    opened by FHellmann 7
  • Problem for Rounded Progress Bar on Jelly Bean Devices

    Problem for Rounded Progress Bar on Jelly Bean Devices

    screenshot_2017-11-03-10-50-56 1

    Hello, i use Rounded progress bar to show progress, but it does not works properly below android Jelly Bean 4.2.2 and below devices, the progress bar gets stretch

    opened by Suyash171 5
  • Text Alignment (TextRoundCorner )

    Text Alignment (TextRoundCorner )

    Hello, nice work. I would like to suggest a new feature. Like set the property Text Alignment on the TextRoundCorner (Center, Left or Right)

    Or is it already implemented?

    Regards

    enhancement 
    opened by mzdevmarco 4
  • Screen in half

    Screen in half

    Hey, i tried to use your progressBar but i had a window that is split into 2 sides left and right, i tried to use your progressbar but it tries to use the whore screen as the main width instead of one side.

    using compile 'com.akexorcist:RoundCornerProgressBar:1.2.0'

    screenshot_2015-06-14-22-26-19

    my xml:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
    
        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:baselineAligned="false"
            android:orientation="horizontal"
            android:paddingBottom="@dimen/main_screen_between_padding">
    
            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1.0"
                android:layout_marginRight="@dimen/main_screen_between_padding"
                android:layout_marginStart="@dimen/main_screen_between_padding"
                android:layout_marginLeft="@dimen/main_screen_zero_dp"
                android:layout_marginEnd="@dimen/main_screen_zero_dp"
                android:background="@drawable/background_note"
                android:id="@+id/note_button">
    
                <com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar
                    android:id="@+id/audio_progress"
                    android:layout_width="fill_parent"
                    android:layout_height="20dp"
                    android:layout_above="@+id/textView"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentStart="true"
                    android:layout_margin="10dp"
                    app:rcProgressColor="@color/progressBarColor"
                    app:rcProgress="30"
                    app:rcMax="100"
                    app:rcBackgroundPadding="2dp"
                    app:rcBackgroundRadius="5dp"/>
    
    
            </RelativeLayout>
    
            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="vertical"
                android:layout_marginEnd="@dimen/main_screen_zero_dp"
                android:layout_marginLeft="@dimen/main_screen_between_padding"
                android:layout_marginRight="@dimen/main_screen_zero_dp"
                android:layout_marginStart="@dimen/main_screen_between_padding"
                android:background="@drawable/background_pic"
                android:id="@+id/photo_button">
    
            </RelativeLayout>
        </LinearLayout>
    
    </LinearLayout>
    

    When i try to render it in android studio:

    java.lang.NullPointerException
        at com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar.setBackgroundLayoutSize(RoundCornerProgressBar.java:48)
        at com.akexorcist.roundcornerprogressbar.BaseRoundCornerProgressBar.onMeasure(BaseRoundCornerProgressBar.java:218)
        at android.view.View.measure(View.java:17547)
        at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:727)
        at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:463)
        at android.view.View.measure(View.java:17547)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5535)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
        at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1083)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:615)
        at android.view.View.measure(View.java:17547)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5535)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
        at android.view.View.measure(View.java:17547)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5535)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:436)
        at android.support.v7.internal.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:124)
        at android.view.View.measure(View.java:17547)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5535)
        at android.support.v7.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:444)
        at android.view.View.measure(View.java:17547)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5535)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
        at android.view.View.measure(View.java:17547)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:875)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
        at android.view.View.measure(View.java:17547)
        at com.android.layoutlib.bridge.impl.RenderSessionImpl.measureView(RenderSessionImpl.java:640)
        at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:540)
        at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:323)
        at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
        at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:497)
        at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:485)
        at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:894)
        at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:485)
        at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:590)
        at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$6.run(AndroidDesignerEditorPanel.java:480)
        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:351)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    
    opened by nniicc 4
  • Unable to instantiate view

    Unable to instantiate view

    Every time i get this error in xml layout unable to instantiate view.

    Rendering Problems The following classes could not be instantiated: - com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar (Open Class, Show Exception) Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE Exception Details java.lang.NullPointerException at com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar.setBackgroundColor(RoundCornerProgressBar.java:194) at com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar.(RoundCornerProgressBar.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:413) at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:105) at com.android.tools.idea.rendering.LayoutlibCallback.loadView(LayoutlibCallback.java:176) at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:206) at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:131) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:756) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:728) at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at android.view.LayoutInflater.inflate(LayoutInflater.java:373) at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:391) at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:337) at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350) at com.android.tools.idea.rendering.RenderService$5.compute(RenderService.java:708) at com.android.tools.idea.rendering.RenderService$5.compute(RenderService.java:697) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932) at com.android.tools.idea.rendering.RenderService.createRenderSession(RenderService.java:697) at com.android.tools.idea.rendering.RenderService.render(RenderService.java:816) at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:646) at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1700(AndroidLayoutPreviewToolWindowManager.java:82) at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:589) 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:584) 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:744)

    bug 
    opened by sadarshannaiynar 4
  • Fix low version compatibility

    Fix low version compatibility

    Method "removeOnGlobalLayoutListener" is API Level 16

    Method "setProgressColor" in RoundCornerProgressBar class is wrong.

    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        layoutBackground.setBackground(gradient);
    } else {
        layoutBackground.setBackgroundDrawable(gradient);
    }
    

    Please fix it.

    Nice library. Thx.

    opened by darktiny 4
  • Icon rcProgressBar Not displaying progress at all

    Icon rcProgressBar Not displaying progress at all

    So I have been working with the library for a little bit and I can't get progress to show on the icon progress bar. It works perfectly fine for all other versions of the bar. For example, this code snippet is directly from the example code, and the progress displays correctly when I switch it to just a RoundCornerProgressBar, but once I add the Icon in, it displays the colors and everything else correctly, but shows no progress.. <com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar android:layout_width="250dp" android:layout_height="30dp" android:layout_marginBottom="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:rcBackgroundColor="@color/white" app:rcBackgroundPadding="2dp" app:rcMax="100" app:rcProgress="50" app:rcProgressColor="@color/murica_flag_blue" app:rcRadius="0dp" />

    question 
    opened by zach-morgan 3
  • Make a custom background and change progress text color

    Make a custom background and change progress text color

    Hello!

    Could you please advice, are there any ways to make progress like this: https://wampi.ru/image/ROLMej0

    As you can see:

    1. There should be not rcProgressColor, but something like progressBackground, there I can put my drawable with shape, because there should be white color with green border
    2. color of the text should be different before and after time line

    Thank you!

    opened by Strikelon 0
  • Color is not updated when system themewas changed

    Color is not updated when system themewas changed

    I have

    dataList.forEachIndexed { index, data ->
                val layout: ConstraintLayout =
                    inflater.inflate(
                        R.layout.progress_item,
                        null,
                        false
                    ) as ConstraintLayout
    
                val leftLine = layout.findViewById<RoundCornerProgressBar>(R.id.left_line)
                leftLine.progressColor = Color.parseColor(data.leftColor)
    
                val rightLine = layout.findViewById<RoundCornerProgressBar>(R.id.right_line)
                rightLine.progressColor = Color.parseColor(data.rightColor)
    
                content.addView(layout)
            }
    

    That works perfectly fine. But when system style changed to Day/Night all RoundCornerProgressBar items apply the last color in dataList. Other views in R.layout.progress_item works fine and apply correct color.

    opened by Verona1024 0
  • android.util.SuperNotCalledException: Activity {MainActivity} did not call through to super.onCreate()

    android.util.SuperNotCalledException: Activity {MainActivity} did not call through to super.onCreate()

    java.lang.NoSuchMethodError: No direct method (Landroid/os/Parcel;Ljava/lang/ClassLoader;)V in class Landroid/view/AbsSavedState; or its super classes (declaration of 'android.view.AbsSavedState' appears in /system/framework/framework.jar) 03-08 08:08:54.781 22877 22877 W System.err: AnimatedRoundCornerProgressBar$a.(MovieFile:341) 03-08 08:08:54.781 22877 22877 W System.err: AnimatedRoundCornerProgressBar$a$1.a(MovieFile:364) 03-08 08:08:54.781 22877 22877 W System.err: AnimatedRoundCornerProgressBar$a$1.createFromParcel(MovieFile:361)

    opened by maoai-xianyu 2
  • Progress text inside progress bar being cut off (Incorrect measurements?)

    Progress text inside progress bar being cut off (Incorrect measurements?)

    I ran into an issue using the RoundedCornerProgressBar. I have a method that sets the progress of the bar and also updates the progress bar text to indicate the current progress. Most of the time, the text will properly choose where to show itself so it isn't cut off. However, about 10% of the time the text will show itself in an area that is too small for it, leading to it being cut off. It's kind of hard to explain in words, but I have taken two photos to show an example of this:

    90% of the time this will show when the fragment starts (Which is correct) worksmostthetime

    10 % of the time this will show when the fragment starts (Which is incorrect) happenssometimes

    It would be great to have a fix for this, but in lieu of that does anyone know a local solution for this problem? Like manually setting which side the text shows on for a given percentage?

    bug 
    opened by MackHartley 1
Releases(2.1.1)
  • 2.1.1(Apr 13, 2021)

  • 2.1.0(May 7, 2020)

    • CenteredRoundCornerProgressBar added #42
    • IndeterminateRoundCornerProgressBar and IndeterminateCenteredRoundCornerProgressBar added
    • IconRoundCornerProgressBar now support for Bitmap and Drawable for icon
    • Animation for progress update (disable by default) added. This feature applied to all progress bars
    • Gradient progress color support (both primary and secondary progress) added. This feature applied to all progress bars #39
    • Text gravity when inside/outside and text position pririty attribute in TextRoundCornerProgressBar added
    • Integer value support for progress setter (convert to float inside) added
    • Update to Gradle Plugin 3.6.3 and Gradle 5.6.4
    • Migrate from Android Support to AndroidX
    • Still in Java! (will be Kotlin in next version)
    • Fix bug in #43 #20 #74
    • Moved from MavenCentral to JCenter. Please see "Installation" section for new artifact ID
    • All new sample code. You should try it!
    • Add useful annotations for Kotlin
    Source code(tar.gz)
    Source code(zip)
  • v2.0.3(Sep 17, 2015)

  • v2.0.2(Sep 17, 2015)

  • v2.0.1(Sep 17, 2015)

  • v1.2.6(Aug 27, 2015)

  • v1.2.4(Aug 25, 2015)

  • v1.2.3(Aug 25, 2015)

  • 1.2.0(May 17, 2015)

  • 1.0.0(Jan 9, 2015)

Owner
Akexorcist
Lovely android developer who enjoys learning in android technology, habitual article writer about Android development for Android developers in Thailand
Akexorcist
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
A simple lib to create a ring-like progress view with corner edges

ProgressRingView Installation Gradle: dependencies { compile 'com.github.flepsik:progress-ring-view:1.2.1' } Maven: <dependency> <groupId>com.g

null 71 Dec 5, 2021
: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 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
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
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
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
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
A wave view of android,can be used as progress bar.

WaveView ![Gitter](https://badges.gitter.im/Join Chat.svg) A wave view of android,can be used as progress bar. Screenshot APK demo.apk What can be use

Kai Wang 1.3k Dec 28, 2022
Android - An action bar item which acts both as a refresh button and as a progress indicator

RefreshActionItem An action bar item that implements this common pattern: Initially it shows a refresh button. If the button is clicked, a background

Manuel Peinado Gallego 655 Nov 10, 2022
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
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
Arc pointer - simple customized progress bar in the form of an arch

ArcPointer Simple customized progress bar in the form of an arch Demo Quick start Step 1 Gradle: compile 'io.github.dvegasa:arcpointer:1.0.2' Maven:

Ed Khalturin 79 Nov 22, 2022
MusicBar 2.1 0.0 Java view visualize progress bar for sound file like sound cloud

MusicBar Setup dependencies { implementation 'com.oze.music:MusicBar:1.0.5' } Usage Function Description setAnimationChangeListener(OnMusicBarAn

emad 74 Aug 26, 2022
Progress Bar in the shape of regular polygon.

N-SidedProgressBar Progress Bar in the shape of regular polygon. Download The library is available on jcenter. Just add the dependency to your build.g

Kaishu Sahu 69 Jul 25, 2022
a circle progress bar with effect

RingProgress a circle progress bar with effect #Preview ##Usage xml <com.ldoublem.ringPregressLibrary.RingProgress android:id="@+id/ring_prog

ldoublem 629 Nov 14, 2022
An instagram-like segmented progress bar

An instagram-like segmented progress bar

Tiago Ornelas 286 Jan 6, 2023
A feature rich staged progress bar with modifiable steps in between its stages.

StageStepBar A staged progressbar that you can use if you want finer control of the steps in between its stages. You can customize: Number of steps be

Konstantinos Lountzis 19 Dec 30, 2022