Merge "[DO NOT MERGE] Fix some mouse + list-item selection/scrolling issues"
This commit is contained in:
@@ -3866,6 +3866,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
|
|||||||
private void onTouchDown(MotionEvent ev) {
|
private void onTouchDown(MotionEvent ev) {
|
||||||
mHasPerformedLongPress = false;
|
mHasPerformedLongPress = false;
|
||||||
mActivePointerId = ev.getPointerId(0);
|
mActivePointerId = ev.getPointerId(0);
|
||||||
|
hideSelector();
|
||||||
|
|
||||||
if (mTouchMode == TOUCH_MODE_OVERFLING) {
|
if (mTouchMode == TOUCH_MODE_OVERFLING) {
|
||||||
// Stopped the fling. It is a scroll.
|
// Stopped the fling. It is a scroll.
|
||||||
@@ -5226,17 +5227,21 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
|
|||||||
}
|
}
|
||||||
|
|
||||||
mRecycler.fullyDetachScrapViews();
|
mRecycler.fullyDetachScrapViews();
|
||||||
|
boolean selectorOnScreen = false;
|
||||||
if (!inTouchMode && mSelectedPosition != INVALID_POSITION) {
|
if (!inTouchMode && mSelectedPosition != INVALID_POSITION) {
|
||||||
final int childIndex = mSelectedPosition - mFirstPosition;
|
final int childIndex = mSelectedPosition - mFirstPosition;
|
||||||
if (childIndex >= 0 && childIndex < getChildCount()) {
|
if (childIndex >= 0 && childIndex < getChildCount()) {
|
||||||
positionSelector(mSelectedPosition, getChildAt(childIndex));
|
positionSelector(mSelectedPosition, getChildAt(childIndex));
|
||||||
|
selectorOnScreen = true;
|
||||||
}
|
}
|
||||||
} else if (mSelectorPosition != INVALID_POSITION) {
|
} else if (mSelectorPosition != INVALID_POSITION) {
|
||||||
final int childIndex = mSelectorPosition - mFirstPosition;
|
final int childIndex = mSelectorPosition - mFirstPosition;
|
||||||
if (childIndex >= 0 && childIndex < getChildCount()) {
|
if (childIndex >= 0 && childIndex < getChildCount()) {
|
||||||
positionSelector(INVALID_POSITION, getChildAt(childIndex));
|
positionSelector(mSelectorPosition, getChildAt(childIndex));
|
||||||
|
selectorOnScreen = true;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
if (!selectorOnScreen) {
|
||||||
mSelectorRect.setEmpty();
|
mSelectorRect.setEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user