megalodon
megalodon copied to clipboard
Remember scroll position
Remember scroll position when reading toots, so you can easily read everything after loading new toots.
This would be a game changer!
so basically: when refreshing (when dragging down), don't scroll up, right? will have to look into this, but i'd love this as well!
And it would be perfect if the time line would be loaded from "past to present" so that you could continue scrolling till you're at the newest post.
Related: when switching between two accounts, scroll position is also reset.
For instance:
- I'm in account A, but not on top (there are still posts that I haven't read above)
- I switch to account B
- Then switch back to account A: I am now at the top. My previous position has been lost.
I came from comment https://github.com/mastodon/mastodon-android/pull/680#issuecomment-1712281383 expecting newer Megalodon versions to have this awesome load direction UI and a timeline that remembers / doesn't jump to the top on its own, but sadly it does jump to the top on almost every occasion (going to settings and back, restarting app). Since this issue isn't closed I suppose this remains to be implemented. Big +1, I have yet to find an Android app that does this correctly. Well-behaved apps are sadly iOS-only (Toot!, Metatext).
I can't verify it now, but I think that this used to work when that setting you mentioned was released. For me it stopped working a few weeks ago, or at least the resetting became more frequent. Again I don't know how I'd verify that now but curious if that's been the same for anyone else.
Fedilab on Android does do this correctly I believe.
Thanks @danielfalk, gave Fedilab a try and I can confirm it correctly saves the timeline position remotely to the markers API. However, while Fedilab has code for retrieving the marker, it doesn't use it, instead it relies on a device-only shared preference. In other words, Fedilab's position saving is write-only. Not that I care that much now that I found the one and only app to actually save & restore my timeline position.
I gave the code a look:
- Just like Fedilab, Megalodon saves both the notification & timeline positions to the
markers
API. - Just like Fedilab, Megalodon does not use the (possibly updated) timeline position from the
markers
API. It makes aGET
call but only uses the notification position. - Unlike Fedilab, and this is the most important point and what this issue is about, Megalodon doesn't attempt to remember the timeline position locally whatsoever. This would be a matter of saving it locally (database or shared pref) around here, and patching the timeline loading logic (too complicated to link) to scroll to that position at fragment creation. Fedilab's logic for this FYI.