Code example for AccelerateDecelerateInterpolator

0
 
        public SmoothScrollRunnable(Handler handler, int fromY, int toY) {
            this.mHandler = handler;
            this.mScrollFromY = fromY;
            this.mScrollToY = toY;
            this.mInterpolator = new AccelerateDecelerateInterpolator();
        } 
 
        @Override 
        public void run() { 
 
            /** 
             * Only set startTime if this is the first time we're starting, else 
             * actually calculate the Y delta 
             */ 
            if (mStartTime == -1) {
                mStartTime = System.currentTimeMillis();
            } else { 
 
                /** 
                 * We do do all calculations in long to reduce software float