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

Commit 93f33c93 authored by eray orçunus's avatar eray orçunus Committed by Luca Stefani
Browse files

SystemUI: Fix several layout bugs



* QSDetail and QSCustomize panels' clippers starts after the black
  header, but the ripple animation coords were wrong.

* QSDetail and QSCustomize use a transparent view to let QS header
  be seen. Header's height changes with orientation, but QSDetail
  and QSCustomize do nothing about it.
  As a result, there were gaps or blocked views.

Change-Id: I5cefad14b519be99adcf5c913e96385d45b8fb17
Signed-off-by: default avatareray orçunus <erayorcunus@gmail.com>
parent f64d206d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@

<merge xmlns:android="http://schemas.android.com/apk/res/android">->
    <View
        android:id="@+id/qs_customizer_top_space"
        android:layout_width="match_parent"
        android:layout_height="@*android:dimen/quick_qs_offset_height"
        android:background="@android:color/transparent" />
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
    android:elevation="4dp" >

    <View
        android:id="@+id/qs_detail_top_space"
        android:layout_width="match_parent"
        android:layout_height="@*android:dimen/quick_qs_offset_height"
        android:background="@android:color/transparent" />
+8 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ public class QSDetail extends LinearLayout {
    protected TextView mQsDetailHeaderTitle;
    protected Switch mQsDetailHeaderSwitch;
    protected ImageView mQsDetailHeaderProgress;
    protected View mQsDetailTopSpace;

    protected QSTileHost mHost;

@@ -88,6 +89,12 @@ public class QSDetail extends LinearLayout {
        for (int i = 0; i < mDetailViews.size(); i++) {
            mDetailViews.valueAt(i).dispatchConfigurationChanged(newConfig);
        }

        // Update top space height in orientation change
        mQsDetailTopSpace.getLayoutParams().height =
                mContext.getResources().getDimensionPixelSize(
                        com.android.internal.R.dimen.quick_qs_offset_height);
        mQsDetailTopSpace.setLayoutParams(mQsDetailTopSpace.getLayoutParams());
    }

    @Override
@@ -101,6 +108,7 @@ public class QSDetail extends LinearLayout {
        mQsDetailHeaderTitle = (TextView) mQsDetailHeader.findViewById(android.R.id.title);
        mQsDetailHeaderSwitch = (Switch) mQsDetailHeader.findViewById(android.R.id.toggle);
        mQsDetailHeaderProgress = findViewById(R.id.qs_detail_header_progress);
        mQsDetailTopSpace = findViewById(R.id.qs_detail_top_space);

        updateDetailText();

+3 −2
Original line number Diff line number Diff line
@@ -499,7 +499,8 @@ public class QSPanel extends LinearLayout implements Tunable, Callback, Brightne
                        int[] loc = new int[2];
                        v.getLocationInWindow(loc);
                        int x = loc[0] + v.getWidth() / 2;
                        int y = loc[1] + v.getHeight() / 2;
                        // we subtract getTop, because Pie clipper starts after black area
                        int y = loc[1] + v.getHeight() / 2 - getTop();
                        mCustomizePanel.show(x, y);
                    }
                }
@@ -544,7 +545,7 @@ public class QSPanel extends LinearLayout implements Tunable, Callback, Brightne
        }
        r.tile.setDetailListening(show);
        int x = r.tileView.getLeft() + r.tileView.getWidth() / 2;
        int y = r.tileView.getDetailY() + mTileLayout.getOffsetTop(r) + getTop();
        int y = r.tileView.getDetailY() + mTileLayout.getOffsetTop(r);
        handleShowDetailImpl(r, show, x, y);
    }

+8 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene
    private final QSDetailClipper mClipper;
    private final LightBarController mLightBarController;
    private final TileQueryHelper mTileQueryHelper;
    private final View mQsCustomizerTopSpace;

    private boolean isShown;
    private QSTileHost mHost;
@@ -119,12 +120,19 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene
        mRecyclerView.setItemAnimator(animator);
        mLightBarController = Dependency.get(LightBarController.class);
        updateNavBackDrop(getResources().getConfiguration());
        mQsCustomizerTopSpace = findViewById(R.id.qs_customizer_top_space);
    }

    @Override
    protected void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        updateNavBackDrop(newConfig);

        // Update top space height in orientation change
        mQsCustomizerTopSpace.getLayoutParams().height =
                mContext.getResources().getDimensionPixelSize(
                        com.android.internal.R.dimen.quick_qs_offset_height);
        mQsCustomizerTopSpace.setLayoutParams(mQsCustomizerTopSpace.getLayoutParams());
    }

    private void updateNavBackDrop(Configuration newConfig) {