Package org.robolectric.shadows
Class ShadowInputMethodManager
- java.lang.Object
-
- org.robolectric.shadows.ShadowInputMethodManager
-
@Implements(android.view.inputmethod.InputMethodManager.class) public class ShadowInputMethodManager extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceShadowInputMethodManager.PrivateCommandListenerHandler for receiving PrivateCommands.static interfaceShadowInputMethodManager.SoftInputVisibilityChangeHandlerHandler for receiving soft input visibility changed event.
-
Constructor Summary
Constructors Constructor Description ShadowInputMethodManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddisplayCompletions(View view, CompletionInfo[] completions)protected voidfocusIn(View view)protected InputMethodSubtypegetCurrentInputMethodSubtype()Returns theInputMethodSubtypethat is installed.protected List<InputMethodInfo>getEnabledInputMethodList()Returns the list ofInputMethodInfothat are enabled.protected List<InputMethodInfo>getInputMethodList()Returns the list ofInputMethodInfothat are installed.protected booleanhideSoftInputFromWindow(IBinder windowToken, int flags)protected booleanhideSoftInputFromWindow(IBinder windowToken, int flags, ResultReceiver resultReceiver)protected booleanisActive()protected booleanisActive(View view)protected booleanisFullscreenMode()booleanisSoftInputVisible()protected voidonViewDetachedFromWindow(View view)protected static InputMethodManagerpeekInstance()static voidreset()protected voidrestartInput(View view)protected voidsendAppPrivateCommand(View view, String action, Bundle data)voidsetAppPrivateCommandListener(ShadowInputMethodManager.PrivateCommandListener listener)voidsetCurrentInputMethodSubtype(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 booleanstartInputInner(int startInputReason, IBinder windowGainingFocus, int startInputFlags, int softInputMode, int windowFlags)protected voidtoggleSoftInput(int showFlags, int hideFlags)
-
-
-
Method Detail
-
showSoftInput
@Implementation protected boolean showSoftInput(View view, int flags)
-
showSoftInput
@Implementation(maxSdk=30) protected boolean showSoftInput(View view, int flags, ResultReceiver resultReceiver)
-
hideSoftInputFromWindow
@Implementation(maxSdk=30) protected boolean hideSoftInputFromWindow(IBinder windowToken, int flags)
-
hideSoftInputFromWindow
@Implementation protected boolean hideSoftInputFromWindow(IBinder windowToken, int flags, ResultReceiver resultReceiver)
-
toggleSoftInput
@Implementation protected void toggleSoftInput(int showFlags, int hideFlags)
-
isSoftInputVisible
public boolean isSoftInputVisible()
-
setSoftInputVisibilityHandler
public void setSoftInputVisibilityHandler(ShadowInputMethodManager.SoftInputVisibilityChangeHandler visibilityChangeHandler)
-
getInputMethodList
@Implementation protected List<InputMethodInfo> getInputMethodList()
Returns the list ofInputMethodInfothat are installed.This method differs from Android implementation by allowing the list to be set using
setInputMethodInfoList(List).
-
setInputMethodInfoList
public void setInputMethodInfoList(List<InputMethodInfo> inputMethodInfoList)
Sets the list ofInputMethodInfothat are marked as installed. SeegetInputMethodList().
-
getCurrentInputMethodSubtype
@Implementation protected InputMethodSubtype getCurrentInputMethodSubtype()
Returns theInputMethodSubtypethat is installed.This method differs from Android implementation by allowing the list to be set using
setCurrentInputMethodSubtype(InputMethodSubtype).
-
setCurrentInputMethodSubtype
public void setCurrentInputMethodSubtype(InputMethodSubtype inputMethodSubtype)
Sets the currentInputMethodSubtypethat will be returned bygetCurrentInputMethodSubtype().
-
getEnabledInputMethodList
@Implementation protected List<InputMethodInfo> getEnabledInputMethodList()
Returns the list ofInputMethodInfothat are enabled.This method differs from Android implementation by allowing the list to be set using
setEnabledInputMethodInfoList(List).
-
setEnabledInputMethodInfoList
public void setEnabledInputMethodInfoList(List<InputMethodInfo> inputMethodInfoList)
Sets the list ofInputMethodInfothat are marked as enabled. SeegetEnabledInputMethodList().
-
restartInput
@Implementation protected void restartInput(View view)
-
isActive
@Implementation protected boolean isActive(View view)
-
isActive
@Implementation protected boolean isActive()
-
isFullscreenMode
@Implementation protected boolean isFullscreenMode()
-
focusIn
@Implementation(maxSdk=29) protected void focusIn(View view)
-
onViewDetachedFromWindow
@Implementation(minSdk=23, maxSdk=29) protected void onViewDetachedFromWindow(View view)
-
displayCompletions
@Implementation protected void displayCompletions(View view, CompletionInfo[] completions)
-
peekInstance
@Implementation(maxSdk=22) protected static InputMethodManager 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
public void setAppPrivateCommandListener(ShadowInputMethodManager.PrivateCommandListener listener)
-
reset
@Resetter public static void reset()
-
-