FileDocCategorySizeDatePackage
AdjacentListsWithAdjacentISVsInsideTest.javaAPI DocAndroid 5.1 API3440Thu Mar 12 22:22:12 GMT 2015android.widget.listview.focus

AdjacentListsWithAdjacentISVsInsideTest

public class AdjacentListsWithAdjacentISVsInsideTest extends android.test.ActivityInstrumentationTestCase

Fields Summary
private android.widget.ListView
mLeftListView
private android.util.InternalSelectionView
mLeftIsv
private android.util.InternalSelectionView
mLeftMiddleIsv
private android.widget.ListView
mRightListView
private android.util.InternalSelectionView
mRightMiddleIsv
private android.util.InternalSelectionView
mRightIsv
Constructors Summary
public AdjacentListsWithAdjacentISVsInsideTest()

        super("com.android.frameworks.coretests", AdjacentListsWithAdjacentISVsInside.class);
    
Methods Summary
protected voidsetUp()

        super.setUp();
        final AdjacentListsWithAdjacentISVsInside a = getActivity();
        mLeftListView = a.getLeftListView();
        mLeftIsv = a.getLeftIsv();
        mLeftMiddleIsv = a.getLeftMiddleIsv();
        mRightListView = a.getRightListView();
        mRightMiddleIsv = a.getRightMiddleIsv();
        mRightIsv = a.getRightIsv();
    
public voidtestFocusTransfersOutsideOfListWhenNoCandidateInsideHorizontal()

        sendKeys(KeyEvent.KEYCODE_DPAD_DOWN, KeyEvent.KEYCODE_DPAD_DOWN, KeyEvent.KEYCODE_DPAD_RIGHT);

        assertTrue(mLeftListView.hasFocus());
        assertTrue(mLeftMiddleIsv.isFocused());
        assertEquals(2, mLeftMiddleIsv.getSelectedRow());

        sendKeys(KeyEvent.KEYCODE_DPAD_RIGHT);
        assertTrue("mRightListView.hasFocus()", mRightListView.hasFocus());
        assertTrue("mRightMiddleIsv.isFocused()", mRightMiddleIsv.isFocused());
        assertEquals("mRightMiddleIsv.getSelectedRow()", 2, mRightMiddleIsv.getSelectedRow());  
    
public voidtestFocusedRectAndFocusHintWorkWithinListItemHorizontal()
rockinist test name to date!

        sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
        assertEquals(1, mLeftIsv.getSelectedRow());

        sendKeys(KeyEvent.KEYCODE_DPAD_RIGHT);
        assertTrue(mLeftListView.hasFocus());
        assertTrue(mLeftMiddleIsv.isFocused());
        assertEquals("mLeftMiddleIsv.getSelectedRow()", 1, mLeftMiddleIsv.getSelectedRow());

        sendKeys(KeyEvent.KEYCODE_DPAD_LEFT);
        assertTrue(mLeftIsv.isFocused());
        assertEquals("mLeftIsv.getSelectedRow()", 1, mLeftIsv.getSelectedRow());
    
public voidtestPreconditions()

        assertTrue(mLeftListView.hasFocus());
        assertTrue(mLeftIsv.isFocused());
        assertEquals(0, mLeftIsv.getSelectedRow());