am e69e0fde: Merge "Fix issue #3374356: Buttons sometimes don\'t highlight" into honeycomb

* commit 'e69e0fde6cf0e6302d5a05363a3db7a9c555e9dc':
  Fix issue #3374356: Buttons sometimes don't highlight
This commit is contained in:
Dianne Hackborn
2011-01-20 17:07:31 -08:00
committed by Android Git Automerger

View File

@@ -5027,6 +5027,15 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
focusTaken = requestFocus();
}
if (prepressed) {
// The button is being released before we actually
// showed it as pressed. Make it show the pressed
// state now (before scheduling the click) to ensure
// the user sees it.
mPrivateFlags |= PRESSED;
refreshDrawableState();
}
if (!mHasPerformedLongPress) {
// This is a tap, so remove the longpress check
removeLongPressCallback();
@@ -5050,8 +5059,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
}
if (prepressed) {
mPrivateFlags |= PRESSED;
refreshDrawableState();
postDelayed(mUnsetPressedState,
ViewConfiguration.getPressedStateDuration());
} else if (!post(mUnsetPressedState)) {