Code example for View

Methods: dragViewBygetTop

0
    } 
     
    @LargeTest 
    public void testLongScroll() { 
        View firstChild = mListView.getChildAt(0);
        if (firstChild.getTop() < mListView.getListPaddingTop()) {
            firstChild = mListView.getChildAt(1);
        } 
 
        int firstTop = firstChild.getTop();
 
        int distance = TouchUtils.dragViewBy(this, firstChild, 
                Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, 
                (int)(mActivity.getWindowManager().getDefaultDisplay().getHeight() * 0.75f));
         
        assertEquals("View scrolled to wrong position", firstTop
                + (distance - ViewConfiguration.getTouchSlop() - 1), firstChild.getTop());
    }  
 
}