Class ShadowInputMethodManager

java.lang.Object
org.robolectric.shadows.ShadowInputMethodManager

@Implements(android.view.inputmethod.InputMethodManager.class) public class ShadowInputMethodManager extends Object
Shadow for InputMethodManager.
  • Constructor Details

    • ShadowInputMethodManager

      public ShadowInputMethodManager()
  • Method Details

    • showSoftInput

      @Implementation protected boolean showSoftInput(View view, int flags)
    • 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

      @Implementation(minSdk=34) protected boolean showSoftInput(View view, Object statsToken, int flags, ResultReceiver resultReceiver, int reason)
    • hideSoftInputFromWindow

      @Implementation(minSdk=31, maxSdk=35) protected boolean hideSoftInputFromWindow(IBinder windowToken, int flags, ResultReceiver resultReceiver, int ignoredReason)
    • hideSoftInputFromWindow

      @Implementation(minSdk=36) protected boolean hideSoftInputFromWindow(IBinder windowToken, int flags, ResultReceiver resultReceiver, int ignoredReason, Object statsToken)
    • 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)
    • closeCurrentInput

      @Implementation(minSdk=31) protected void closeCurrentInput()
      The framework implementation does a blocking call to system server. This will deadlock on Robolectric, so just stub out the method.
    • getInputMethodList

      @Implementation protected List<InputMethodInfo> getInputMethodList()
      Returns the list of InputMethodInfo that 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 of InputMethodInfo that are marked as installed. See getInputMethodList().
    • getCurrentInputMethodSubtype

      @Implementation protected InputMethodSubtype getCurrentInputMethodSubtype()
      Returns the InputMethodSubtype that 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 current InputMethodSubtype that will be returned by getCurrentInputMethodSubtype().
    • getEnabledInputMethodList

      @Implementation protected List<InputMethodInfo> getEnabledInputMethodList()
      Returns the list of InputMethodInfo that 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 of InputMethodInfo that are marked as enabled. See getEnabledInputMethodList().
    • 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)
    • 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()