GithubHelp home page GithubHelp logo

akexorcist / roundcornerprogressbar Goto Github PK

View Code? Open in Web Editor NEW
2.5K 68.0 371.0 3.21 MB

[Android] Round Corner Progress Bar Library for Android

License: Apache License 2.0

Kotlin 100.00%
java kotlin android android-library

roundcornerprogressbar's Issues

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?

RunTimeException

Hi i'm getting this through Firebase Crash Console, this happens when i put my app in background (recent list) for a while and then open it again after i dont know several minutes, then app crashes, thanks to firebase i can see the error. This is what it shows:

Thanks in advance.

Exception java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ayc.ayc_app/com.ayc.ayc_app.HolderActivity}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.akexorcist.roundcornerprogressbar.common.BaseRoundCornerProgressBar$SavedState
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2209)
android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2269)
android.app.ActivityThread.access$800 (ActivityThread.java:139)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1210)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:136)
android.app.ActivityThread.main (ActivityThread.java:5102)
java.lang.reflect.Method.invokeNative (Method.java)
java.lang.reflect.Method.invoke (Method.java:515)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:803)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:619)
dalvik.system.NativeStart.main (NativeStart.java)
arrow_drop_down
Caused by android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.akexorcist.roundcornerprogressbar.common.BaseRoundCornerProgressBar$SavedState
android.os.Parcel.readParcelableCreator (Parcel.java:2154)
android.os.Parcel.readParcelable (Parcel.java:2104)
android.view.AbsSavedState.<init> (AbsSavedState.java:57)
android.view.View$BaseSavedState.<init> (View.java:18779)
com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$SavedState.<init> (TextRoundCornerProgressBar.java:318)
com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$SavedState.<init> (TextRoundCornerProgressBar.java:306)
com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$SavedState$1.createFromParcel (TextRoundCornerProgressBar.java:340)
com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$SavedState$1.createFromParcel (TextRoundCornerProgressBar.java:338)
android.os.Parcel.readParcelable (Parcel.java:2111)
android.os.Parcel.readValue (Parcel.java:2020)
android.os.Parcel.readSparseArrayInternal (Parcel.java:2382)
android.os.Parcel.readSparseArray (Parcel.java:1742)
android.os.Parcel.readValue (Parcel.java:2077)
android.os.Parcel.readArrayMapInternal (Parcel.java:2321)
android.os.Bundle.unparcel (Bundle.java:249)
android.os.Bundle.getSparseParcelableArray (Bundle.java:1275)
android.support.v4.app.FragmentManagerImpl.moveToState (FragmentManager.java:997)
android.support.v4.app.FragmentManagerImpl.moveToState (FragmentManager.java:1252)
android.support.v4.app.FragmentManagerImpl.moveToState (FragmentManager.java:1234)
android.support.v4.app.FragmentManagerImpl.dispatchCreate (FragmentManager.java:2041)
android.support.v4.app.Fragment.performCreate (Fragment.java:1964)
android.support.v4.app.FragmentManagerImpl.moveToState (FragmentManager.java:1029)
android.support.v4.app.FragmentManagerImpl.moveToState (FragmentManager.java:1252)
android.support.v4.app.FragmentManagerImpl.moveToState (FragmentManager.java:1234)
android.support.v4.app.FragmentManagerImpl.dispatchCreate (FragmentManager.java:2041)
android.support.v4.app.FragmentController.dispatchCreate (FragmentController.java:163)
android.support.v4.app.FragmentActivity.onCreate (FragmentActivity.java:331)
android.support.v7.app.AppCompatActivity.onCreate (AppCompatActivity.java:85)
com.ayc.ayc_app.HolderActivity.onCreate (HolderActivity.java:45)
android.app.Activity.performCreate (Activity.java:5248)
android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1110)
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2173)
android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2269)
android.app.ActivityThread.access$800 (ActivityThread.java:139)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1210)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:136)
android.app.ActivityThread.main (ActivityThread.java:5102)
java.lang.reflect.Method.invokeNative (Method.java)
java.lang.reflect.Method.invoke (Method.java:515)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:803)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:619)
dalvik.system.NativeStart.main (NativeStart.java)

Parcelable error when reloading app back from stack and has been cleared by the os

Caused by: java.lang.RuntimeException: Parcel android.os.Parcel@1b179a5d: Unmarshalling unknown type code 7471204 at offset 1112

STR:
Enable Don't keep activities in Developer options. Start the app and go to activity with the rc progressbar.
Get out of app and go back to it. crash.

From what i gathered
Happens due to progaurd

Need to add

