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

Commit a6aea987 authored by Andrii Kulian's avatar Andrii Kulian
Browse files

Don't delay child pressed state in freeform mode

DecorCaptionView is used in app view hierarchy in freeform mode
and it inherits default ViewGroup#shouldDelayChildPressedState
implementation, which returns true by default for compatibility
reasons.
This results in touch not delivered to child views in some cases
until there is movement or up action. E.g. touch on SeekBar will
not change the position of control instantly in freeform, while
it does in other modes.
This CL disables delaying child pressed state for DecorCaptionView.

Bug: 30037893
Change-Id: I4917143610b6c0d404d2395670de9525c10f2a6c
parent 7c731f9e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -244,6 +244,11 @@ public class DecorCaptionView extends ViewGroup implements View.OnTouchListener,
        return mTouchDispatchList;
    }

    @Override
    public boolean shouldDelayChildPressedState() {
        return false;
    }

    private boolean passedSlop(int x, int y) {
        return Math.abs(x - mTouchDownX) > mDragSlop || Math.abs(y - mTouchDownY) > mDragSlop;
    }