I've added an enum value "GOOGLE_ZOOM" , and used it just like any other enum value was used on this library (BTW, why weren't they valued in capital letters, as used in the conventions of enum values, and why did you use a string array ?) .
@Override
public void onPageScrolled(final int position, final float positionOffset, final int positionOffsetPixels) {
...
case GOOGLE_ZOOM:
animateGoogleZoom(mLeft, mRight, effectOffset);
break;
}
...
private void animateGoogleZoom(final View left, final View right, final float positionOffset) {
for (int i = 0; i < 2; ++i) {
final View view = i == 0 ? left : right;
if (view == null)
continue;
final float position = i == 0 ? positionOffset : 1 - positionOffset;
final int pageWidth = view.getWidth();
final int pageHeight = view.getHeight();
final float MIN_SCALE = 0.85f;
final float MIN_ALPHA = 0.5f;
if (position < -1) { // [-Infinity,-1)
// This page is way off-screen to the left.
ViewHelper.setAlpha(view, 0);
} else if (position <= 1) { // [-1,1]
// Modify the default slide transition to shrink the page as well
final float scaleFactor = Math.max(MIN_SCALE, 1 - Math.abs(position));
final float vertMargin = pageHeight * (1 - scaleFactor) / 2;
final float horzMargin = pageWidth * (1 - scaleFactor) / 2;
if (position < 0) {
ViewHelper.setTranslationX(view, horzMargin - vertMargin / 2);
} else {
ViewHelper.setTranslationX(view, -horzMargin + vertMargin / 2);
}
// Scale the page down (between MIN_SCALE and 1)
ViewHelper.setScaleX(view, scaleFactor);
ViewHelper.setScaleY(view, scaleFactor);
// Fade the page relative to its size.
ViewHelper.setAlpha(view, MIN_ALPHA + (scaleFactor - MIN_SCALE) / (1 - MIN_SCALE) * (1 - MIN_ALPHA));
} else { // (1,+Infinity]
// This page is way off-screen to the right.
ViewHelper.setAlpha(view, 0);
}
}
}