-keepclassmembers class * implements android.os.Parcelable {
static ** CREATOR;
}

in progaurd-rules

Add view instead of icon

Hello, nice work. I would like to suggest an addition. Instead of adding an icon at the beginning of progress bar, why not to add a TextView or another view.

Or is it already implemented?

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

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)

progress and max value on first inflate

I came to a issue where I was trying to get progress value on first inflation but I was getting only default value (0.0), not the one I set in xml. The problem got solved by chaning position of if branch

if (!isProgressSetBeforeDraw) { 
            progress = typedArray.getFloat(R.styleable.RoundCornerProgress_rcProgress, DEFAULT_CURRENT_PROGRESS);
            secondaryProgress = typedArray.getFloat(R.styleable.RoundCornerProgress_rcSecondaryProgress, DEFAULT_SECONDARY_PROGRESS);
        }

if (!isProgressColorSetBeforeDraw) {
            setProgressColor(
                    typedArray.getColor(R.styleable.RoundCornerProgress_rcProgressColor, DEFAULT_PROGRESS_COLOR),
                    typedArray.getColor(R.styleable.RoundCornerProgress_rcSecondaryProgressColor, DEFAULT_SECONDARY_PROGRESS_COLOR)
            );
        }

if (!isMaxProgressSetBeforeDraw) {
            max = typedArray.getFloat(R.styleable.RoundCornerProgress_rcMax, DEFAULT_MAX_PROGRESS);
        }

in file https://github.com/akexorcist/Android-RoundCornerProgressBar/blob/master/library/src/main/java/com/akexorcist/roundcornerprogressbar/common/BaseRoundCornerProgressBar.java

TextRoundCornerProgressBar alignment of text .

I have used TextRoundCornerProgressBar and i want to suggest a enhancement of text gravity .
Currently it's rendering left of progress view and we can add this alignment as per user oriented like left,right or center.

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

Animation

Any plans of adding animation effects in the near future?

ProgressColor is not showing properly

I use the color code #1577F0 (blue) but it seems to be drawing with #36303F (tuna), screenshot and code below

Screenshot => http://i.imgur.com/jf1c8PD.png

Code

    productionDetailProgressBar.setProgressColor(R.color.colorPrimary);
    productionDetailProgressBar.setMax(100);

And in xml

    <com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar
            android:id="@+id/progress_1"
            android:layout_width="match_parent"
            android:layout_height="30dp"
            android:padding="8dp" />

Can the progress bar be vertical?

Wondering if the pb can be rotated that way be display vertical sided?
I mean programmatically can be done by setRotation() method, the thing its i need like 5 progress bar's in conjuction and need them perfectly aligned one after another one.

Great work

there is no progress happening.

hi,

I'm trying to use your library to implement a loading bar. However, when I use settings like :

  1. layout_width = "fill_parent"
  2. layout weight = 1 along with layout_width = 0

I don't see any progress happening. Just an empty bar.

But when I explicitly put for example layout_width = 250dp , then it works without any problem. Here is a image of my layout xml :

http://imgur.com/3odBve4

Any suggestions? thank yoi

android.os.BadParcelableException: ClassNotFoundException when unmarshalling

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.routeyou.startup/com.routeyou.ui.DownloadRouteActivity}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.akexorcist.roundcornerprogressbar.common.BaseRoundCornerProgressBar$SavedState at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3184) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3294) at android.app.ActivityThread.access$1000(ActivityThread.java:210) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1704) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6938) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) Caused by android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.akexorcist.roundcornerprogressbar.common.BaseRoundCornerProgressBar$SavedState at android.os.Parcel.readParcelableCreator(Parcel.java:2295) at android.os.Parcel.readParcelable(Parcel.java:2245) at android.view.AbsSavedState.<init>(AbsSavedState.java:57) at android.view.View$BaseSavedState.<init>(View.java:21487) at com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$SavedState.<init>(TextRoundCornerProgressBar.java:318) at com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$SavedState.<init>(TextRoundCornerProgressBar.java:306) at com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$SavedState$1.createFromParcel(TextRoundCornerProgressBar.java:340) at com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar$SavedState$1.createFromParcel(TextRoundCornerProgressBar.java:338) at android.os.Parcel.readParcelable(Parcel.java:2252) at android.os.Parcel.readValue(Parcel.java:2152) at android.os.Parcel.readSparseArrayInternal(Parcel.java:2546) at android.os.Parcel.readSparseArray(Parcel.java:1874) at android.os.Parcel.readValue(Parcel.java:2209) at android.os.Parcel.readArrayMapInternal(Parcel.java:2485) at android.os.BaseBundle.unparcel(BaseBundle.java:221) at android.os.Bundle.getSparseParcelableArray(Bundle.java:822) at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:2290) at android.app.Activity.onRestoreInstanceState(Activity.java:1170) at android.app.Activity.performRestoreInstanceState(Activity.java:1115) at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1190) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3157) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3294) at android.app.ActivityThread.access$1000(ActivityThread.java:210) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1704) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6938) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

