Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recreate activities on screenLayout change #4689

Merged
merged 2 commits into from
Sep 28, 2024

Conversation

JimmyJichi
Copy link
Contributor

Fixes #4255

Tested on Pixel 9 Pro Fold.

Before

screen-20240918-003325.mp4

After

screen-20240918-005909.mp4

@connyduck
Copy link
Collaborator

If it only was that easy 🥺
This should only be done once MainActivity has a ViewModel, otherwise it will reload on every layout change. But this is my top priority, I'll add that soon and then merge this PR.

@JimmyJichi
Copy link
Contributor Author

This should only be done once MainActivity has a ViewModel, otherwise it will reload on every layout change.

I can see a brief reload animation, but the timeline stays where it was. I'd argue that's acceptable. Definitely better than having a broken layout.

output.webm

Copy link
Collaborator

@connyduck connyduck left a comment

Choose a reason for hiding this comment

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

I started working on adding a ViewModel.

Can you please remove the whole android:configChanges from both Activities?

Copy link
Collaborator

@connyduck connyduck left a comment

Choose a reason for hiding this comment

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

thx

@connyduck connyduck merged commit c9355d9 into tuskyapp:develop Sep 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Folding Phone Messes With Layout
2 participants