Language

InputMethodService.SetStylusHandwritingRegion(Region) Method

Definition

Sets a new stylus handwriting region as user continues to write on an editor on screen.

[Android.Runtime.Register("setStylusHandwritingRegion", "(Landroid/graphics/Region;)V", "", ApiSince=36)]
public void SetStylusHandwritingRegion(Android.Graphics.Region handwritingRegion);
[<Android.Runtime.Register("setStylusHandwritingRegion", "(Landroid/graphics/Region;)V", "", ApiSince=36)>]
member this.SetStylusHandwritingRegion : Android.Graphics.Region -> unit

Parameters

handwritingRegion
Region

new stylus handwritable Region that can accept stylus touch. This value cannot be null.

Attributes

Remarks

Sets a new stylus handwriting region as user continues to write on an editor on screen. Stylus strokes that are started within the touchableRegion are treated as continuation of handwriting and all the events outside are passed-through to the IME target app, causing stylus handwriting to finish finishStylusHandwriting(). By default, the entire screen area is handwritable and touchableRegion resets after each handwriting session.

For example, the IME can use this API to dynamically expand the stylus handwriting region on every stylus stroke as user continues to write on an editor. The region should grow around the last stroke so that a UI element below the IME window is still interactable when it is spaced sufficiently away (~2 character dimensions) from last stroke.

Note: Setting handwriting touchable region is supported on IMEs that support stylus handwriting InputMethodInfo.supportsStylusHandwriting().

Note: If the IME decides to use this API, it should be updating the desired region accordingly, on configuration changes, such as changes of screen bounds, density.

Android reference for android.inputmethodservice.InputMethodService.setStylusHandwritingRegion.

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