am 213b9805: Merge "Don\'t assume there\'s a selected position in touch mode. Bug #2520743" into froyo
Merge commit '213b9805e31ae9de26c740c04e04af2090759e52' into kraken * commit '213b9805e31ae9de26c740c04e04af2090759e52': Don't assume there's a selected position in touch mode.
This commit is contained in:
@@ -1128,11 +1128,13 @@ public class GridView extends AbsListView {
|
|||||||
default:
|
default:
|
||||||
if (childCount == 0) {
|
if (childCount == 0) {
|
||||||
if (!mStackFromBottom) {
|
if (!mStackFromBottom) {
|
||||||
setSelectedPositionInt(0);
|
setSelectedPositionInt(mAdapter == null || isInTouchMode() ?
|
||||||
|
INVALID_POSITION : 0);
|
||||||
sel = fillFromTop(childrenTop);
|
sel = fillFromTop(childrenTop);
|
||||||
} else {
|
} else {
|
||||||
final int last = mItemCount - 1;
|
final int last = mItemCount - 1;
|
||||||
setSelectedPositionInt(last);
|
setSelectedPositionInt(mAdapter == null || isInTouchMode() ?
|
||||||
|
INVALID_POSITION : last);
|
||||||
sel = fillFromBottom(last, childrenBottom);
|
sel = fillFromBottom(last, childrenBottom);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user