Fix page snapping for large number pages.

Previous implementation suffered from float precision loss
causing incorrect results. Updated the int cast to only cast the
(pageOffset + truncator) which will always be a small number [0.4, 1.6)
thus will either be 0 or 1 after the cast. This way we avoid converting
currentPage to a float.

Bug: 29041279
Change-Id: I89eb0c99295a21b018859a23c75896d4c44b47ee
diff --git a/core-ui/java/android/support/v4/view/ViewPager.java b/core-ui/java/android/support/v4/view/ViewPager.java
index 9dc1477..dbbc232 100644
--- a/core-ui/java/android/support/v4/view/ViewPager.java
+++ b/core-ui/java/android/support/v4/view/ViewPager.java
@@ -2385,7 +2385,7 @@
             targetPage = velocity > 0 ? currentPage : currentPage + 1;
         } else {
             final float truncator = currentPage >= mCurItem ? 0.4f : 0.6f;
-            targetPage = (int) (currentPage + pageOffset + truncator);
+            targetPage = currentPage + (int) (pageOffset + truncator);
         }
 
         if (mItems.size() > 0) {