Loading core/api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -51075,7 +51075,7 @@ package android.view.inputmethod { method public boolean sendKeyEvent(android.view.KeyEvent); method public boolean setComposingRegion(int, int); method public boolean setComposingText(CharSequence, int); method public default boolean setImeTemporarilyConsumesInput(boolean); method public default boolean setImeConsumesInput(boolean); method public boolean setSelection(int, int); field public static final int CURSOR_UPDATE_IMMEDIATE = 1; // 0x1 field public static final int CURSOR_UPDATE_MONITOR = 2; // 0x2 core/java/android/view/inputmethod/BaseInputConnection.java +2 −2 Original line number Diff line number Diff line Loading @@ -164,12 +164,12 @@ public class BaseInputConnection implements InputConnection { /** * Default implementation calls {@link #finishComposingText()} and * {@code setImeTemporarilyConsumesInput(false)}. * {@code setImeConsumesInput(false)}. */ @CallSuper public void closeConnection() { finishComposingText(); setImeTemporarilyConsumesInput(false); setImeConsumesInput(false); } /** Loading core/java/android/view/inputmethod/InputConnection.java +8 −9 Original line number Diff line number Diff line Loading @@ -1004,20 +1004,19 @@ public interface InputConnection { @Nullable Bundle opts); /** * Called by the input method to indicate that it temporarily consumes all input for itself, * or no longer does so. * Called by the input method to indicate that it consumes all input for itself, or no longer * does so. * * <p>Editors should reflect that they are temporarily not receiving input by hiding the * cursor if {@code imeTemporarilyConsumesInput} is {@code true}, and resume showing the * cursor if it is {@code false}. * <p>Editors should reflect that they are not receiving input by hiding the cursor if * {@code imeConsumesInput} is {@code true}, and resume showing the cursor if it is * {@code false}. * * @param imeTemporarilyConsumesInput {@code true} when the IME is temporarily consuming input * and the cursor should be hidden, {@code false} when input to the editor resumes and the * cursor should be shown again. * @param imeConsumesInput {@code true} when the IME is consuming input and the cursor should be * hidden, {@code false} when input to the editor resumes and the cursor should be shown again. * @return {@code true} on success, {@code false} if the input connection is no longer valid, or * the protocol is not supported. */ default boolean setImeTemporarilyConsumesInput(boolean imeTemporarilyConsumesInput) { default boolean setImeConsumesInput(boolean imeConsumesInput) { return false; } } core/java/android/view/inputmethod/InputConnectionWrapper.java +2 −2 Original line number Diff line number Diff line Loading @@ -341,7 +341,7 @@ public class InputConnectionWrapper implements InputConnection { * @throws NullPointerException if the target is {@code null}. */ @Override public boolean setImeTemporarilyConsumesInput(boolean imeTemporarilyConsumesInput) { return mTarget.setImeTemporarilyConsumesInput(imeTemporarilyConsumesInput); public boolean setImeConsumesInput(boolean imeConsumesInput) { return mTarget.setImeConsumesInput(imeConsumesInput); } } core/java/android/widget/TextView.java +11 −11 Original line number Diff line number Diff line Loading @@ -497,9 +497,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private TextUtils.TruncateAt mEllipsize; // A flag to indicate the cursor was hidden by IME. private boolean mImeTemporarilyConsumesInput; private boolean mImeIsConsumingInput; // Whether cursor is visible without regard to {@link mImeTemporarilyConsumesInput}. // Whether cursor is visible without regard to {@link mImeConsumesInput}. // {code true} is the default value. private boolean mCursorVisibleFromAttr = true; Loading Loading @@ -10506,8 +10506,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener /** * Set whether the cursor is visible. The default is true. Note that this property only * makes sense for editable TextView. If IME is temporarily consuming the input, the cursor will * be always invisible, visibility will be updated as the last state when IME does not consume * makes sense for editable TextView. If IME is consuming the input, the cursor will always be * invisible, visibility will be updated as the last state when IME does not consume * the input anymore. * * @see #isCursorVisible() Loading @@ -10521,20 +10521,20 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } /** * Sets the IME is temporarily consuming the input and make the cursor invisible if * {@code imeTemporarilyConsumesInput} is {@code true}. Otherwise, make the cursor visible. * Sets the IME is consuming the input and make the cursor invisible if {@code imeConsumesInput} * is {@code true}. Otherwise, make the cursor visible. * * @param imeTemporarilyConsumesInput {@code true} if IME is temporarily consuming the input * @param imeConsumesInput {@code true} if IME is consuming the input * * @hide */ public void setImeTemporarilyConsumesInput(boolean imeTemporarilyConsumesInput) { mImeTemporarilyConsumesInput = imeTemporarilyConsumesInput; public void setImeConsumesInput(boolean imeConsumesInput) { mImeIsConsumingInput = imeConsumesInput; updateCursorVisibleInternal(); } private void updateCursorVisibleInternal() { boolean visible = mCursorVisibleFromAttr && !mImeTemporarilyConsumesInput; boolean visible = mCursorVisibleFromAttr && !mImeIsConsumingInput; if (visible && mEditor == null) return; // visible is the default value with no edit data createEditorIfNeeded(); if (mEditor.mCursorVisible != visible) { Loading @@ -10550,7 +10550,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener /** * @return whether or not the cursor is visible (assuming this TextView is editable). This * method may return {@code false} when the IME is temporarily consuming the input even if the * method may return {@code false} when the IME is consuming the input even if the * {@code mEditor.mCursorVisible} attribute is {@code true} or {@code #setCursorVisible(true)} * is called. * Loading Loading
core/api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -51075,7 +51075,7 @@ package android.view.inputmethod { method public boolean sendKeyEvent(android.view.KeyEvent); method public boolean setComposingRegion(int, int); method public boolean setComposingText(CharSequence, int); method public default boolean setImeTemporarilyConsumesInput(boolean); method public default boolean setImeConsumesInput(boolean); method public boolean setSelection(int, int); field public static final int CURSOR_UPDATE_IMMEDIATE = 1; // 0x1 field public static final int CURSOR_UPDATE_MONITOR = 2; // 0x2
core/java/android/view/inputmethod/BaseInputConnection.java +2 −2 Original line number Diff line number Diff line Loading @@ -164,12 +164,12 @@ public class BaseInputConnection implements InputConnection { /** * Default implementation calls {@link #finishComposingText()} and * {@code setImeTemporarilyConsumesInput(false)}. * {@code setImeConsumesInput(false)}. */ @CallSuper public void closeConnection() { finishComposingText(); setImeTemporarilyConsumesInput(false); setImeConsumesInput(false); } /** Loading
core/java/android/view/inputmethod/InputConnection.java +8 −9 Original line number Diff line number Diff line Loading @@ -1004,20 +1004,19 @@ public interface InputConnection { @Nullable Bundle opts); /** * Called by the input method to indicate that it temporarily consumes all input for itself, * or no longer does so. * Called by the input method to indicate that it consumes all input for itself, or no longer * does so. * * <p>Editors should reflect that they are temporarily not receiving input by hiding the * cursor if {@code imeTemporarilyConsumesInput} is {@code true}, and resume showing the * cursor if it is {@code false}. * <p>Editors should reflect that they are not receiving input by hiding the cursor if * {@code imeConsumesInput} is {@code true}, and resume showing the cursor if it is * {@code false}. * * @param imeTemporarilyConsumesInput {@code true} when the IME is temporarily consuming input * and the cursor should be hidden, {@code false} when input to the editor resumes and the * cursor should be shown again. * @param imeConsumesInput {@code true} when the IME is consuming input and the cursor should be * hidden, {@code false} when input to the editor resumes and the cursor should be shown again. * @return {@code true} on success, {@code false} if the input connection is no longer valid, or * the protocol is not supported. */ default boolean setImeTemporarilyConsumesInput(boolean imeTemporarilyConsumesInput) { default boolean setImeConsumesInput(boolean imeConsumesInput) { return false; } }
core/java/android/view/inputmethod/InputConnectionWrapper.java +2 −2 Original line number Diff line number Diff line Loading @@ -341,7 +341,7 @@ public class InputConnectionWrapper implements InputConnection { * @throws NullPointerException if the target is {@code null}. */ @Override public boolean setImeTemporarilyConsumesInput(boolean imeTemporarilyConsumesInput) { return mTarget.setImeTemporarilyConsumesInput(imeTemporarilyConsumesInput); public boolean setImeConsumesInput(boolean imeConsumesInput) { return mTarget.setImeConsumesInput(imeConsumesInput); } }
core/java/android/widget/TextView.java +11 −11 Original line number Diff line number Diff line Loading @@ -497,9 +497,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private TextUtils.TruncateAt mEllipsize; // A flag to indicate the cursor was hidden by IME. private boolean mImeTemporarilyConsumesInput; private boolean mImeIsConsumingInput; // Whether cursor is visible without regard to {@link mImeTemporarilyConsumesInput}. // Whether cursor is visible without regard to {@link mImeConsumesInput}. // {code true} is the default value. private boolean mCursorVisibleFromAttr = true; Loading Loading @@ -10506,8 +10506,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener /** * Set whether the cursor is visible. The default is true. Note that this property only * makes sense for editable TextView. If IME is temporarily consuming the input, the cursor will * be always invisible, visibility will be updated as the last state when IME does not consume * makes sense for editable TextView. If IME is consuming the input, the cursor will always be * invisible, visibility will be updated as the last state when IME does not consume * the input anymore. * * @see #isCursorVisible() Loading @@ -10521,20 +10521,20 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } /** * Sets the IME is temporarily consuming the input and make the cursor invisible if * {@code imeTemporarilyConsumesInput} is {@code true}. Otherwise, make the cursor visible. * Sets the IME is consuming the input and make the cursor invisible if {@code imeConsumesInput} * is {@code true}. Otherwise, make the cursor visible. * * @param imeTemporarilyConsumesInput {@code true} if IME is temporarily consuming the input * @param imeConsumesInput {@code true} if IME is consuming the input * * @hide */ public void setImeTemporarilyConsumesInput(boolean imeTemporarilyConsumesInput) { mImeTemporarilyConsumesInput = imeTemporarilyConsumesInput; public void setImeConsumesInput(boolean imeConsumesInput) { mImeIsConsumingInput = imeConsumesInput; updateCursorVisibleInternal(); } private void updateCursorVisibleInternal() { boolean visible = mCursorVisibleFromAttr && !mImeTemporarilyConsumesInput; boolean visible = mCursorVisibleFromAttr && !mImeIsConsumingInput; if (visible && mEditor == null) return; // visible is the default value with no edit data createEditorIfNeeded(); if (mEditor.mCursorVisible != visible) { Loading @@ -10550,7 +10550,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener /** * @return whether or not the cursor is visible (assuming this TextView is editable). This * method may return {@code false} when the IME is temporarily consuming the input even if the * method may return {@code false} when the IME is consuming the input even if the * {@code mEditor.mCursorVisible} attribute is {@code true} or {@code #setCursorVisible(true)} * is called. * Loading