tuskyapp / Tusky

An Android client for the microblogging server Mastodon
https://tusky.app
GNU General Public License v3.0
2.5k stars 389 forks source link

Recreate activities on screenLayout change #4689

Closed JimmyJichi closed 2 months ago

JimmyJichi commented 2 months ago

Fixes #4255

Tested on Pixel 9 Pro Fold.

Before

https://github.com/user-attachments/assets/dd4d3a06-fb9f-4d89-94c3-401875cfe6f7

After

https://github.com/user-attachments/assets/dac01631-1add-48f4-9cb9-7365b3da2c9c

connyduck commented 2 months ago

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 commented 2 months ago

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