apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

[Bug]: Changes Lost and App Crashes when Switched between Dark-Light Modes in Edit Description and Captions

Open shashankiitbhu opened this issue 1 year ago • 4 comments
trafficstars

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

  1. Open the App
  2. Go to Any Contribution
  3. Click on the Edit Icon For the Description
  4. Switch Dark Mode/Light Mode
  5. 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

shashankiitbhu avatar Jan 24 '24 10:01 shashankiitbhu

@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

shashankiitbhu avatar Jan 27 '24 09:01 shashankiitbhu

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.

psh avatar Jan 27 '24 15:01 psh

Hi @nicolas-raoul @psh @RitikaPahwa4444 , Please Review the PR so that I can close this issue, thanks

shashankiitbhu avatar Mar 01 '24 15:03 shashankiitbhu

@nicolas-raoul #5503 is solving this issue and is approved , can you please merge it and close this issue, thanks

shashankiitbhu avatar Mar 27 '24 08:03 shashankiitbhu