/// <summary> /// 没有处理程序的手势 /// </summary> /// <param name="description">手势</param> private static bool GesturesWithoutHandler(GestureDescription description) { //获得当前服务 var service = AutoAccessibilityService.Instance; if (service == null) { return(false); } var result = new CallBackData(); var task = new Task(() => { while (!result.IsEnd) { Task.Delay(100); } }); //回调函数 var callBack = new WithCallBack(result); service.DispatchGesture(description, callBack, null); task.Start(); task.Wait(); return(result.Status); }
private void TryDispatchGesture(GestureDescription gesture) { var retry_count = 1; while (!DispatchGesture(gesture, new SwGestureCallback(), null)) { if (retry_count++ == MAX_GESTURE_RETRIES) { throw new AndroidRuntimeException("Failed to execute gesture"); } } }
public override void OnCompleted(GestureDescription gestureDescription) { Log.Info(TAG, "OnCompleted"); base.OnCompleted(gestureDescription); }
public override void OnCancelled(GestureDescription gestureDescription) { _result.Status = false; _result.IsEnd = true; }
public override void OnCompleted(GestureDescription gestureDescription) { _result.Status = true; _result.IsEnd = true; }
public override void OnCancelled(GestureDescription GestureDescription) { _event.Set(); base.OnCancelled(GestureDescription); }
public void PerformGesture(GestureDescription gesture) { DispatchGesture(gesture, null, null); }