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

Commit 0d107ce0 authored by Kyrylo Mikos's avatar Kyrylo Mikos
Browse files

SystemUI: Improve HeadsUp expanding performance.

Change-Id: Ifd31caca6d2eb2432772b6a63f6b545f8288f449
parent 9c16fe04
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -510,7 +510,6 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
        }
        mExpanding = true;
        if (DEBUG) Log.d(TAG, "scale type " + expandType + " beginning on view: " + v);
        mCallback.setUserLockedChild(v, true);
        setView(v);
        setGlow(GLOW_BASE);
        mScaler.setView(v);
@@ -522,11 +521,16 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
            if (DEBUG) Log.d(TAG, "working on a non-expandable child");
            mNaturalHeight = mOldHeight;
        }
        mCallback.setUserLockedChild(v, true);
        if (DEBUG) Log.d(TAG, "got mOldHeight: " + mOldHeight +
                    " mNaturalHeight: " + mNaturalHeight);
        v.getParent().requestDisallowInterceptTouchEvent(true);
    }

    public float getNaturalHeight() {
        return mNaturalHeight;
    }

    private void finishExpanding(boolean force) {
        if (!mExpanding) return;

+5 −0
Original line number Diff line number Diff line
@@ -207,6 +207,11 @@ public class HeadsUpNotificationView extends FrameLayout implements SwipeHelper.
    public void setUserLockedChild(View v, boolean userLocked) {
        if (mHeadsUp != null && mHeadsUp.row == v) {
            mHeadsUp.row.setUserLocked(userLocked);

            setMinimumHeight(userLocked
                    ? (int) mExpandHelper.getNaturalHeight() + mContentHolder.getPaddingTop()
                            + mContentHolder.getPaddingBottom()
                    : 0);
        }
    }