tuskyapp / Tusky

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

Recreate activities on screenLayout change #4689

Open JimmyJichi opened 1 week ago

JimmyJichi commented 1 week 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 1 week 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 1 week 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