当前位置: 首页>>代码示例>>Java>>正文


Java GestureDescription.Builder方法代码示例

本文整理汇总了Java中android.accessibilityservice.GestureDescription.Builder方法的典型用法代码示例。如果您正苦于以下问题:Java GestureDescription.Builder方法的具体用法?Java GestureDescription.Builder怎么用?Java GestureDescription.Builder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.accessibilityservice.GestureDescription的用法示例。


在下文中一共展示了GestureDescription.Builder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
        }

    }
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:30,代码来源:HelpService.java

示例2: 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

示例3: 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


注:本文中的android.accessibilityservice.GestureDescription.Builder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。