Code Monkey home page Code Monkey logo

circleprogressbar's Issues

style这个属性重复了

/res/merged/debug/values/values.xml
Error:(754) Attribute "style" already defined with incompatible format.
Error:(575) Original attribute defined here.
Error:(754) Attribute "style" already defined with incompatible format.
Error:(575) Original attribute defined here.

Not drawing progress with Android sdk version 29

I update sdk version in app gradle

compileSdkVersion 29
    buildToolsVersion '29.0.3'
    defaultConfig {
        ...
        minSdkVersion 21
        targetSdkVersion 29
        ....
    }

Previously was

compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {
        ...
        minSdkVersion 21
        targetSdkVersion 28
        ....
    }

Now CircleProgressBar can't draw progress bar updates. I logged this:

 handleWindowVisibility: no activity for token android.os.BinderProxy@bc6037b
 Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
 Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
 Accessing hidden field Lsun/misc/Unsafe;->theUnsafe:Lsun/misc/Unsafe; (greylist, reflection, allowed)
 Accessing hidden method Lsun/misc/Unsafe;->allocateInstance(Ljava/lang/Class;)Ljava/lang/Object; (greylist, reflection, allowed)
 mapper 3.x is not supported
 handleWindowVisibility: no activity for token android.os.BinderProxy@beccbe1
 Accessing hidden field Landroid/widget/ProgressBar;->mOnlyIndeterminate:Z (greylist, reflection, allowed)
 Accessing hidden field Landroid/widget/ProgressBar;->mIndeterminate:Z (greylist-max-p, reflection, denied)
 java.lang.NoSuchFieldException: No field mIndeterminate in class Landroid/widget/ProgressBar; (declaration of 'android.widget.ProgressBar' appears in /system/framework/framework.jar!classes3.dex)
     at java.lang.Class.getDeclaredField(Native Method)
     at com.dinuscxj.progressbar.CircleProgressBar.adjustIndeterminate(CircleProgressBar.java:220)
     at com.dinuscxj.progressbar.CircleProgressBar.<init>(CircleProgressBar.java:111)
     at java.lang.reflect.Constructor.newInstance0(Native Method)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
     at android.view.LayoutInflater.createView(LayoutInflater.java:854)
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
     at java.lang.reflect.Constructor.newInstance0(Native Method)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
     at android.view.LayoutInflater.createView(LayoutInflater.java:854)
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
     at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
     at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
     at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2698)
     at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:310)
     at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1185)
     at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1354)
     at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1432)
     at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:442)
     at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2167)
     at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1990)
     at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1945)
     at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1816)
     at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:303)
     at androidx.fragment.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:262)
     at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1244)
     at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1092)
     at androidx.viewpager.widget.ViewPager.onMeasure(ViewPager.java:1622)
     at android.view.View.measure(View.java:26415)
     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7845)
     at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
     at android.view.View.measure(View.java:26415)
     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7845)
     at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
     at android.view.View.measure(View.java:26415)
     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7845)
     at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
     at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
     at android.view.View.measure(View.java:26415)
     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7845)
     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
     at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
     at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
     at android.view.View.measure(View.java:26415)
     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7845)
     at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
     at android.view.View.measure(View.java:26415)
     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7845)
     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
     at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
     at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
     at android.view.View.measure(View.java:26415)
     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7845)
     at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
     at com.android.internal.policy.DecorView.onMeasure(DecorView.java:1009)
     at android.view.View.measure(View.java:26415)
     at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:3605)
     at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:2348)
     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2640)
     at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2200)
     at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8999)
     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:996)
     at android.view.Choreographer.doCallbacks(Choreographer.java:794)
     at android.view.Choreographer.doFrame(Choreographer.java:729)
     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:981)
     at android.os.Handler.handleCallback(Handler.java:883)
     at android.os.Handler.dispatchMessage(Handler.java:100)
     at android.os.Looper.loop(Looper.java:237)
     at android.app.ActivityThread.main(ActivityThread.java:7814)
     at java.lang.reflect.Method.invoke(Native Method)
     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068)

I am using version 1.1.1.

implemetation {
    implementation 'com.dinuscxj:circleprogressbar:1.1.1'
}

颜色修改问题

作者好,直接在代码中修改颜色为什么不行啊?直接变成默认的紫色

发现一个bug,Shader设置为RADIAL的时候,如果ProgressStartColor和ProgressEndColor设置的不一样,内部创建RadialGradient会异常

首先,内部的mRadius默认为0,且没有提供setter方法。

当然Demo中没有设置ProgressStartColor和ProgressEndColor,默认是一样的。

