Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Data loss errors #1216

Open
Chou95 opened this issue Jan 28, 2023 · 4 comments
Open

Data loss errors #1216

Chou95 opened this issue Jan 28, 2023 · 4 comments
Labels

Comments

@Chou95
Copy link

Chou95 commented Jan 28, 2023

Hi, developers!

general information

the unsaved text will lose after screen rotation, which may reduce user experience (expecially when I have entried lots of text). However, I think that screen rotation shouldn't do damange to the UI state. The re-created UI should be the same as before rotation, Right?

I think it is not hard to save the editable text to Bundle in onPause() (or onSaveInstanceState()) before destroy, and then use edittext.setText() to restore the text.

This may improve the user experience, do you think so?

snapshot details

before rotation

NO1-BEFORE

after rotation

NO1-AFTER

@smichel17
Copy link
Collaborator

smichel17 commented Jan 29, 2023

So this is odd. I can't reproduce on my phone (Galaxy S6). I'm running a quite old version of Android, though. Maybe the EditText behavior changed between versions and needs to be saved explicitly now?

If you'd like to experiment with fixing it and send a PR, it should be pretty isolated to AddTask.kt. binding.taskText is the EditText element. If you need the XML, it's add_task.xml.

@Chou95
Copy link
Author

Chou95 commented Jan 30, 2023

So this is odd. I can't reproduce on my phone (Galaxy S6). I'm running a quite old version of Android, though. Maybe the EditText behavior changed between versions and needs to be saved explicitly now?

If you'd like to experiment with fixing it and send a PR, it should be pretty isolated to AddTask.kt. binding.taskText is the EditText element. If you need the XML, it's add_task.xml.

Thanks for your reply!
The error above comes from (Galaxy S10, android 10). I try it again on my another phone (Mi 10 pro, android 12, video is as follows), and the error still exist! I will try to send a PR if I can fix it successfully when I have time.

video of loss error:

error.video.mp4

@smichel17
Copy link
Collaborator

My phone is still on Android 7.0 😅

@mpcjanssen
Copy link
Owner

You would think that screen rotation is simple, but being Android of course it's not. Screen rotation within the New task activity is indeed not handled properly.

@mpcjanssen mpcjanssen added the bug label Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants