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

Commit b7ac6e7f authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Move bottom padding from ScrollView to child

That way, the content will scroll up when obscured by the footer, as it
contains extra blank space for this.

Fixes: 232032549
Test: manual in multiple configurations and devices
Test: atest SystemUITests
Change-Id: I69433e8d84f5a63266e99b0ae0b387355c55e592
parent 47364ef9
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)