0
 
    @MediumTest 
    public void testScrollToOffScreenRectangleFromTop() { 
        // view is off screen 
        assertTrue(mClickToScrollFromAbove.hasFocus());
        ViewAsserts.assertOffScreenBelow(mScrollView, mChildToScrollTo);
 
        // click 
        sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
        getInstrumentation().waitForIdleSync();  // wait for scrolling to finish
 
        // should be on screen, positioned at the bottom (with room for 
        // fading edge) 
        ViewAsserts.assertOnScreen(mScrollView, mChildToScrollTo);
        ViewAsserts.assertHasScreenCoordinates(
                mScrollView, mChildToScrollTo,
                0, 
                mScrollView.getHeight()
                        - mChildToScrollTo.getHeight()
                        - mScrollView.getVerticalFadingEdgeLength());
    } 
 
    @MediumTest 
    public void testScrollToPartiallyOffScreenRectFromTop() { 
        pressDownUntilViewInFocus(mClickToScrollToUpperBlob, 4);
Stop searching for code, let great code find you!  Add Codota to your java IDE