am 3c062db9: am a5ecdbb1: Merge "Manage pressed state during drag-to-open" into lmp-mr1-dev

* commit '3c062db99406f083f8c3529bcc56d042b9cb06b0':
  Manage pressed state during drag-to-open
This commit is contained in:
Alan Viverette
2014-10-02 13:37:56 +00:00
committed by Android Git Automerger

View File

@@ -1639,6 +1639,11 @@ public class ListPopupWindow {
setPressed(false);
updateSelectorState();
final View motionView = getChildAt(mMotionPosition - mFirstPosition);
if (motionView != null) {
motionView.setPressed(false);
}
if (mClickAnimation != null) {
mClickAnimation.cancel();
mClickAnimation = null;
@@ -1653,6 +1658,15 @@ public class ListPopupWindow {
setPressed(true);
layoutChildren();
// Manage the pressed view based on motion position. This allows us to
// play nicely with actual touch and scroll events.
final View motionView = getChildAt(mMotionPosition - mFirstPosition);
if (motionView != null) {
motionView.setPressed(false);
}
mMotionPosition = position;
child.setPressed(true);
// Ensure that keyboard focus starts from the last touched position.
setSelectedPositionInt(position);
positionSelectorLikeTouch(position, child, x, y);