File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
image/src/main/java/com/smarttoolfactory/image/zoom Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -235,7 +235,6 @@ open class BaseEnhancedZoomState constructor(
235235 val velocity = Offset (velocityTracker.x, velocityTracker.y)
236236 var flingStarted = false
237237
238- val bounds = getBounds()
239238 launch {
240239 animatablePanX.animateDecay(
241240 velocity.x,
@@ -251,11 +250,16 @@ open class BaseEnhancedZoomState constructor(
251250 }
252251
253252 launch {
254- val animationResult = animatablePanY.animateDecay(
253+ animatablePanY.animateDecay(
255254 velocity.y,
256- exponentialDecay(
257- absVelocityThreshold = 20f
258- )
255+ exponentialDecay(absVelocityThreshold = 20f ),
256+ block = {
257+ // This callback returns target value of fling gesture initially
258+ if (! flingStarted) {
259+ onFlingStart()
260+ flingStarted = true
261+ }
262+ }
259263 )
260264 }
261265 }
You can’t perform that action at this time.
0 commit comments