Back to project page sixgrid.
The source code is released under:
MIT License
If you think the Android project sixgrid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package io.pure.sixgrid.transform; /*from w w w. ja v a 2 s.co m*/ import android.support.v4.view.ViewPager; import android.view.View; public class FadeInPageTransformer implements ViewPager.PageTransformer { private static final float MIN_SCALE = 0.75f; public void transformPage(View view, float position) { int pageWidth = view.getWidth(); if (position < -1) { // [-Infinity,-1) // This page is way off-screen to the left. view.setAlpha(1); } else if (position <= 0) { // [-1,0] // Use the default slide transition when moving to the left page view.setAlpha(0); } else if (position <= 1) { // (0,1] // Fade the page out. view.setAlpha(0 + position); } else { // (1,+Infinity] // This page is way off-screen to the right. view.setAlpha(1); } } }