How much would a swipe down/up move a normal verti

2019-09-03 11:01发布

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条回答
虎瘦雄心在
2楼-- · 2019-09-03 11:56

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.

查看更多
登录 后发表回答