码迷,mamicode.com
首页 > 其他好文 > 详细

public class ZoomOutTranformer extends ABaseTransformer {

时间:2015-12-14 18:08:58      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:


public class ZoomOutTranformer extends ABaseTransformer {

@Override
protected void onTransform(View view, float position) {
final float scale = 1f + Math.abs(position);
view.setScaleX(scale);
view.setScaleY(scale);
view.setPivotX(view.getWidth() * 0.5f);
view.setPivotY(view.getHeight() * 0.5f);
view.setAlpha(position < -1f || position > 1f ? 0f : 1f - (scale - 1f));
if(position == -1){
view.setTranslationX(view.getWidth() * -1);
}
}

}




public class ZoomOutTranformer extends ABaseTransformer {

标签:

原文地址:http://www.cnblogs.com/yutianran/p/5045679.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!