How much would a swipe down/up move a normal vertical RecyclerView/list?

泪湿孤枕 提交于 2019-12-25 09:13:33

问题


Suppose I use this command:

adb shell input touchscreen swipe x1 y1 x1 y2 50 

How can I know how much pixels will it really scroll?

Is there any way to calculate it?


回答1:


The default value of the duration parameter is set to 300ms for a reason - anything less than that and your swipe has a much higher chance to become a fling (also depending on the delta of your coordinates) - which will not be precise and/or consistent.

So there is no way to find out how many pixels your specific (i.e. with shorter than recommended duration) command will scroll ahead of time.



来源:https://stackoverflow.com/questions/39294591/how-much-would-a-swipe-down-up-move-a-normal-vertical-recyclerview-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!