Skew Line

It's possible to do it with this library?

image

Use as SeekBar

Is it possible to use this libraries ProgressBar as a SeekBar?
If it's not a built in feature, how easy would it be to implement such a ability?

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)

When padding is changed pragmatically it does not refresh the view

To start, love the library. I am changing the padding of the progressbar pragmatically and it does not refresh the view to match the progress. How would I solve this issue. I will post two photos of the issue.

The progress bar is below the toolbar. I have set the max to 100 and progress to 50
device-2015-03-15-142740

Here is what the progress bar looks like when I change the padding on the left and right of it.
device-2015-03-15-142816

Typos in readme

  1. Usage of rcReverse is reversed.
  2. In the example at the bottom, layout_width and layout_height are switched.

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.

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??

Corners still showing up even radius set ,

im using 2.0.2, since its the only one that worked properly, but im having problems with corners, even when the radius is set, the bars corners do change by the bars view itself has corners , not sure how to get rid of it, i tried changing the background of it to transparent but does nothing ,

drawPrimaryProgress called twice with same parameters

Hi,

In onSizeChanged, there are 2 calls to drawPrimaryProgress with same parameters. The calls are on different threads , if I remove one of them the progress is not drawn. Why does the postDelayed needed? Why doesnt the first call take effect? I am asking because the postDelayed call causes an unwanted blink.

Thanks.

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

Progress not showing after VISIBLE from GONE

When I set GONE visibility on the progressbar or the surrounding layout ,when visibility is set back to visible progress is not showing.Working normaly when INVISIBLE and back to VISIBLE ,but with GONE has a problem

Icon bug

I created an IconProgressBar. If I start the activity the icon is show very big for like a half second in the middle of the screen and dissapears then. This looks awful.

width Animation

Hey, how can I animate the whole progressBar?
I want to set the width from 0 to match parent with an animation.

Anyone knows how?

fix google play link

there is l end of google play link and cause of google couldn't find this library on play store, fix it 👍

Progress bar does not move ahead

I have set rcMax as app:rcMax="10000"

and when I try to set progress such as 6000 the progress bar is stuck at a level of 5000

RuntimeException: Parcel android.os.Parcel@3d770ee5: Unmarshalling unknown type code 7471204 at offset 2264

There is some issues with view state restoring:

SavedState of BaseRoundCornerProgressBar does not write all the values in write in writeToParcel,
correct code is:

        public void writeToParcel(Parcel out, int flags) {
            super.writeToParcel(out, flags);
            out.writeFloat(this.max);
            out.writeFloat(this.progress);
            out.writeFloat(this.secondaryProgress);

            out.writeInt(this.backgroundWidth);
            out.writeInt(this.backgroundHeight);
            out.writeInt(this.radius);
            out.writeInt(this.padding);
            out.writeInt(this.progressColor);
            out.writeInt(this.secondaryProgressColor);
            out.writeInt(this.backgroundColor);

            out.writeInt(this.layoutBackgroundColor);
            out.writeInt(this.layoutProgress);
            out.writeInt(this.layoutSecondaryProgress);

            out.writeByte((byte) (this.isProgressBarCreated ? 1 : 0));
            out.writeByte((byte) (this.isProgressSetBeforeDraw ? 1 : 0));
            out.writeByte((byte) (this.isMaxProgressSetBeforeDraw ? 1 : 0));
            out.writeByte((byte) (this.isBackgroundColorSetBeforeDraw ? 1 : 0));
            out.writeByte((byte) (this.isProgressColorSetBeforeDraw ? 1 : 0));
            out.writeByte((byte) (this.isScreenMeasure ? 1 : 0));
            out.writeByte((byte) (this.isBackgroundLayourSet ? 1 : 0));
        }

