Methods Summary |
---|
private android.widget.ListAdapter | createEmptyAdapter()
return new ArrayAdapter<String>(mActivity, android.R.layout.simple_list_item_1,
new String[] { });
|
private android.widget.ListAdapter | createFullAdapter()
return new ArrayAdapter<String>(mActivity, android.R.layout.simple_list_item_1,
new String[] { "Android", "Robot" });
|
private void | setEmptyAdapter()
mActivity.runOnUiThread(new Runnable() {
public void run() {
mListView.setAdapter(createEmptyAdapter());
}
});
getInstrumentation().waitForIdleSync();
|
private void | setFocusable()
mActivity.runOnUiThread(new Runnable() {
public void run() {
mListView.setFocusable(true);
}
});
getInstrumentation().waitForIdleSync();
|
private void | setFullAdapter()
mActivity.runOnUiThread(new Runnable() {
public void run() {
mListView.setAdapter(createFullAdapter());
}
});
getInstrumentation().waitForIdleSync();
|
private void | setNonFocusable()
mActivity.runOnUiThread(new Runnable() {
public void run() {
mListView.setFocusable(false);
}
});
getInstrumentation().waitForIdleSync();
|
private void | setNullAdapter()
mActivity.runOnUiThread(new Runnable() {
public void run() {
mListView.setAdapter(null);
}
});
getInstrumentation().waitForIdleSync();
|
protected void | setUp()
super.setUp();
mActivity = getActivity();
mListView = getActivity().getListView();
|
public void | testAdapterEmpty()
setEmptyAdapter();
assertFalse(mListView.isFocusable());
|
public void | testAdapterEmptySetFocusable()
setEmptyAdapter();
assertFalse(mListView.isFocusable());
setFocusable();
assertFalse(mListView.isFocusable());
|
public void | testAdapterEmptySetNonFocusable()
setEmptyAdapter();
assertFalse(mListView.isFocusable());
setNonFocusable();
assertFalse(mListView.isFocusable());
|
public void | testAdapterFull()
setFullAdapter();
assertTrue(mListView.isFocusable());
|
public void | testAdapterFullSetFocusable()
assertTrue(mListView.isFocusable());
setFocusable();
assertTrue(mListView.isFocusable());
|
public void | testAdapterFullSetNonFocusable()
assertTrue(mListView.isFocusable());
setNonFocusable();
assertFalse(mListView.isFocusable());
|
public void | testAdapterNull()
setNullAdapter();
assertFalse(mListView.isFocusable());
|
public void | testAdapterNullSetFocusable()
setNullAdapter();
assertFalse(mListView.isFocusable());
setFocusable();
assertFalse(mListView.isFocusable());
|
public void | testAdapterNullSetNonFocusable()
setNullAdapter();
assertFalse(mListView.isFocusable());
setNonFocusable();
assertFalse(mListView.isFocusable());
|
public void | testFocusableSetAdapterEmpty()
assertTrue(mListView.isFocusable());
setEmptyAdapter();
assertFalse(mListView.isFocusable());
|
public void | testFocusableSetAdapterFull()
assertTrue(mListView.isFocusable());
setFullAdapter();
assertTrue(mListView.isFocusable());
|
public void | testFocusableSetAdapterNull()
assertTrue(mListView.isFocusable());
setNullAdapter();
assertFalse(mListView.isFocusable());
|
public void | testNonFocusableSetAdapterEmpty()
assertTrue(mListView.isFocusable());
setNonFocusable();
assertFalse(mListView.isFocusable());
setEmptyAdapter();
assertFalse(mListView.isFocusable());
|
public void | testNonFocusableSetAdapterFull()
assertTrue(mListView.isFocusable());
setNonFocusable();
assertFalse(mListView.isFocusable());
setFullAdapter();
assertFalse(mListView.isFocusable());
|
public void | testNonFocusableSetAdapterNull()
assertTrue(mListView.isFocusable());
setNonFocusable();
assertFalse(mListView.isFocusable());
setNullAdapter();
assertFalse(mListView.isFocusable());
|
public void | testPreconditions()
assertNotNull(mActivity);
assertNotNull(mListView);
// First item should be selected
assertEquals(0, mListView.getSelectedItemPosition());
|