Code example for Scroller

Methods: flinggetDuration

0
            } 
 
            boolean scrollBeyondImage = (fixedScrollX < 0) || (fixedScrollX > maxScrollX) || (fixedScrollY < 0) || (fixedScrollY > maxScrollY);
            if (scrollBeyondImage) return false;
 
            scroller.fling(getScrollX(), getScrollY(), -(int) velocityX / 3, -(int) velocityY / 3, 0, getScaledWidth() - getWidth(), 0, getScaledHeight() - getHeight());
            awakenScrollBars(scroller.getDuration());
 
            return true; 
        } 
    } 
 
    private class MyScaleGestureListener implements ScaleGestureDetector.OnScaleGestureListener {
        public boolean onScale(ScaleGestureDetector detector) {
            final float temp = scaleFactor;
            scaleFactor *= detector.getScaleFactor();
            if (scaleFactor <= 3 && scaleFactor >= 0.3) {
                int newScrollX = (int) ((getScrollX() + detector.getFocusX()) * detector.getScaleFactor() - detector.getFocusX());
                int newScrollY = (int) ((getScrollY() + detector.getFocusY()) * detector.getScaleFactor() - detector.getFocusY());
                scrollTo(newScrollX, newScrollY);
Experience pair programming with AI  Get Codota for Java