After fixing this issue I am getting other issues with IconRoundCornerProgressBar
Caused by: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.ake
xorcist.roundcornerprogressbar.common.BaseRoundCornerProgressBar$SavedState
E at android.os.Parcel.readParcelableCreator(Parcel.java:2289)
E at android.os.Parcel.readParcelable(Parcel.java:2239)
E at android.view.AbsSavedState.(AbsSavedState.java:57)
E at android.view.View$BaseSavedState.(View.java:20038)
E at com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar$SavedState.(IconRo
undCornerProgressBar.java:216)
E at com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar$SavedState.(IconRo
undCornerProgressBar.java:202)
E at com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar$SavedState$1.createFromP
arcel(IconRoundCornerProgressBar.java:240)
E at com.akexorcist.roundcornerprogressbar.IconRoundCornerProgressBar$SavedState$1.createFromP
arcel(IconRoundCornerProgressBar.java:238)
E at android.os.Parcel.readParcelable(Parcel.java:2246)
E at android.os.Parcel.readValue(Parcel.java:2146)
E at android.os.Parcel.readSparseArrayInternal(Parcel.java:2540)
E at android.os.Parcel.readSparseArray(Parcel.java:1868)
E at android.os.Parcel.readValue(Parcel.java:2203)
E at android.os.Parcel.readArrayMapInternal(Parcel.java:2479)
E at android.os.BaseBundle.unparcel(BaseBundle.java:221)
E at android.os.Bundle.getSparseParcelableArray(Bundle.java:871)
E at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1979)
E at android.app.Activity.onRestoreInstanceState(Activity.java:1022)
E at android.app.Activity.performRestoreInstanceState(Activity.java:977)
E at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1161)
E at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2271)

All tested with the sample prject and with don't keep actitivties activated

Vertical progressbar

I would like to implement this progress bar but with a vertical orientation.

Is that possible? If so what syntax would i need?

Thanks in advance

Centered Progress Bar

Hello, I made a temporary implementation while waiting for the request to be evaluated.
This is a simple tutorial in which you will need to create some custom files.

Step 1 : setup

Create a class with a custom name. In example, let's say CenteredProgressBar.java.
What you need is:

  • to extend com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar:

    import com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar;
    
    public class CenteredProgressBar extends RoundCornerProgressBar {
    
    }
  • to create two constructors matching super class:

    public CenteredProgressBar(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
    
    public CenteredProgressBar(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    since @akexorcist uses them both and we need to use them

  • to override the drawProgress method, using MarginLayoutParams to simulate a left margin equal to (max width - current width) / 2:

    @SuppressWarnings("deprecation")
    @Override
    protected void drawProgress(LinearLayout layoutProgress, float max, float progress, float totalWidth,
                                int radius, int padding, int colorProgress, boolean isReverse) {
    
        super.drawProgress(layoutProgress, max, progress, totalWidth, radius, padding, colorProgress, isReverse);
        MarginLayoutParams params = (MarginLayoutParams) layoutProgress.getLayoutParams();
    
        float ratio = max / progress;
        float progressWidth = (totalWidth - (padding * 2)) / ratio;
        float deltaWidth = totalWidth - progressWidth;
    
        params.setMargins((int) (deltaWidth / 2), params.topMargin, (int) (deltaWidth / 2), params.bottomMargin);
        layoutProgress.setLayoutParams(params);
    }

Step 2 : use it!

It's simple! Just call your custom object in your layout.

<com.your.app.package.CenteredProgressBar
                    android:layout_width="80dp"
                    android:layout_height="8dp"
                    android:layout_gravity="center_horizontal|center_vertical"
                    android:layout_margin="8dp"
                    xmlns:app="http://schemas.android.com/apk/res-auto"
                    app:rcBackgroundPadding="1dp"
                    app:rcBackgroundColor="#000000"
                    app:rcProgress="0.3"
                    app:rcMax="1" />

Demo

Here is an example. The grey background is from my external layout, you would not see it if you copy paste.

aaa

The gradient bar color is explained in another issue: #39

I would like to give my thanks to @akexorcist for his awesome work. It really boosted my app development!

There is still error on older versions

Hi guys,

I am using your widget on my app. In android 2.3.7 version, I have an error although I use 1.1.0 version. It crashes while inflating the view. And there is logcat below:

882-882/com.sembozdemir.dortislem E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.NoSuchMethodError: android.view.ViewTreeObserver.removeOnGlobalLayoutListener
            at com.akexorcist.roundcornerprogressbar.RoundCornerProgressBar$1.onGlobalLayout(RoundCornerProgressBar.java:109)
            at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:549)
            at android.view.ViewRoot.performTraversals(ViewRoot.java:1189)
            at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:130)
            at android.app.ActivityThread.main(ActivityThread.java:3683)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:507)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
            at dalvik.system.NativeStart.main(Native Method)

by the way: Click here if you want to see the app

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.

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.