Android: Determinate circles disappear after screen display turned off until next update
See original GitHub issueOn Android, when the screen display is turned off, any determinate circles disappear until they are next updated. For determinate circles that are static and never updated, this means they permanently disappear after the screen display is toggled.
See the gif below of the Example app for a visual, with the update timeouts slowed down a bit. Note that the circles disappear until the next timeout update; at the end, after the periodic updates are complete, the circles are permanently gone.
Tested on Android 7.1.1 Nexus 5X simulator, and also seen in external use on Samsung Galaxy S7 and Samsung Galaxy S7 Edge devices running Android 7+.
Any ideas on potential fixes? A hacky solution for now for external apps might be to listen for React Native AppState
updates and force re-rendering of these circles when the app becomes foreground/screen is turned back on, but obviously this is sub-optimal.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:10
Top GitHub Comments
this code fix it(base on @Gringox ‘s comment):
handleAppStateChange = appState => { if (appState === ‘active’) { this.setState({ progress:this.state.progress + 0.0001 }); } };
None of the above recommendations worked for me. Upon further research, this seems to be an issue with the React Native ART library as you can see here https://github.com/facebook/react-native/issues/17565
I ended up fixing this by manually applying the changes from this commit https://github.com/lekamj/react-native-circular-progress/commit/60fc3bcba8f07fffa866f730dddedd5f2da554d8 to the Circle.js file of this library. However, this workaround is not nice at all and I would recommend waiting for the RN team to come out with a more efficient fix