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

Commit e89b8931 authored by Nicolò Mazzucato's avatar Nicolò Mazzucato Committed by Automerger Merge Worker
Browse files

Merge "Fix last notification trimmed on lockscreen" into tm-dev am: d8a9414b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17182698

Change-Id: I7d6429d01b56ddada295d631a03efd2baf969b5c
parents 1879a0f0 d8a9414b
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -782,6 +782,14 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        y = (int) (mAmbientState.getStackY() + mAmbientState.getStackHeight());
        drawDebugInfo(canvas, y, Color.BLUE,
                /* label= */ "mAmbientState.getStackY() + mAmbientState.getStackHeight() = "+y);

        y = (int) mAmbientState.getStackY() + mContentHeight;
        drawDebugInfo(canvas, y, Color.MAGENTA,
                /* label= */ "mAmbientState.getStackY() + mContentHeight = " + y);

        y = (int) mAmbientState.getStackY() + mIntrinsicContentHeight;
        drawDebugInfo(canvas, y, Color.YELLOW,
                /* label= */ "mAmbientState.getStackY() + mIntrinsicContentHeight = " + y);
    }

    private void drawDebugInfo(Canvas canvas, int y, int color, String label) {
@@ -1293,14 +1301,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
            mOnStackYChanged.accept(listenerNeedsAnimation);
        }
        if (mQsExpansionFraction <= 0 && !shouldSkipHeightUpdate()) {
            final float endHeight = updateStackEndHeight(
                    getHeight(), getEmptyBottomMargin(), mTopPadding);
            final float endHeight = updateStackEndHeight();
            updateStackHeight(endHeight, fraction);
        }
    }

    public float updateStackEndHeight(float height, float bottomMargin, float topPadding) {
        final float stackEndHeight = Math.max(0f, height - bottomMargin - topPadding);
    private float updateStackEndHeight() {
        final float stackEndHeight = Math.max(0f, mIntrinsicContentHeight);
        mAmbientState.setStackEndHeight(stackEndHeight);
        return stackEndHeight;
    }
+0 −11
Original line number Diff line number Diff line
@@ -160,17 +160,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
        doNothing().when(mNotificationShelf).setAnimationsEnabled(anyBoolean());
    }

    @Test
    public void testUpdateStackEndHeight_forEndOfStackHeightAnimation() {
        final float nsslHeight = 10f;
        final float bottomMargin = 1f;
        final float topPadding = 1f;

        mStackScroller.updateStackEndHeight(nsslHeight, bottomMargin, topPadding);
        final float stackEndHeight = nsslHeight - bottomMargin - topPadding;
        assertTrue(mAmbientState.getStackEndHeight() == stackEndHeight);
    }

    @Test
    public void testUpdateStackHeight_withDozeAmount_whenDozeChanging() {
        final float dozeAmount = 0.5f;