Package org.robolectric.shadows
Class ShadowInputMethodManager
java.lang.Object
org.robolectric.shadows.ShadowInputMethodManager
@Implements(value=android.view.inputmethod.InputMethodManager.class,
looseSignatures=true)
public class ShadowInputMethodManager
extends Object
Shadow for InputMethodManager.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceHandler for receiving PrivateCommands.static interfaceHandler for receiving soft input visibility changed event. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThe framework implementation does a blocking call to system server.protected voiddisplayCompletions(View view, CompletionInfo[] completions) protected voidprotected InputMethodSubtypeReturns theInputMethodSubtypethat is installed.protected List<InputMethodInfo>Returns the list ofInputMethodInfothat are enabled.protected List<InputMethodInfo>Returns the list ofInputMethodInfothat are installed.protected booleanhideSoftInputFromWindow(IBinder windowToken, int flags) protected booleanhideSoftInputFromWindow(IBinder windowToken, int flags, ResultReceiver resultReceiver) protected booleanhideSoftInputFromWindow(IBinder windowToken, int flags, ResultReceiver resultReceiver, int ignoredReason) protected booleanisActive()protected booleanprotected booleanbooleanprotected voidonViewDetachedFromWindow(View view) protected static InputMethodManagerstatic voidreset()protected voidrestartInput(View view) protected voidsendAppPrivateCommand(View view, String action, Bundle data) voidvoidsetCurrentInputMethodSubtype(InputMethodSubtype inputMethodSubtype) Sets the currentInputMethodSubtypethat will be returned bygetCurrentInputMethodSubtype().voidsetEnabledInputMethodInfoList(List<InputMethodInfo> inputMethodInfoList) Sets the list ofInputMethodInfothat are marked as enabled.voidsetInputMethodInfoList(List<InputMethodInfo> inputMethodInfoList) Sets the list ofInputMethodInfothat are marked as installed.voidsetSoftInputVisibilityHandler(ShadowInputMethodManager.SoftInputVisibilityChangeHandler visibilityChangeHandler) protected booleanshowSoftInput(View view, int flags) protected booleanshowSoftInput(View view, int flags, ResultReceiver resultReceiver) protected booleanshowSoftInput(View view, int flags, ResultReceiver resultReceiver, int ignoredReason) protected booleanprotected booleanstartInputInner(int startInputReason, IBinder windowGainingFocus, int startInputFlags, int softInputMode, int windowFlags) protected voidtoggleSoftInput(int showFlags, int hideFlags)
-
Constructor Details
-
ShadowInputMethodManager
public ShadowInputMethodManager()
-
-
Method Details
-
showSoftInput
-
showSoftInput
@Implementation(maxSdk=30) protected boolean showSoftInput(View view, int flags, ResultReceiver resultReceiver) -
showSoftInput
@Implementation(minSdk=31, maxSdk=33) protected boolean showSoftInput(View view, int flags, ResultReceiver resultReceiver, int ignoredReason) -
showSoftInput
-
hideSoftInputFromWindow
@Implementation(minSdk=31) protected boolean hideSoftInputFromWindow(IBinder windowToken, int flags, ResultReceiver resultReceiver, int ignoredReason) -
hideSoftInputFromWindow
@Implementation(maxSdk=30) protected boolean hideSoftInputFromWindow(IBinder windowToken, int flags) -
hideSoftInputFromWindow
@Implementation protected boolean hideSoftInputFromWindow(IBinder windowToken, int flags, ResultReceiver resultReceiver) -
toggleSoftInput
-
isSoftInputVisible
public boolean isSoftInputVisible() -
setSoftInputVisibilityHandler
public void setSoftInputVisibilityHandler(ShadowInputMethodManager.SoftInputVisibilityChangeHandler visibilityChangeHandler) -
closeCurrentInput
The framework implementation does a blocking call to system server. This will deadlock on Robolectric, so just stub out the method. -
getInputMethodList
Returns the list ofInputMethodInfothat are installed.This method differs from Android implementation by allowing the list to be set using
setInputMethodInfoList(List). -
setInputMethodInfoList
Sets the list ofInputMethodInfothat are marked as installed. SeegetInputMethodList(). -
getCurrentInputMethodSubtype
Returns theInputMethodSubtypethat is installed.This method differs from Android implementation by allowing the list to be set using
setCurrentInputMethodSubtype(InputMethodSubtype). -
setCurrentInputMethodSubtype
Sets the currentInputMethodSubtypethat will be returned bygetCurrentInputMethodSubtype(). -
getEnabledInputMethodList
Returns the list ofInputMethodInfothat are enabled.This method differs from Android implementation by allowing the list to be set using
setEnabledInputMethodInfoList(List). -
setEnabledInputMethodInfoList
Sets the list ofInputMethodInfothat are marked as enabled. SeegetEnabledInputMethodList(). -
restartInput
-
isActive
-
isActive
-
isFullscreenMode
-
focusIn
-
onViewDetachedFromWindow
-
displayCompletions
-
peekInstance
-
startInputInner
@Implementation(minSdk=24) protected boolean startInputInner(int startInputReason, IBinder windowGainingFocus, int startInputFlags, int softInputMode, int windowFlags) -
sendAppPrivateCommand
@Implementation(minSdk=23) protected void sendAppPrivateCommand(View view, String action, Bundle data) -
setAppPrivateCommandListener
-
reset
-