Getting the pressure with which a button gets pressed

前端 未结 1 1903
不思量自难忘°
不思量自难忘° 2021-01-28 06:28

Is there an easy way in android to get the pressure that the user extended during an onClick event?

相关标签:
1条回答
  • 2021-01-28 06:40

    If you add an MotionEvent listener to your button you can ask for pressure from the MotionEvent.

    Relevant docs:

    http://developer.android.com/reference/android/view/View.OnTouchListener.html

    http://developer.android.com/reference/android/view/MotionEvent.html#getPressure()

    0 讨论(0)
提交回复
热议问题