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

Commit 8c476ed7 authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Fix pageMargin in PagedTileLayout

Page margin was being set again from inside PagedTileLayout. Only set at
QSContainerImpl level, based on margins.

As the controller calls updateResources on view attached, they will get
set correctly as soon as the view is attached.

Test: manual
Fixes: 186863859
Change-Id: I8a9f22cc35899ba081bd94c48b3647fc7ae89829
parent ebffd9b9
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@ import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.AttributeSet;
import android.util.Log;
@@ -333,11 +332,6 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {

    @Override
    public boolean updateResources() {
        // Update bottom padding, useful for removing extra space once the panel page indicator is
        // hidden.
        Resources res = getContext().getResources();
        setPageMargin(res.getDimensionPixelOffset(R.dimen.qs_tile_margin_horizontal));

        setPadding(0, 0, 0,
                getContext().getResources().getDimensionPixelSize(
                        R.dimen.qs_paged_tile_layout_padding_bottom));
+3 −2
Original line number Diff line number Diff line
@@ -207,11 +207,12 @@ public class QSContainerImpl extends FrameLayout {
                mContext.getResources().getDimensionPixelSize(R.dimen.qs_container_bottom_padding)
        );

        mSideMargins = getResources().getDimensionPixelSize(R.dimen.notification_side_paddings);
        int sideMargins = getResources().getDimensionPixelSize(R.dimen.notification_side_paddings);
        int padding = getResources().getDimensionPixelSize(
                R.dimen.notification_shade_content_margin_horizontal);
        boolean marginsChanged = padding != mContentPadding;
        boolean marginsChanged = padding != mContentPadding || sideMargins != mSideMargins;
        mContentPadding = padding;
        mSideMargins = sideMargins;
        if (marginsChanged) {
            updatePaddingsAndMargins(qsPanelController, quickStatusBarHeaderController);
        }