thunderbird-android
thunderbird-android copied to clipboard
Issue with disabling Threaded view in settings
When I disable the Threaded view in display settings, It doesn't apply to the list immediately. I should close the app and open it again to see threaded view disabled.
To Reproduce Steps to reproduce the behavior:
- Go to Settings
- Go to General Settings
- Go to Display
- Uncheck Threaded View
- Back to the messages list
- Settings didn't apply
- We should restart the application to apply
Expected behavior It should apply immediately after uncheck
Environment (please complete the following information):
- K-9 Mail version: 5.803 (28003)
- Android version: 11
- Device: Emulator
- Account type: IMAP
You can fix this by adding a parameter to MessageListActivityAppearance
and initializing it with K9.isThreadedViewEnabled
. If the value changes, the MessageList
activity will be recreated.
https://github.com/k9mail/k-9/blob/51e6820d9289973347c342cab9db763d7fcaee70/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt#L519-L521
I'd love to get a pull request fixing this issue.
My comment from PR #6011 that attempted to fix this issue:
I was wrong in the issue comment. Restarting the activity isn't enough because whether or not to show a threaded list is passed as an argument to
MessageListFragment
.I see two possible ways to fix this issue:
- Create a new instance of
MessageListFragment
with the correct arguments when this situation is detected.- Instead of using a boolean for
ARG_THREADED_LIST
, use an enum with values for "enabled", "disabled" and "use app config".The first option is probably a bit more work. But using it we should also be able to handle the situation where the user is displaying the list of messages in a thread before going to settings and disabling the thread view.