Code example for ListView

Methods: getChildAtgetChildCountgetAdapter, getHeight, getListPaddingBottom, getSelectedItemPosition, scrollToBottom

0
                firstChild.getTop());
    } 
     
    @LargeTest 
    public void testPushUp() { 
        int originalCount = mListView.getChildCount();
         
        TouchUtils.scrollToBottom(this, mListView);
 
        // Nothing should be selected 
        assertEquals("Selection still available after touch", -1, 
                mListView.getSelectedItemPosition());
 
        View lastChild = mListView.getChildAt(mListView.getChildCount() - 1);
 
        assertEquals("List is not scrolled to the bottom", mListView.getAdapter().getCount() - 1,
                lastChild.getId());
 
        assertEquals("Last item is not touching the bottom edge",  
                mListView.getHeight() - mListView.getListPaddingBottom(), lastChild.getBottom());
         
        assertTrue(String.format("Too many children created: %d expected no more than %d", 
                mListView.getChildCount(), originalCount + 1), 
                mListView.getChildCount() <= originalCount + 1);
    } 
 
    @LargeTest 
    public void testPress() { 
        int i;