react-native-circular-progress-indicator icon indicating copy to clipboard operation
react-native-circular-progress-indicator copied to clipboard

Active Progress Keep Appearing with Value 0 on Android

Open Vikraardiansyah opened this issue 3 years ago • 7 comments
trafficstars

Screen Shot 2022-10-03 at 17 11 16

the active progress keep appearing even though the value is 0, it's only happen on android

Vikraardiansyah avatar Oct 03 '22 10:10 Vikraardiansyah

I use CircularProgressBase with a custom child element, so did not have issues with the value. However, the progress indicator has shown a similar issue where it remains with an empty progress after all components have loaded.

As a workaround, I used this: useEffect(() => { InteractionManager.runAfterInteractions(() => { progressRef.current.reAnimate(); }); }, []);

I have observed this issue only after upgrading from RN 0.64 to RN 0.70 and enabling Hermes. I did update react-native-reanimated, but not sure if it gets worse when I upgrade.

steavenb avatar Oct 28 '22 00:10 steavenb

I have got the same problem on Android.

val089 avatar Nov 16 '22 11:11 val089

Same here

mirek11s avatar Nov 24 '22 15:11 mirek11s

Same here

troberts-28 avatar Aug 11 '23 07:08 troberts-28

I use CircularProgressBase with a custom child element, so did not have issues with the value. However, the progress indicator has shown a similar issue where it remains with an empty progress after all components have loaded.

As a workaround, I used this: useEffect(() => { InteractionManager.runAfterInteractions(() => { progressRef.current.reAnimate(); }); }, []);

I have observed this issue only after upgrading from RN 0.64 to RN 0.70 and enabling Hermes. I did update react-native-reanimated, but not sure if it gets worse when I upgrade.

This workaround does not work for me. Calling reanimate has no effect on the progress indicator when it gets into this weird state. Interestingly, I'm using several progress indicators around my app, and when one of them displays this behaviour, they all do.

troberts-28 avatar Aug 11 '23 07:08 troberts-28

@Vikraardiansyah i resolve it that when value is 0 i return color as inActiveStrokeColor example which works for me:

const getCircleColor = (percent: number) => {
    switch (true) {
      case percent === 0:
        return palettes.secondary[90];
      case percent > 0 && percent <= 100:
        return 'blue';
      default:
        break;
    }
  };

return (
    <CircularProgress
      initialValue={initialValue}
      value={percent}
      delay={400}
      activeStrokeColor={getCircleColor(percent)}
      inActiveStrokeColor={palettes.secondary[90]}
      maxValue={100}
    />
  );

AgnieszkaUzarek avatar Nov 23 '23 11:11 AgnieszkaUzarek

can be fixed when value is 0 pass transparent colour

const getCircleColor = (percent: number) => { if (percent === 0) { return 'transparent' } else { return '#13565FD9' } }

This work for me.

ajay-mandaviya avatar Jul 24 '24 05:07 ajay-mandaviya