summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Olivier St-Onge <ostonge@google.com> 2023-12-05 15:11:08 -0500
committer Olivier St-Onge <ostonge@google.com> 2023-12-05 15:29:09 -0500
commite20fdf44b6dfbf87408c02b64da291ea8aa11909 (patch)
tree469628ee1c61aac07ff172bd82763bc5fba27402
parent6ea41f315c98e068f67be6ebc839074814024ffb (diff)
Exclude back gestures from the BrightnessSliderView
Fixes: 313585932 Test: manually, trying the back gesture on the slider Flag: None Change-Id: Ic120caaf0880c6a53a8d9c68954e8d8f769debf1
-rw-r--r--packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessSliderView.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessSliderView.java b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessSliderView.java
index c88549224183..c43d20cdf52f 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessSliderView.java
+++ b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessSliderView.java
@@ -35,6 +35,8 @@ import com.android.settingslib.RestrictedLockUtils;
import com.android.systemui.Gefingerpoken;
import com.android.systemui.res.R;
+import java.util.Collections;
+
/**
* {@code FrameLayout} used to show and manipulate a {@link ToggleSeekBar}.
*
@@ -48,6 +50,7 @@ public class BrightnessSliderView extends FrameLayout {
@Nullable
private Drawable mProgressDrawable;
private float mScale = 1f;
+ private final Rect mSystemGestureExclusionRect = new Rect();
public BrightnessSliderView(Context context) {
this(context, null);
@@ -176,6 +179,11 @@ public class BrightnessSliderView extends FrameLayout {
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
applySliderScale();
+ int horizontalMargin =
+ getResources().getDimensionPixelSize(R.dimen.notification_side_paddings);
+ mSystemGestureExclusionRect.set(-horizontalMargin, 0, right - left + horizontalMargin,
+ bottom - top);
+ setSystemGestureExclusionRects(Collections.singletonList(mSystemGestureExclusionRect));
}
/**