From e0a799a2ac1ca78e30fbac9e4e12a063425c08d3 Mon Sep 17 00:00:00 2001 From: Patrick Dubroy Date: Wed, 4 May 2011 16:19:22 -0700 Subject: Only delay pressed feedback for Views inside a scrolling parent Add a method on ViewGroup to determine whether it supports scrolling. This allows us to show the pressed feedback immediately in many cases, improving responsiveness of buttons, etc. This patch also lengthens the timeout in order to reduce flashes when the user is scrolling. Change-Id: Ieb91ae7a1f8e8f7e87448f2a730381a53947996f --- core/java/android/widget/LinearLayout.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/java/android/widget/LinearLayout.java') diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java index dbe9288afa79..ed913a480490 100644 --- a/core/java/android/widget/LinearLayout.java +++ b/core/java/android/widget/LinearLayout.java @@ -201,6 +201,11 @@ public class LinearLayout extends ViewGroup { mShowDividers = showDividers; } + @Override + public boolean shouldDelayChildPressedState() { + return false; + } + /** * @return A flag set indicating how dividers should be shown around items. * @see #setShowDividers(int) -- cgit v1.2.3