Code example for OverScroller

0
 
    @SmallTest 
    @Feature({"AndroidWebView"}) 
    public void testWhenContentSizeMatchesView() { 
        TestScrollOffsetManagerDelegate delegate = new TestScrollOffsetManagerDelegate();
        OverScroller scroller = new OverScroller(getInstrumentation().getContext());
        AwScrollOffsetManager offsetManager = new AwScrollOffsetManager(delegate, scroller);
 
        final int width = 132;
        final int height = 212;
        final int scrollX = 11;
        final int scrollY = 13;
 
        offsetManager.setContentSize(width, height);
        offsetManager.setContainerViewSize(width, height);
 
        assertEquals(width, offsetManager.computeHorizontalScrollRange());
        assertEquals(height, offsetManager.computeVerticalScrollRange());
 
        // Since the view size and contents size are equal no scrolling should be possible. 
Stop searching for code, let great code find you!  Add Codota to your java IDE