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

Commit 51c7d96a authored by yyalan's avatar yyalan Committed by Yalan Yiue
Browse files

Fix brightness slider margin issues

The margin is overwritten in QSPanel. Adjust them with offsets. Screenshots attached in b/344903796.

Bug: 344903796
Flag: NONE this is a follow up change and the main bug was guarded by com.android.systemui.brightness_slider_focus_state
Test: SwipeBrightness.kt
Change-Id: I0f2df9014fa5d88fb049b72aafbea04816567b8d
parent e0abf061
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -217,10 +217,13 @@ public class QSPanel extends LinearLayout implements Tunable {
    private void setBrightnessViewMargin() {
        if (mBrightnessView != null) {
            MarginLayoutParams lp = (MarginLayoutParams) mBrightnessView.getLayoutParams();
            // For Brightness Slider to extend its boundary to draw focus background
            int offset = getResources()
                    .getDimensionPixelSize(R.dimen.rounded_slider_boundary_offset);
            lp.topMargin = mContext.getResources()
                    .getDimensionPixelSize(R.dimen.qs_brightness_margin_top);
                    .getDimensionPixelSize(R.dimen.qs_brightness_margin_top) - offset;
            lp.bottomMargin = mContext.getResources()
                    .getDimensionPixelSize(R.dimen.qs_brightness_margin_bottom);
                    .getDimensionPixelSize(R.dimen.qs_brightness_margin_bottom) - offset;
            mBrightnessView.setLayoutParams(lp);
        }
    }