FileDocCategorySizeDatePackage
ListItemFocusableAboveUnfocusableTest.javaAPI DocAndroid 1.5 API1947Wed May 06 22:42:02 BST 2009com.android.frameworktest.listview.arrowscroll

ListItemFocusableAboveUnfocusableTest

public class ListItemFocusableAboveUnfocusableTest extends android.test.ActivityInstrumentationTestCase

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

        super("com.android.frameworktest", 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());