Code example for GridView

Methods: scrollToBottomgetHeightgetChildAtgetChildCountgetListPaddingBottomgetAdapter, getSelectedItemPosition

0
        assertEquals(mGridView.getAdapter().getCount() - 1, mGridView.getSelectedItemPosition());
    } 
 
    @MediumTest 
    public void testPushUp() { 
        TouchUtils.scrollToBottom(this, mGridView);
 
        // Nothing should be selected 
        assertEquals("Selection still available after touch", -1,
                mGridView.getSelectedItemPosition());
 
        View lastChild = mGridView.getChildAt(mGridView.getChildCount() - 1);
 
        assertEquals("Last item not the last child in the grid",
                mGridView.getAdapter().getCount() - 1, lastChild.getId());
 
        assertEquals("Last item not at the bottom of the grid",
                mGridView.getHeight() - mGridView.getListPaddingBottom(), lastChild.getBottom());
    } 
 
    @MediumTest 
    public void testPullDown() { 
        TouchUtils.scrollToTop(this, mGridView);
Experience pair programming with AI  Get Codota for Java