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

Combine smooth scroll and scale #523

Closed inneke-dc closed 5 years ago

inneke-dc commented 5 years ago

This is actually a duplicate of #165. That issue was solved but the methods used in the answer are no longer available in the new version of this library.

How would I go about scaling and scrolling to a certain point with an animation? Right now I use

tileView.scale = scale
tileView.scrollTo(scrollX, scrollY)

but that is without animation.

The method smoothScrollTo only scrolls, so I would have to set the scale before calling this but then it looks weird since you seem to start from a random point. The method smoothScaleFromFocalPoint doesn't scroll if the scale is unaltered, and doesn't center the provided coordinates. The ZoomScrollAnimator is a private class, so even though there's a getter for it, I can't call the animate method directly.

Is there any way at the moment to do this? Thanks in advance.

moagrius commented 5 years ago

did you check the ScalingScrollView API? TileView is a subclass of ScalingScrollView. i can double check later today.

if there's nothing for it already, I can add a method smootheScaleAndScrollTo(int x, int y, float scale) either later tonight or tomorrow.

moagrius commented 5 years ago

added smoothScaleAndScrollTo method in 4.0.4, now available. re-open and post back if this does not resolve your issue.

thanks for posting.