FileDocCategorySizeDatePackage
ListItemFocusableAboveUnfocusableTest.javaAPI DocAndroid 5.1 API1932Thu Mar 12 22:22:12 GMT 2015android.widget.listview.arrowscroll

ListItemFocusableAboveUnfocusableTest

public class ListItemFocusableAboveUnfocusableTest extends android.test.ActivityInstrumentationTestCase

Fields Summary
private android.widget.ListView
mListView
Constructors Summary
public ListItemFocusableAboveUnfocusableTest()

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

        super.setUp();

        mListView = getActivity().getListView();
    
public voidtestMovingToUnFocusableTakesFocusAway()

        sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);

        assertFalse("focused item should have lost focus",
                mListView.getChildAt(0).isFocused());
        assertEquals("selected position", 1, mListView.getSelectedItemPosition());
    
public voidtestPreconditions()

        assertEquals("selected position", 0, mListView.getSelectedItemPosition());
        assertTrue(mListView.getChildAt(0).isFocused());
        assertFalse(mListView.getChildAt(1).isFocusable());