private fun changeTouchableAreaOfView(view: View, extraSpace: Int) {
val parent = view.parent as View
parent.post {
val touchableArea = Rect()
button.getHitRect(touchableArea)
touchableArea.top -= extraSpace
touchableArea.bottom += extraSpace
touchableArea.left -= extraSpace
touchableArea.right += extraSpace
parent.touchDelegate = TouchDelegate(touchableArea, button)
}
}
Created
September 11, 2018 15:40
-
-
Save NielsMasdorp/f0aac6c0644546390cab0ef43123c8b3 to your computer and use it in GitHub Desktop.
Increase touchable area of view without increasing its size
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment