Loading core/java/android/widget/AbsListView.java +13 −4 Original line number Diff line number Diff line Loading @@ -546,6 +546,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te private void initAbsListView() { // Setting focusable in touch mode will set the focusable property to true setClickable(true); setFocusableInTouchMode(true); setWillNotDraw(false); setAlwaysDrawnWithCacheEnabled(false); Loading Loading @@ -1433,6 +1434,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te * this is a long press. */ void keyPressed() { if (!isEnabled() || !isClickable()) { return; } Drawable selector = mSelector; Rect selectorRect = mSelectorRect; if (selector != null && (isFocused() || touchModeDrawsInPressedState()) Loading @@ -1450,8 +1455,8 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te Drawable d = selector.getCurrent(); if (d != null && d instanceof TransitionDrawable) { if (longClickable) { ((TransitionDrawable) d).startTransition(ViewConfiguration .getLongPressTimeout()); ((TransitionDrawable) d).startTransition( ViewConfiguration.getLongPressTimeout()); } else { ((TransitionDrawable) d).resetTransition(); } Loading Loading @@ -1731,6 +1736,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te return false; } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { return false; } @Override public boolean onKeyUp(int keyCode, KeyEvent event) { switch (keyCode) { Loading @@ -1739,8 +1749,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te if (!isEnabled()) { return true; } // Long clickable items don't necessarily have to be clickable if (isClickable() && (event.getRepeatCount() == 0) && isPressed() && if (isClickable() && isPressed() && mSelectedPosition >= 0 && mAdapter != null && mSelectedPosition < mAdapter.getCount()) { Loading Loading
core/java/android/widget/AbsListView.java +13 −4 Original line number Diff line number Diff line Loading @@ -546,6 +546,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te private void initAbsListView() { // Setting focusable in touch mode will set the focusable property to true setClickable(true); setFocusableInTouchMode(true); setWillNotDraw(false); setAlwaysDrawnWithCacheEnabled(false); Loading Loading @@ -1433,6 +1434,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te * this is a long press. */ void keyPressed() { if (!isEnabled() || !isClickable()) { return; } Drawable selector = mSelector; Rect selectorRect = mSelectorRect; if (selector != null && (isFocused() || touchModeDrawsInPressedState()) Loading @@ -1450,8 +1455,8 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te Drawable d = selector.getCurrent(); if (d != null && d instanceof TransitionDrawable) { if (longClickable) { ((TransitionDrawable) d).startTransition(ViewConfiguration .getLongPressTimeout()); ((TransitionDrawable) d).startTransition( ViewConfiguration.getLongPressTimeout()); } else { ((TransitionDrawable) d).resetTransition(); } Loading Loading @@ -1731,6 +1736,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te return false; } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { return false; } @Override public boolean onKeyUp(int keyCode, KeyEvent event) { switch (keyCode) { Loading @@ -1739,8 +1749,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te if (!isEnabled()) { return true; } // Long clickable items don't necessarily have to be clickable if (isClickable() && (event.getRepeatCount() == 0) && isPressed() && if (isClickable() && isPressed() && mSelectedPosition >= 0 && mAdapter != null && mSelectedPosition < mAdapter.getCount()) { Loading