Code example for View

Methods: dragViewToY, getTop

0
     
    @LargeTest 
    public void testLongScroll() { 
        View lastChild = mGridView.getChildAt(mGridView.getChildCount() - 1);
         
        int lastTop = lastChild.getTop();
         
        int distance = TouchUtils.dragViewToY(this, lastChild, Gravity.TOP | Gravity.LEFT,
                mGridView.getTop());
         
        assertEquals("View scrolled to wrong position", 
                lastTop - (distance - ViewConfiguration.getTouchSlop() - 1), lastChild.getTop());
    } 
     
    @LargeTest 
    public void testManyScrolls() { 
        int originalCount = mGridView.getChildCount();
         
        View firstChild;
        int firstId = Integer.MIN_VALUE;
        int firstTop = Integer.MIN_VALUE;