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

Commit e20fdf44 authored by Olivier St-Onge's avatar Olivier St-Onge
Browse files

Exclude back gestures from the BrightnessSliderView

Fixes: 313585932
Test: manually, trying the back gesture on the slider
Flag: None
Change-Id: Ic120caaf0880c6a53a8d9c68954e8d8f769debf1
parent 6ea41f31
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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));
    }

    /**