Methods Summary |
---|
private void | arrowDownToSelectedPosition(int position)
int maxDowns = 20;
while(mListView.getSelectedItemPosition() < position && --maxDowns > 0) {
mInstrumentation.sendCharacterSync(KeyEvent.KEYCODE_DPAD_DOWN);
}
if (position != mListView.getSelectedItemPosition()) {
throw new IllegalStateException("couldn't get to item after 20 downs");
}
|
public final void | arrowScrollToSelectedPosition(int desiredPos)Arrow (up or down as appropriate) to the desired position in the list.
if (desiredPos > mListView.getSelectedItemPosition()) {
arrowDownToSelectedPosition(desiredPos);
} else {
arrowUpToSelectedPosition(desiredPos);
}
|
private void | arrowUpToSelectedPosition(int position)
int maxUps = 20;
while(mListView.getSelectedItemPosition() > position && --maxUps > 0) {
mInstrumentation.sendCharacterSync(KeyEvent.KEYCODE_DPAD_UP);
}
if (position != mListView.getSelectedItemPosition()) {
throw new IllegalStateException("couldn't get to item after 20 ups");
}
|
public final int | getListBottom()Get the bottom of the list.
return mListView.getHeight() - mListView.getListPaddingBottom();
|
public final int | getListTop()Get the top of the list.
return mListView.getListPaddingTop();
|
public final void | setSelectedPosition(int pos)Set the selected position of the list view.
mListView.post(new Runnable() {
public void run() {
mListView.setSelection(pos);
}
});
mInstrumentation.waitForIdleSync();
|