summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ming-Shin Lu <lumark@google.com> 2021-02-18 15:42:50 +0800
committer Ming-Shin Lu <lumark@google.com> 2021-02-18 12:45:08 +0000
commitb575e09f0cdffbbc17a8697c70d01d0c0244f3b7 (patch)
tree16b290873304db06822304e9c479beef971a0277
parentc304c1624dbab0d31f14ac96ec99b886032e53f3 (diff)
Hide Keyboard when the remote input view became invisible
To make hide IME with animation gracefully when collapsing the remote input view with pressing the home key. Fix: 179806766 Test: manual as below steps: 1) Make and install EditTextVariations 2) Launch EditTextVariations, select "Direct Reply" from menu to create remote input. 3) Tapping the remote input view from the notification shade to show keyboard. 4) Pressing home key to collapse the notification shade, verify if keyboard hides with animating. Change-Id: I4cd0b9fc729df952f30400d5138f73d9ad74b577
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java5
1 files changed, 5 insertions, 0 deletions
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 8e833c05b447..320b00af0fc5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java
@@ -561,6 +561,11 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
super.onVisibilityChanged(changedView, visibility);
if (changedView == this && mOnVisibilityChangedListener != null) {
mOnVisibilityChangedListener.accept(visibility == VISIBLE);
+ // Hide soft-keyboard when the input view became invisible
+ // (i.e. The notification shade collapsed by pressing the home key)
+ if (visibility != VISIBLE && !mEditText.isVisibleToUser()) {
+ mEditText.hideIme();
+ }
}
}