From 2669e5876d64366d1f99b0d995a6c19111716d42 Mon Sep 17 00:00:00 2001 From: Fabian Kozynski Date: Tue, 27 Sep 2022 12:37:21 -0400 Subject: [PATCH] Increase margin of Brightness dialog The margins for the dialog where 8dp and were interfering with back gesture. Instead, make it 16dp so it aligns with other elements and it's clear of the edges. Bug: 247049806 Test: manual Change-Id: I4990da7e3eca469a9727efcfeb790608435ab9af --- .../systemui/settings/brightness/BrightnessDialog.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessDialog.java b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessDialog.java index a22fda7f9a478..6e9f859c202bd 100644 --- a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessDialog.java +++ b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessDialog.java @@ -25,6 +25,7 @@ import android.os.Handler; import android.view.Gravity; import android.view.KeyEvent; import android.view.View; +import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; import android.widget.FrameLayout; @@ -76,6 +77,12 @@ public class BrightnessDialog extends Activity { FrameLayout frame = findViewById(R.id.brightness_mirror_container); // The brightness mirror container is INVISIBLE by default. frame.setVisibility(View.VISIBLE); + ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) frame.getLayoutParams(); + int horizontalMargin = + getResources().getDimensionPixelSize(R.dimen.notification_side_paddings); + lp.leftMargin = horizontalMargin; + lp.rightMargin = horizontalMargin; + frame.setLayoutParams(lp); BrightnessSliderController controller = mToggleSliderFactory.create(this, frame); controller.init();