Skip to content

Commit

Permalink
refactor #605 Remove unused local variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
toastkidjp committed Aug 13, 2020
1 parent cb1cfa9 commit 817102c
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions lib/src/main/java/jp/toastkid/lib/view/SlidingTapListener.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ package jp.toastkid.lib.view
import android.view.MotionEvent
import android.view.View
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

/**
* @author toastkidjp
Expand Down Expand Up @@ -44,15 +42,6 @@ class SlidingTapListener(private val targetView: View) : View.OnTouchListener {
true
}
MotionEvent.ACTION_MOVE -> {
val viewHeight = view.height

val viewParent = view.parent as? View
val parentHeight = viewParent?.height?.toFloat() ?: 0f

var newY = motionEvent.rawY + dY
newY = max(0f, newY)
newY = min(parentHeight - viewHeight, newY)

onNewPosition?.onNewPosition(targetView.x, motionEvent.rawY)
return true
}
Expand Down

0 comments on commit 817102c

Please sign in to comment.