apps-android-commons
apps-android-commons copied to clipboard
[Bug]: Changes Lost and App Crashes when Switched between Dark-Light Modes in Edit Description and Captions
Summary
In Edit Description and Caption Page when you switch between Dark-Light Modes then the captions are lost and app eventually crashes.
Steps to reproduce
- Open the App
- Go to Any Contribution
- Click on the Edit Icon For the Description
- Switch Dark Mode/Light Mode
- Press the Back Button or Submit Button
Expected behaviour
Edited captions and descriptions should be retained
Actual behaviour
Changes are Lost and the App Crashes
Device name
Xaomi 11 Lite NE
Android version
13
Commons app version
4.2.1-debug-main
Device logs
No response
Screen-shots
https://github.com/commons-app/apps-android-commons/assets/126143257/dd6c8d9c-b8ee-471c-b211-eba587598f4d
Would you like to work on the issue?
Yes
@nicolas-raoul This bug is also related to configuration changes on devices like Dark-Mode and Font Changes, and this seems to be a consistent issue in many activities in the app, I have opened two bugs that I have found because this (Including this one) but overall seems that we aren't handling config changes well in the app as also indicated by @psh , can you please try reproducing this one and assign to me so that I can make the necessary PR to fix this, thanks
Here's a couple of useful links to Google documentation that might help as you're thinking about the problem -
The save UI state documentation includes a helpful table to guide thoughts about whether to use a ViewModel, saved instance state or other persistent storage.
Hi @nicolas-raoul @psh @RitikaPahwa4444 , Please Review the PR so that I can close this issue, thanks
@nicolas-raoul #5503 is solving this issue and is approved , can you please merge it and close this issue, thanks