|
地板
楼主 |
发表于 2019-5-13 17:24:43
|
只看该作者
我参考的是 实在是不懂java 从火山摸索,可是里面的类绕来绕去,绕晕了
https://blog.csdn.net/weimingjue/article/details/82744146
https://blog.csdn.net/weixin_39147807/article/details/89147034
new GestureDescription.StrokeDescription(path, 200L, 800L,false)主要就是要加上fasle,这个只能在api>=26的基础上使用
private void topGestureClick() {
GestureDescription.Builder builder = new GestureDescription.Builder();
Path path = new Path();
int y = 1200;
int x = 360;
path.moveTo(360, y);
path.lineTo(x += 3, y -= 1000);
GestureDescription gestureDescription = builder
.addStroke(new GestureDescription.StrokeDescription(path, 200L, 800L,false))
.build();
dispatchGesture(gestureDescription, new AccessibilityService.GestureResultCallback() {
@Override
public void onCompleted(GestureDescription gestureDescription) {
super.onCompleted(gestureDescription);
Log.e(TAG, "123===onCompleted" );
handler.postDelayed(new Runnable() {
@Override
public void run() {
leftGestureClick();
}
},3000);
}
@Override
public void onCancelled(GestureDescription gestureDescription) {
Log.e(TAG, "123===onCancelled" );
}
}, new Handler(Looper.getMainLooper()));
}
---------------------
作者:阿健万岁
来源:CSDN
原文:https://blog.csdn.net/weixin_39147807/article/details/89147034
版权声明:本文为博主原创文章,转载请附上博文链接! |
|