diff options
3 files changed, 20 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java index 5477468505a4..285f639224f6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java @@ -315,8 +315,7 @@ public class NotificationContentView extends FrameLayout { * @return The extra height needed. */ private int getExtraRemoteInputHeight(RemoteInputView remoteInput) { - if (remoteInput != null && remoteInput.getVisibility() == VISIBLE - && remoteInput.isActive()) { + if (remoteInput != null && (remoteInput.isActive() || remoteInput.isSending())) { return getResources().getDimensionPixelSize( com.android.internal.R.dimen.notification_content_margin); } @@ -1705,7 +1704,10 @@ public class NotificationContentView extends FrameLayout { if (mHeadsUpChild == null) { viewType = VISIBLE_TYPE_CONTRACTED; } - return getViewHeight(viewType) + getExtraRemoteInputHeight(mHeadsUpRemoteInput); + // The headsUp remote input quickly switches to the expanded one, so lets also include that + // one + return getViewHeight(viewType) + getExtraRemoteInputHeight(mHeadsUpRemoteInput) + + getExtraRemoteInputHeight(mExpandedRemoteInput); } public void setRemoteInputVisible(boolean remoteInputVisible) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java b/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java index cfc69a8f67a9..b0d55361299a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java @@ -165,6 +165,16 @@ public class RemoteInputController { return mSpinning.containsKey(key); } + /** + * Same as {@link #isSpinning}, but also verifies that the token is the same + * @param key the key that is spinning + * @param token the token that needs to be the same + * @return if this key with a given token is spinning + */ + public boolean isSpinning(String key, Object token) { + return mSpinning.get(key) == token; + } + private void apply(NotificationData.Entry entry) { mDelegate.setRemoteInputActive(entry, isRemoteInputActive(entry)); boolean remoteInputActive = isRemoteInputActive(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java index a794e1977891..59bf982bcfdb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java @@ -285,12 +285,12 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene if (mWrapper != null) { mWrapper.setRemoteInputVisible(true); } - mController.addRemoteInput(mEntry, mToken); mEditText.setInnerFocusable(true); mEditText.mShowImeOnInputConnection = true; mEditText.setText(mEntry.remoteInputText); mEditText.setSelection(mEditText.getText().length()); mEditText.requestFocus(); + mController.addRemoteInput(mEntry, mToken); updateSendButton(); } @@ -466,6 +466,10 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene } } + public boolean isSending() { + return getVisibility() == VISIBLE && mController.isSpinning(mEntry.key, mToken); + } + /** * An EditText that changes appearance based on whether it's focusable and becomes * un-focusable whenever the user navigates away from it or it becomes invisible. |