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

Commit 2e56533b authored by Bart Sears's avatar Bart Sears Committed by Automerger Merge Worker
Browse files

Merge "Move bottom padding from ScrollView to child" into tm-dev am:...

Merge "Move bottom padding from ScrollView to child" into tm-dev am: 8e575eaf am: 4310d341 am: 13dd9532

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



Change-Id: I477e4a8d7196ca145aa1c7678d54bbc383f76532
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a45ea754 13dd9532
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -139,12 +139,11 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {

    void updateResources(QSPanelController qsPanelController,
            QuickStatusBarHeaderController quickStatusBarHeaderController) {
        int bottomPadding = getResources().getDimensionPixelSize(R.dimen.qs_panel_padding_bottom);
        mQSPanelContainer.setPaddingRelative(
                mQSPanelContainer.getPaddingStart(),
                QSUtils.getQsHeaderSystemIconsAreaHeight(mContext),
                mQSPanelContainer.getPaddingEnd(),
                bottomPadding);
                mQSPanelContainer.getPaddingBottom());

        int horizontalMargins = getResources().getDimensionPixelSize(R.dimen.qs_horizontal_margin);
        int horizontalPadding = getResources().getDimensionPixelSize(
+2 −2
Original line number Diff line number Diff line
@@ -362,11 +362,11 @@ public class QSPanel extends LinearLayout implements Tunable {
    protected void updatePadding() {
        final Resources res = mContext.getResources();
        int paddingTop = res.getDimensionPixelSize(R.dimen.qs_panel_padding_top);
        // Bottom padding only when there's a new footer with its height.
        int paddingBottom = res.getDimensionPixelSize(R.dimen.qs_panel_padding_bottom);
        setPaddingRelative(getPaddingStart(),
                paddingTop,
                getPaddingEnd(),
                getPaddingBottom());
                paddingBottom);
    }

    void addOnConfigurationChangedListener(OnConfigurationChangedListener listener) {
+2 −1
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ class QSContainerImplTest : SysuiTestCase() {

    @Test
    fun testContainerBottomPadding() {
        val originalPadding = qsPanelContainer.paddingBottom
        qsContainer.updateResources(
            qsPanelController,
            quickStatusBarHeaderController
@@ -66,7 +67,7 @@ class QSContainerImplTest : SysuiTestCase() {
                anyInt(),
                anyInt(),
                anyInt(),
                eq(mContext.resources.getDimensionPixelSize(R.dimen.footer_actions_height))
                eq(originalPadding)
            )
    }
}
 No newline at end of file
+8 −0
Original line number Diff line number Diff line
@@ -150,6 +150,14 @@ class QSPanelTest : SysuiTestCase() {
        assertThat(footer.isVisibleToUser).isTrue()
    }

    @Test
    fun testBottomPadding() {
        val padding = 10
        context.orCreateTestableResources.addOverride(R.dimen.qs_panel_padding_bottom, padding)
        qsPanel.updatePadding()
        assertThat(qsPanel.paddingBottom).isEqualTo(padding)
    }

    private infix fun View.isLeftOf(other: View): Boolean {
        val rect = Rect()
        getBoundsOnScreen(rect)