ListView getItemsCanFocus - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ListView getItemsCanFocus method.

This code example shows how to use the following methods: isInTouchMode, getChildAt, getHeaderViewsCount, getItemsCanFocus
        mListView = getActivity().getListView();
    } 
 
    @MediumTest 
    public void testPreconditions() { 
        assertTrue("listview.getItemsCanFocus()", mListView.getItemsCanFocus());
        assertFalse("out of touch-mode", mListView.isInTouchMode());
        assertEquals("header view count", 1, mListView.getHeaderViewsCount());
        assertTrue("header has focus", mListView.getChildAt(0).isFocused());
    } 
 
    @FlakyTest(tolerance=2) 
    @LargeTest 
    public void testClickingHeaderKeepsFocus() { 
        TouchUtils.clickView(this, mListView.getChildAt(0));
        assertTrue("header has focus", mListView.getChildAt(0).isFocused());
        assertEquals("nothing selected", AbsListView.INVALID_POSITION, mListView.getSelectedItemPosition());
    } 
 
    @LargeTest 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: isInTouchMode, getChildAt, getHeaderViewsCount, getItemsCanFocus
        mListView = getActivity().getListView();
    } 
 
    @MediumTest 
    public void testPreconditions() { 
        assertTrue("listview.getItemsCanFocus()", mListView.getItemsCanFocus());
        assertFalse("out of touch-mode", mListView.isInTouchMode());
        assertEquals("header view count", 1, mListView.getHeaderViewsCount());
        assertTrue("header has focus", mListView.getChildAt(0).isFocused());
    } 
 
    @FlakyTest(tolerance=2) 
    @LargeTest 
    public void testClickingHeaderKeepsFocus() { 
        TouchUtils.clickView(this, mListView.getChildAt(0));
        assertTrue("header has focus", mListView.getChildAt(0).isFocused());
        assertEquals("nothing selected", AbsListView.INVALID_POSITION, mListView.getSelectedItemPosition());
    } 
 
    @LargeTest 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
getItemsCanFocus Method Overview
See Code Examples for other Android ListView Methods: