Skip to content

Conversation

@mkevins
Copy link
Contributor

@mkevins mkevins commented Jun 3, 2022

Fixes #16672

Description

This PR saves the instance state for the home page picker's view model to the fragment bundle, since that is what the fragment loads from when it restarts.

To test:

Follow the steps on the issue description to try to reproduce: #16672

Expect that the preview is loaded properly after an orientation change event.

Note:

I have not tested whether we can remove this line which writes to the activity bundle. In my testing, this resolved the issue, but if removing that line does not introduce regressions, it may be a minor optimization to consider along with these changes.

Regression Notes

  1. Potential unintended areas of impact
    None

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    N/A

  3. What automated tests I added (or what prevented me from doing so)
    N/A

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@mkevins mkevins added this to the 20.1 milestone Jun 3, 2022
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jun 3, 2022

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@antonis antonis self-requested a review June 3, 2022 06:27
@mkevins
Copy link
Contributor Author

mkevins commented Jun 3, 2022

I've removed the line that writes the theme picker vm to the activity's bundle. Thanks for testing this Antonis!

Copy link
Contributor

@antonis antonis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @mkevins 👍
Thank you for investigating this and coming up with a clear solution. I've tested the fix on a Pixel 5 (Android 12) and it works as expected. The code changes also look consistent too me 🎉

@peril-wordpress-mobile
Copy link

You can test the changes on this Pull Request by downloading the APKs:

@antonis antonis merged commit 2d3ab46 into feature/site-design-revamp Jun 3, 2022
@antonis antonis deleted the feature/site-design-revamp--fix-preview-orientation-change-bug branch June 3, 2022 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants