From a6aea9876e81523316d7d4513f59c08555db74a6 Mon Sep 17 00:00:00 2001 From: Andrii Kulian Date: Tue, 26 Jul 2016 18:42:46 -0700 Subject: [PATCH] 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 --- core/java/com/android/internal/widget/DecorCaptionView.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/java/com/android/internal/widget/DecorCaptionView.java b/core/java/com/android/internal/widget/DecorCaptionView.java index e59d7ba57ea1d..fc68b849ed208 100644 --- a/core/java/com/android/internal/widget/DecorCaptionView.java +++ b/core/java/com/android/internal/widget/DecorCaptionView.java @@ -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; }