*/
private int calculateVisibleType() {
boolean noExpandedChild = mExpandedChild == null;
+
+ if (!noExpandedChild && mContentHeight == mExpandedChild.getHeight()) {
+ return VISIBLE_TYPE_EXPANDED;
+ }
+
if (mIsHeadsUp && mHeadsUpChild != null) {
if (mContentHeight <= mHeadsUpChild.getHeight() || noExpandedChild) {
return VISIBLE_TYPE_HEADSUP;
public RemoteViews cachedBigContentView;
public RemoteViews cachedHeadsUpContentView;
public RemoteViews cachedPublicContentView;
+ public CharSequence remoteInputText;
public Entry(StatusBarNotification n, StatusBarIconView ic) {
this.key = n.getKey();
public void onDefocus() {
mController.removeRemoteInput(mEntry);
+ mEntry.remoteInputText = mEditText.getText();
setVisibility(INVISIBLE);
}
mEditText.setInnerFocusable(true);
mController.addRemoteInput(mEntry);
mEditText.mShowImeOnInputConnection = true;
+ mEditText.setText(mEntry.remoteInputText);
+ mEditText.setSelection(mEditText.getText().length());
mEditText.requestFocus();
}
@Override
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
- if (keyCode == KeyEvent.KEYCODE_BACK) {
+ if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) {
defocusIfNeeded();
+ final InputMethodManager imm = InputMethodManager.getInstance();
+ imm.hideSoftInputFromWindow(getWindowToken(), 0);
+ return true;
}
return super.onKeyPreIme(keyCode, event);
}