Simulate Long press by Touch events

前端 未结 4 1537
执念已碎
执念已碎 2021-02-06 18:08

How can we simulate long press by touch event? or how can we calculate the time that screen is touched, all in ACTION_DOWN state?

4条回答
  •  误落风尘
    2021-02-06 18:56

    You have to count time between ACTION_DOWN and ACTION_UP events. It's impossible to calculate this time only in ACTOIN_DOWN state, cause it's the START event of sequence of events representing TAP of LONG TAP event

提交回复
热议问题