Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -21725,6 +21725,7 @@ package android.view { method public void setOnHierarchyChangeListener(android.view.ViewGroup.OnHierarchyChangeListener); method public void setPersistentDrawingCache(int); method protected void setStaticTransformationsEnabled(boolean); method public boolean shouldDelayChildPressedState(); method public boolean showContextMenuForChild(android.view.View); method public android.view.ActionMode startActionModeForChild(android.view.View, android.view.ActionMode.Callback); method public void startLayoutAnimation(); core/java/android/view/View.java +37 −18 Original line number Diff line number Diff line Loading @@ -5138,9 +5138,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility (mViewFlags & LONG_CLICKABLE) == LONG_CLICKABLE) && (event.getRepeatCount() == 0)) { setPressed(true); if ((mViewFlags & LONG_CLICKABLE) == LONG_CLICKABLE) { postCheckForLongClick(0); } checkForLongClick(0); return true; } break; Loading Loading @@ -5535,12 +5533,33 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility break; case MotionEvent.ACTION_DOWN: mHasPerformedLongPress = false; // Walk up the hierarchy to determine if we're inside a scrolling container. boolean isInScrollingContainer = false; ViewParent p = getParent(); while (p != null && p instanceof ViewGroup) { if (((ViewGroup) p).shouldDelayChildPressedState()) { isInScrollingContainer = true; break; } p = p.getParent(); } // For views inside a scrolling container, delay the pressed feedback for // a short period in case this is a scroll. if (isInScrollingContainer) { mPrivateFlags |= PREPRESSED; if (mPendingCheckForTap == null) { mPendingCheckForTap = new CheckForTap(); } mPrivateFlags |= PREPRESSED; mHasPerformedLongPress = false; postDelayed(mPendingCheckForTap, ViewConfiguration.getTapTimeout()); } else { // Not inside a scrolling container, so show the feedback right away mPrivateFlags |= PRESSED; refreshDrawableState(); checkForLongClick(0); } break; case MotionEvent.ACTION_CANCEL: Loading Loading @@ -11846,7 +11865,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } } private void postCheckForLongClick(int delayOffset) { private void checkForLongClick(int delayOffset) { if ((mViewFlags & LONG_CLICKABLE) == LONG_CLICKABLE) { mHasPerformedLongPress = false; if (mPendingCheckForLongPress == null) { Loading @@ -11856,6 +11876,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility postDelayed(mPendingCheckForLongPress, ViewConfiguration.getLongPressTimeout() - delayOffset); } } /** * Inflate a view from an XML resource. This convenience method wraps the {@link Loading Loading @@ -12166,9 +12187,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility mPrivateFlags &= ~PREPRESSED; mPrivateFlags |= PRESSED; refreshDrawableState(); if ((mViewFlags & LONG_CLICKABLE) == LONG_CLICKABLE) { postCheckForLongClick(ViewConfiguration.getTapTimeout()); } checkForLongClick(ViewConfiguration.getTapTimeout()); } } Loading core/java/android/view/ViewConfiguration.java +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ public class ViewConfiguration { * is a tap or a scroll. If the user does not move within this interval, it is * considered to be a tap. */ private static final int TAP_TIMEOUT = 115; private static final int TAP_TIMEOUT = 180; /** * Defines the duration in milliseconds we will wait to see if a touch event Loading core/java/android/view/ViewGroup.java +13 −0 Original line number Diff line number Diff line Loading @@ -4972,6 +4972,19 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager mAnimationListener = animationListener; } /** * Return true if the pressed state should be delayed for children or descendants of this * ViewGroup. Generally, this should be done for containers that can scroll, such as a List. * This prevents the pressed state from appearing when the user is actually trying to scroll * the content. * * The default implementation returns true for compatibility reasons. Subclasses that do * not scroll should generally override this method and return false. */ public boolean shouldDelayChildPressedState() { return true; } /** * LayoutParams are used by views to tell their parents how they want to be * laid out. See Loading core/java/android/webkit/WebView.java +5 −0 Original line number Diff line number Diff line Loading @@ -1194,6 +1194,11 @@ public class WebView extends AbsoluteLayout mHTML5VideoViewProxy = null ; } @Override public boolean shouldDelayChildPressedState() { return true; } /** * Adds accessibility APIs to JavaScript. * Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -21725,6 +21725,7 @@ package android.view { method public void setOnHierarchyChangeListener(android.view.ViewGroup.OnHierarchyChangeListener); method public void setPersistentDrawingCache(int); method protected void setStaticTransformationsEnabled(boolean); method public boolean shouldDelayChildPressedState(); method public boolean showContextMenuForChild(android.view.View); method public android.view.ActionMode startActionModeForChild(android.view.View, android.view.ActionMode.Callback); method public void startLayoutAnimation();
core/java/android/view/View.java +37 −18 Original line number Diff line number Diff line Loading @@ -5138,9 +5138,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility (mViewFlags & LONG_CLICKABLE) == LONG_CLICKABLE) && (event.getRepeatCount() == 0)) { setPressed(true); if ((mViewFlags & LONG_CLICKABLE) == LONG_CLICKABLE) { postCheckForLongClick(0); } checkForLongClick(0); return true; } break; Loading Loading @@ -5535,12 +5533,33 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility break; case MotionEvent.ACTION_DOWN: mHasPerformedLongPress = false; // Walk up the hierarchy to determine if we're inside a scrolling container. boolean isInScrollingContainer = false; ViewParent p = getParent(); while (p != null && p instanceof ViewGroup) { if (((ViewGroup) p).shouldDelayChildPressedState()) { isInScrollingContainer = true; break; } p = p.getParent(); } // For views inside a scrolling container, delay the pressed feedback for // a short period in case this is a scroll. if (isInScrollingContainer) { mPrivateFlags |= PREPRESSED; if (mPendingCheckForTap == null) { mPendingCheckForTap = new CheckForTap(); } mPrivateFlags |= PREPRESSED; mHasPerformedLongPress = false; postDelayed(mPendingCheckForTap, ViewConfiguration.getTapTimeout()); } else { // Not inside a scrolling container, so show the feedback right away mPrivateFlags |= PRESSED; refreshDrawableState(); checkForLongClick(0); } break; case MotionEvent.ACTION_CANCEL: Loading Loading @@ -11846,7 +11865,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } } private void postCheckForLongClick(int delayOffset) { private void checkForLongClick(int delayOffset) { if ((mViewFlags & LONG_CLICKABLE) == LONG_CLICKABLE) { mHasPerformedLongPress = false; if (mPendingCheckForLongPress == null) { Loading @@ -11856,6 +11876,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility postDelayed(mPendingCheckForLongPress, ViewConfiguration.getLongPressTimeout() - delayOffset); } } /** * Inflate a view from an XML resource. This convenience method wraps the {@link Loading Loading @@ -12166,9 +12187,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility mPrivateFlags &= ~PREPRESSED; mPrivateFlags |= PRESSED; refreshDrawableState(); if ((mViewFlags & LONG_CLICKABLE) == LONG_CLICKABLE) { postCheckForLongClick(ViewConfiguration.getTapTimeout()); } checkForLongClick(ViewConfiguration.getTapTimeout()); } } Loading
core/java/android/view/ViewConfiguration.java +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ public class ViewConfiguration { * is a tap or a scroll. If the user does not move within this interval, it is * considered to be a tap. */ private static final int TAP_TIMEOUT = 115; private static final int TAP_TIMEOUT = 180; /** * Defines the duration in milliseconds we will wait to see if a touch event Loading
core/java/android/view/ViewGroup.java +13 −0 Original line number Diff line number Diff line Loading @@ -4972,6 +4972,19 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager mAnimationListener = animationListener; } /** * Return true if the pressed state should be delayed for children or descendants of this * ViewGroup. Generally, this should be done for containers that can scroll, such as a List. * This prevents the pressed state from appearing when the user is actually trying to scroll * the content. * * The default implementation returns true for compatibility reasons. Subclasses that do * not scroll should generally override this method and return false. */ public boolean shouldDelayChildPressedState() { return true; } /** * LayoutParams are used by views to tell their parents how they want to be * laid out. See Loading
core/java/android/webkit/WebView.java +5 −0 Original line number Diff line number Diff line Loading @@ -1194,6 +1194,11 @@ public class WebView extends AbsoluteLayout mHTML5VideoViewProxy = null ; } @Override public boolean shouldDelayChildPressedState() { return true; } /** * Adds accessibility APIs to JavaScript. * Loading