AndroidAccessibility模拟界⾯滑动
2 绘制path
Path mPath = new Path();//线性的path代表⼿势路径,点代表按下,封闭的没⽤
//x y坐标下⾯例⼦是往下滑动界⾯
mPath.lineTo(100,100);//滑动到哪个点
3 模拟绘制⼿势
MainService.mainService.dispatchGesture(new GestureDescription.Builder().addStroke(new GestureDescription.StrokeDescription (mPath, 20, 500)).build(), new AccessibilityService.GestureResultCallback() {
@Override
android模拟点击public void onCompleted(GestureDescription gestureDescription) {
Toast.makeText(TransparentActivity.this, "模拟⼿势成功", Toast.LENGTH_SHORT).show();
}
@Override
public void onCancelled(GestureDescription gestureDescription) {
Toast.makeText(TransparentActivity.this, "模拟⼿势失败",Toast.LENGTH_SHORT).show();
}
}, null);
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论