Back to project page Swipe-Tabs.
The source code is released under:
MIT License
If you think the Android project Swipe-Tabs 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 it.bellotti.android.swipetabs.transforms; /* w w w .ja v a 2 s .com*/ import android.view.View; /** * Created with IntelliJ IDEA. * User: SimoneBellotti * Date: 24/11/2014 * Time: 12.47 */ public class ForegroundToBackgroundTransformer extends BaseTransformer { @Override protected void onTransform(View view, float position) { final float height = view.getHeight(); final float width = view.getWidth(); final float scale = Math.min(position > 0 ? 1f : Math.abs(1f + position), 0.5f); view.setScaleX(scale); view.setScaleY(scale); view.setPivotX(width * 0.5f); view.setPivotY(height * 0.5f); view.setTranslationX(position > 0 ? width * position : -width * position * 0.25f); } }