Share via


View.HandwritingDelegatorCallback Property

Definition

Returns the callback set by #setHandwritingDelegatorCallback which should be called when a stylus MotionEvent occurs within this view's bounds. -or- Sets a callback which should be called when a stylus MotionEvent occurs within this view's bounds.

public virtual Java.Lang.IRunnable? HandwritingDelegatorCallback { [Android.Runtime.Register("getHandwritingDelegatorCallback", "()Ljava/lang/Runnable;", "GetGetHandwritingDelegatorCallbackHandler", ApiSince=34)] get; [Android.Runtime.Register("setHandwritingDelegatorCallback", "(Ljava/lang/Runnable;)V", "GetSetHandwritingDelegatorCallback_Ljava_lang_Runnable_Handler", ApiSince=34)] set; }
[<get: Android.Runtime.Register("getHandwritingDelegatorCallback", "()Ljava/lang/Runnable;", "GetGetHandwritingDelegatorCallbackHandler", ApiSince=34)>]
[<set: Android.Runtime.Register("setHandwritingDelegatorCallback", "(Ljava/lang/Runnable;)V", "GetSetHandwritingDelegatorCallback_Ljava_lang_Runnable_Handler", ApiSince=34)>]
member this.HandwritingDelegatorCallback : Java.Lang.IRunnable with get, set

Property Value

Attributes

Remarks

Property getter documentation:

Returns the callback set by #setHandwritingDelegatorCallback which should be called when a stylus MotionEvent occurs within this view's bounds. The callback should only be called from the UI thread.

Java documentation for android.view.View.getHandwritingDelegatorCallback().

Property setter documentation:

Sets a callback which should be called when a stylus MotionEvent occurs within this view's bounds. The callback will be called from the UI thread.

Setting a callback allows this view to act as a handwriting delegator, so that handwriting mode for a delegate editor view can be initiated by stylus movement on this delegator view. The callback implementation is expected to show and focus the delegate editor view. If a view which returns true for #isHandwritingDelegate() creates an input connection while the same stylus MotionEvent sequence is ongoing, handwriting mode will be initiated for that view.

A common use case is a custom view which looks like a text editor but does not actually support text editing itself, and clicking on the custom view causes an EditText to be shown. To support handwriting initiation in this case, this method can be called on the custom view to configure it as a delegator. The EditText should call #setIsHandwritingDelegate to set it as a delegate. The callback implementation is typically the same as the click listener implementation which shows the EditText.

If null is passed, this view will no longer act as a handwriting initiation delegator.

Java documentation for android.view.View.setHandwritingDelegatorCallback(java.lang.Runnable).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to