moagrius / TileView

TileView is a subclass of android.view.ViewGroup that asynchronously displays, pans and zooms tile-based images. Plugins are available for features like markers, hotspots, and path drawing.
MIT License
1.46k stars 337 forks source link

Restore position and zoom upon configuration change #511

Closed p-lr closed 5 years ago

p-lr commented 5 years ago

Hey Mike,

So I finally started to upgrade from v2. And boy it's harder than it should be. One of the reasons is that the BitmapProvider type leaked into the core of my business logic (so some classes were coupled with). Anyway, i'm fixing this so TileView-related stuff should be more self-contained.

And I started to see some issues here and there. I will create issues for each one of course. So this one is pretty much self explanatory, the state save-restore was something we added in v2. I can do PR. But for instance I have a lot of things to finish on my app.

moagrius commented 5 years ago

Ok let me know if I can help. Obviously any issue you create will get addressed immediately

moagrius commented 5 years ago

i'll get to this next. i'm out tomorrow but should be able to get started thursday. there's also the wierd scaling past limits thing reported by another user i need to do.

moagrius commented 5 years ago

For documentary purposes (mostly to remind myself). This has been bandaid-ed by suppressing config changes on the activities, but this still needs to be fixed properly with good save and restore instance state logic, which is complicated by the prepare and Builder mechanisms (I think). Both the marker and path plugins all apart currently - I think scroll and scale is fairly straightforward. Note that restore instance state happens well after Activity.onCreate. I suspect it happens before TileView.onReady but am not sure - Probably depends on if there's a diskcache or not.

This is the most important (and possibly last?) outstanding non-trivial bug. I'm targeting Monday, June 10th to deliver a complete fix.

moagrius commented 5 years ago

fixed in 4.0.5