Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active Progress Keep Appearing with Value 0 on Android #87

Open
Vikraardiansyah opened this issue Oct 3, 2022 · 7 comments
Open

Active Progress Keep Appearing with Value 0 on Android #87

Vikraardiansyah opened this issue Oct 3, 2022 · 7 comments

Comments

@Vikraardiansyah
Copy link

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 Vikraardiansyah changed the title Active Progress Keep Appearing with Value 0 Active Progress Keep Appearing with Value 0 on Android Oct 3, 2022
@steavenb
Copy link

steavenb commented Oct 28, 2022

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.

@val089
Copy link

val089 commented Nov 16, 2022

I have got the same problem on Android.

@mirek11s
Copy link

Same here

1 similar comment
@troberts-28
Copy link

Same here

@troberts-28
Copy link

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.

@AgnieszkaUzarek
Copy link

AgnieszkaUzarek commented Nov 23, 2023

@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}
    />
  );

@ajay-mandaviya
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants