Package io.flutter.plugin.editing
Class ScribePlugin
java.lang.Object
io.flutter.plugin.editing.ScribePlugin
- All Implemented Interfaces:
ScribeChannel.ScribeMethodHandler
ScribePlugin
is the implementation of all functionality needed for handwriting stylus
text input.
The plugin handles requests for scribe sent by the ScribeChannel
.
On API versions below 33, the plugin does nothing.
-
Constructor Summary
ConstructorsConstructorDescriptionScribePlugin
(View view, InputMethodManager imm, ScribeChannel scribeChannel) -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
boolean
A convenience method to check if Scribe is available.boolean
Returns true if the InputMethodManager supports Scribe stylus handwriting input.void
Sets the View in which Scribe input is handled.void
Starts stylus handwriting input.
-
Constructor Details
-
ScribePlugin
public ScribePlugin(@NonNull View view, @NonNull InputMethodManager imm, @NonNull ScribeChannel scribeChannel)
-
-
Method Details
-
setView
Sets the View in which Scribe input is handled.Only one View can be set at any given time.
-
destroy
public void destroy()Unregisters thisScribePlugin
as theScribeChannel.ScribeMethodHandler
, for theScribeChannel
.Do not invoke any methods on a
ScribePlugin
after invoking this method. -
isStylusHandwritingAvailable
@RequiresApi(34) public boolean isStylusHandwritingAvailable()Returns true if the InputMethodManager supports Scribe stylus handwriting input.Call this or isFeatureAvailable before calling startStylusHandwriting to make sure it's available.
- Specified by:
isStylusHandwritingAvailable
in interfaceScribeChannel.ScribeMethodHandler
-
startStylusHandwriting
@RequiresApi(33) public void startStylusHandwriting()Starts stylus handwriting input.Typically isStylusHandwritingAvailable should be called first to determine whether this is supported by the IME.
- Specified by:
startStylusHandwriting
in interfaceScribeChannel.ScribeMethodHandler
-
isFeatureAvailable
public boolean isFeatureAvailable()A convenience method to check if Scribe is available.Differs from isStylusHandwritingAvailable in that it can be called from any API level without throwing an error.
Call this or isStylusHandwritingAvailable before calling startStylusHandwriting to make sure it's available.
- Specified by:
isFeatureAvailable
in interfaceScribeChannel.ScribeMethodHandler
-