您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

33 行
1.1 KiB

using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.gestures {
public delegate void GestureLongPressCallback();
public class LongPressGestureRecognizer : PrimaryPointerGestureRecognizer {
public LongPressGestureRecognizer(object debugOwner = null, PointerDeviceKind? kind = null) :
base(deadline: Constants.kLongPressTimeout, debugOwner: debugOwner, kind: kind) {
}
public GestureLongPressCallback onLongPress;
protected override void didExceedDeadline() {
this.resolve(GestureDisposition.accepted);
if (this.onLongPress != null) {
this.invokeCallback<object>("onLongPress", () => {
this.onLongPress();
return null;
});
}
}
protected override void handlePrimaryPointer(PointerEvent evt) {
if (evt is PointerUpEvent) {
this.resolve(GestureDisposition.rejected);
}
}
public override string debugDescription {
get { return "long press"; }
}
}
}