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

Commit 09fa345c authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Don't clip tiles as pages as scrolled

Test: manual
Fixes: 186536987
Change-Id: I70365e52c09f634a4ba9c62a84e3d39c412333b7
parent d2b8ec4f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -21,5 +21,6 @@
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    android:clipChildren="true"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:paddingBottom="@dimen/qs_paged_tile_layout_padding_bottom" />
+5 −1
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@
        android:elevation="4dp"
        android:importantForAccessibility="no"
        android:scrollbars="none"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:layout_weight="1">
        <com.android.systemui.qs.QSPanel
            android:id="@+id/quick_settings_panel"
@@ -43,7 +45,9 @@
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:focusable="true"
            android:accessibilityTraversalBefore="@android:id/edit">
            android:accessibilityTraversalBefore="@android:id/edit"
            android:clipToPadding="false"
            android:clipChildren="false">
            <include layout="@layout/qs_footer_impl" />
            <include layout="@layout/qs_media_divider"
                android:id="@+id/divider"/>
+7 −15
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@ import android.animation.PropertyValuesHolder;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Rect;
import android.os.Bundle;
import android.util.AttributeSet;
import android.util.Log;
@@ -63,7 +62,6 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
    private int mPageToRestore = -1;
    private int mLayoutOrientation;
    private int mLayoutDirection;
    private final Rect mClippingRect;
    private final UiEventLogger mUiEventLogger = QSEvents.INSTANCE.getQsUiEventsLogger();
    private int mExcessHeight;
    private int mLastExcessHeight;
@@ -78,14 +76,16 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
        setCurrentItem(0, false);
        mLayoutOrientation = getResources().getConfiguration().orientation;
        mLayoutDirection = getLayoutDirection();
        mClippingRect = new Rect();

        // Make sure there's a space between pages when scroling
        setPageMargin(context.getResources().getDimensionPixelOffset(
                    R.dimen.qs_tile_margin_horizontal));
    }
    private int mLastMaxHeight = -1;

    @Override
    public void setPageMargin(int marginPixels) {
        if (marginPixels != getPageMargin()) {
            super.setPageMargin(marginPixels);
        }
    }

    public void saveInstanceState(Bundle outState) {
        outState.putInt(CURRENT_PAGE, getCurrentItem());
    }
@@ -352,14 +352,6 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
        return changed;
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        super.onLayout(changed, l, t, r, b);
        // Clip to margins
        mClippingRect.set(0, 0, (r - l), b - t);
        setClipBounds(mClippingRect);
    }

    @Override
    public boolean setMinRows(int minRows) {
        mMinRows = minRows;
+3 −0
Original line number Diff line number Diff line
@@ -316,6 +316,9 @@ public class QSContainerImpl extends FrameLayout {
            if (view == mQSPanelContainer) {
                // QS panel lays out some of its content full width
                qsPanelController.setContentMargins(mContentPadding, mContentPadding);
                // Set it as double the side margin (to simulate end margin of current page +
                // start margin of next page).
                qsPanelController.setPageMargin(2 * mSideMargins);
            } else if (view == mHeader) {
                // The header contains the QQS panel which needs to have special padding, to
                // visually align them.
+6 −2
Original line number Diff line number Diff line
@@ -480,8 +480,12 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
    private void updateQsBounds() {
        if (mLastQSExpansion == 1.0f) {
            // Fully expanded, let's set the layout bounds as clip bounds. This is necessary because
            // it's a scrollview and otherwise wouldn't be clipped.
            mQsBounds.set(0, 0, mQSPanelScrollView.getWidth(), mQSPanelScrollView.getHeight());
            // it's a scrollview and otherwise wouldn't be clipped. However, we set the horizontal
            // bounds so the pages go to the ends of QSContainerImpl
            ViewGroup.MarginLayoutParams lp =
                    (ViewGroup.MarginLayoutParams) mQSPanelScrollView.getLayoutParams();
            mQsBounds.set(-lp.leftMargin, 0, mQSPanelScrollView.getWidth() + lp.rightMargin,
                    mQSPanelScrollView.getHeight());
        }
        mQSPanelScrollView.setClipBounds(mQsBounds);
    }
Loading