本文整理汇总了Java中android.accessibilityservice.GestureDescription类的典型用法代码示例。如果您正苦于以下问题:Java GestureDescription类的具体用法?Java GestureDescription怎么用?Java GestureDescription使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GestureDescription类属于android.accessibilityservice包,在下文中一共展示了GestureDescription类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Swipte
import android.accessibilityservice.GestureDescription; //导入依赖的package包/类
public void Swipte(int x1,int y1,int x2,int y2,int time){
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
Log.e(TAG,"Swipte");
GestureDescription.Builder gestureBuilder = new GestureDescription.Builder();
Path path = new Path();
path.moveTo(x1,y1);
path.lineTo(x2,y2);
// if (event.getText() != null && event.getText().toString().contains("1")) {
// //Swipe left
// path.moveTo(rightSizeOfScreen, middleYValue);
// path.lineTo(leftSideOfScreen, middleYValue);
// } else {
// //Swipe right
// path.moveTo(leftSideOfScreen, middleYValue);
// path.lineTo(rightSizeOfScreen, middleYValue);
// }
gestureBuilder.addStroke(new GestureDescription.StrokeDescription(path, 0, time));
dispatchGesture(gestureBuilder.build(), new GestureResultCallback() {
@Override
public void onCompleted(GestureDescription gestureDescription) {
super.onCompleted(gestureDescription);
}
}, null);
}
}
示例2: gesturesAsync
import android.accessibilityservice.GestureDescription; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.N)
public void gesturesAsync(GestureDescription.StrokeDescription... strokes) {
if (mService == null)
return;
GestureDescription.Builder builder = new GestureDescription.Builder();
for (GestureDescription.StrokeDescription stroke : strokes) {
builder.addStroke(stroke);
}
mService.dispatchGesture(builder.build(), null, null);
}
开发者ID:feifadaima,项目名称:https-github.com-hyb1996-NoRootScriptDroid,代码行数:11,代码来源:GlobalActionAutomator.java
示例3: gesturesAsync
import android.accessibilityservice.GestureDescription; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.N)
public void gesturesAsync(Object strokes) {
prepareForGesture();
mGlobalActionAutomator.gesturesAsync((GestureDescription.StrokeDescription[]) strokes);
}
开发者ID:feifadaima,项目名称:https-github.com-hyb1996-NoRootScriptDroid,代码行数:6,代码来源:SimpleActionAutomator.java
示例4: gestures
import android.accessibilityservice.GestureDescription; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.N)
public boolean gestures(GestureDescription.StrokeDescription... strokes) {
if (mService == null)
return false;
GestureDescription.Builder builder = new GestureDescription.Builder();
for (GestureDescription.StrokeDescription stroke : strokes) {
builder.addStroke(stroke);
}
if (mHandler == null) {
return gesturesWithoutHandler(builder.build());
} else {
return gesturesWithHandler(builder.build());
}
}
开发者ID:feifadaima,项目名称:https-github.com-hyb1996-NoRootScriptDroid,代码行数:15,代码来源:GlobalActionAutomator.java
示例5: gesture
import android.accessibilityservice.GestureDescription; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.N)
public boolean gesture(long start, long duration, int[]... points) {
Path path = pointsToPath(points);
return gestures(new GestureDescription.StrokeDescription(path, start, duration));
}
开发者ID:feifadaima,项目名称:https-github.com-hyb1996-NoRootScriptDroid,代码行数:6,代码来源:GlobalActionAutomator.java
示例6: gestureAsync
import android.accessibilityservice.GestureDescription; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.N)
public void gestureAsync(long start, long duration, int[]... points) {
Path path = pointsToPath(points);
gesturesAsync(new GestureDescription.StrokeDescription(path, start, duration));
}
开发者ID:feifadaima,项目名称:https-github.com-hyb1996-NoRootScriptDroid,代码行数:6,代码来源:GlobalActionAutomator.java
示例7: gestures
import android.accessibilityservice.GestureDescription; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.N)
public boolean gestures(Object strokes) {
prepareForGesture();
return mGlobalActionAutomator.gestures((GestureDescription.StrokeDescription[]) strokes);
}
开发者ID:feifadaima,项目名称:https-github.com-hyb1996-NoRootScriptDroid,代码行数:6,代码来源:SimpleActionAutomator.java