|
|
|
|
|
|
base(deadline: Constants.kLongPressTimeout, debugOwner: debugOwner, kind: kind) { |
|
|
|
} |
|
|
|
|
|
|
|
bool _longPressAccepted = false; |
|
|
|
|
|
|
|
public GestureLongPressUpCallback onLongPressUp; |
|
|
|
|
|
|
|
this._longPressAccepted = true; |
|
|
|
|
|
|
|
if (this.onLongPress != null) { |
|
|
|
this.invokeCallback<object>("onLongPress", () => { |
|
|
|
this.onLongPress(); |
|
|
|
|
|
|
|
|
|
|
protected override void handlePrimaryPointer(PointerEvent evt) { |
|
|
|
if (evt is PointerUpEvent) { |
|
|
|
this.resolve(GestureDisposition.rejected); |
|
|
|
if (this._longPressAccepted && this.onLongPressUp != null) { |
|
|
|
this._longPressAccepted = false; |
|
|
|
this.invokeCallback<object>("onLongPressUp", () => { |
|
|
|
this.onLongPressUp(); |
|
|
|
return null; |
|
|
|
}); |
|
|
|
} |
|
|
|
else { |
|
|
|
this.resolve(GestureDisposition.rejected); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (evt is PointerDownEvent || evt is PointerCancelEvent) { |
|
|
|
this._longPressAccepted = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|