Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 777ef568 authored by Adrian Roos's avatar Adrian Roos
Browse files

More inline reply goodness

- Use expanded view instead of HUN when possible
- Remember partial replies
- Back properly closes IME without closing shade
- Fix broken reorder animation

Bug: 22452379
Change-Id: Idb6ca8aed27cfb1f3d9b46f59e148b1b3b112fa7
parent 1cffc196
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -426,6 +426,11 @@ public class NotificationContentView extends FrameLayout {
     */
    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;
+1 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ public class NotificationData {
        public RemoteViews cachedBigContentView;
        public RemoteViews cachedHeadsUpContentView;
        public RemoteViews cachedPublicContentView;
        public CharSequence remoteInputText;

        public Entry(StatusBarNotification n, StatusBarIconView ic) {
            this.key = n.getKey();
+7 −1
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene

    public void onDefocus() {
        mController.removeRemoteInput(mEntry);
        mEntry.remoteInputText = mEditText.getText();
        setVisibility(INVISIBLE);
    }

@@ -171,6 +172,8 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
        mEditText.setInnerFocusable(true);
        mController.addRemoteInput(mEntry);
        mEditText.mShowImeOnInputConnection = true;
        mEditText.setText(mEntry.remoteInputText);
        mEditText.setSelection(mEditText.getText().length());
        mEditText.requestFocus();
    }

@@ -216,8 +219,11 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene

        @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);
        }
+1 −1
Original line number Diff line number Diff line
@@ -1860,7 +1860,7 @@ public class NotificationStackScrollLayout extends ViewGroup
            }
            mNeedsAnimation = true;
        }
        if (isHeadsUp(child)) {
        if (isHeadsUp(child) && !mChangePositionInProgress) {
            mAddedHeadsUpChildren.add(child);
            mChildrenToAddAnimated.remove(child);
        }