虽然在xml里面设置了app:progress_shader="radial"属性,但是不会触发异常,因为在updateProgressShader()方法中判断了,ProgressStartColor和ProgressEndColor一样的话是不会设置Shader,从而不会触发bug。

如果ProgressStartColor和ProgressEndColor设置的不一样,内部创建RadialGradient会异常java.lang.IllegalArgumentException: ending radius must be > 0

45 to 0 instead of 100 to 0

In previous versions i had this and an timer that would go from 45 seconds (full bar) to 0 (empty bar) with no problem,

<com.dinuscxj.progressbar.CircleProgressBar
                android:id="@+id/progress_token"
                android:layout_width="32dp"
                android:layout_height="32dp"
                android:layout_marginBottom="@dimen/spacing_large"
                android:layout_marginTop="@dimen/spacing_mlarge"
                android:max="45"
                app:line_count="45"
                app:line_width="4dp"
                app:progress_background_color="@color/progress_bg"
                app:progress_end_color="@color/progress_green"
                app:progress_start_color="@color/progress_green"
                app:progress_stroke_cap="round"
                app:progress_stroke_width="4dp"
                app:progress_text_color="@android:color/transparent"
                app:style="solid_line" />

in current version this is not possible from the xml, i had to do this from the code:

int progress = (100 * seconds) / 45;
progress_token.setProgress(progress);

set indeterminate to true not working

Thanks for great library. After search a lot, I found this. But now I want to use animation for progressbar, like indeterminate. When set indeterminate to true, not working. Why ? I want to implementation progressbar like Telegram app. Thanks again bro.

Not able to set stroke_width programmatically

I'm extending the class so I don't have to set all the styles every time I use it, but setting stroke width from my sub class doesn't work. Here's my complete class:

class CustomCircleProgressBar(context: Context, attributes: AttributeSet?) : CircleProgressBar(
    context,
    attributes
) {

    constructor(context: Context) : this(context, null)

    init {
        setStyle(SOLID_LINE)
        setProgressStartColor(getContext().getColor(R.color.colorAccent))
        setProgressEndColor(getContext().getColor(R.color.colorAccent))
        setProgressBackgroundColor(getContext().getColor(R.color.colorPrimaryLight))
        setProgressTextColor(getContext().getColor(android.R.color.transparent))
        setProgressStrokeWidth(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 5, getResources().getDisplayMetrics()))
    } 
}

the stroke remains 1dp thin.
Works correctly if set from xml: app:progress_stroke_width="5dp"

Other parameters are working correctly. It appears to me that the problem is due to initPaint() not being called after the new width is set.
Any way I can make it work?

Background color

Hi,
I'm unable to set the background color of the component, I've tried using app:background_color as suggested in the documentation but it gives me a compilation error:
error: attribute background_color (aka com.augury.apusnodeconfiguration.staging:background_color) not found.

JCenter has shutdown

As of May 1, 2021, JCenter is no longer hosting artifacts.

Please migrate the artifacts to Maven Central or an alternate hosting location.

Remove %

Hi. Is possible remove %simbol in text? (after number) Thank you

setProgressBackgroundColor(), setProgressStartColor(), setProgressEndColor() do not seem to be working

Hi @dinuscxj, thanks for this nice library. However, I think that setProgressBackgroundColor(), setProgressStartColor(), setProgressEndColor() are not working.
I am trying to set color like this:

mCircleProgressBar.setDrawBackgroundOutsideProgress(true);
mCircleProgressBar.setProgressBackgroundColor(R.color.colorCircularProgressBarBackground);
mCircleProgressBar.setProgressStartColor(R.color.colorBlack);
mCircleProgressBar.setProgressEndColor(R.color.colorBlack);

Thanks in advance.

文字显示问题

好像视图长宽比不为1的时候, 文字跑到了视图**的地方,但是圆圈还是在视图开始的地方。

Failed to resolve

Failed to resolve: com.dinuscxj:circleprogressbar:1.3.6
Show in Project Structure dialog
Affected Modules: app

Android Studio Flamingo | 2022.2.1 Canary 10

Adding animtion.

Thank you for this project. I would like to know if it's possible to add setting progress with animation.
Thanks in advance,

Change progress to float

When ring is very big - its a problem to animate a progress, because progress percent is Integer and its animating not smoothly

编译报错

  • What went wrong:
    Execution failed for task ':aquarobotman:mergeDebugResources'.

java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
Output: D:\beifen0906\05281629-2.7-to3.0-master-beifen\proj.android\aquarobotman\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1108: error: duplicate value for resource 'attr/style' with config ''.
D:\beifen0906\05281629-2.7-to3.0-master-beifen\proj.android\aquarobotman\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1108: error: resource previously defined here.

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.