android Programming Glossary: distx
Android: velocity-based ViewPager scrolling http://stackoverflow.com/questions/12787287/android-velocity-based-viewpager-scrolling e2 float velX float velY mFlingRunnable.startUsingVelocity int velX return false private void trackMotion float distX The following mimics the underlying calculations in ViewPager float scrollX getScrollX distX final int width getWidth final.. void trackMotion float distX The following mimics the underlying calculations in ViewPager float scrollX getScrollX distX final int width getWidth final int widthWithMargin width this.getPageMargin final float leftBound Math.max 0 this.getCurrentItem.. .getCount 1 this.setCurrentItem this.getCurrentItem 1 false Do the fake dragging if mScrolling this.fakeDragBy distX else this.beginFakeDrag this.fakeDragBy distX mScrolling true private void endFlingMotion mScrolling false this.endFakeDrag..
|