Back to project page cnBeta.
The source code is released under:
Apache License
If you think the Android project cnBeta 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 com.guest.cnbeta.util; //w ww. j av a 2s. com import android.content.Context; import android.view.View; import android.view.animation.AccelerateInterpolator; import android.view.animation.Animation; import android.view.animation.AnimationSet; import android.view.animation.ScaleAnimation; public class ScaleAnimationHelper { Context con; int order; public ScaleAnimationHelper(Context con, int order) { this.con = con; this.order = order; } ScaleAnimation myAnimation_Scale; // ????,???????????? public void ScaleOutAnimation(View view) { myAnimation_Scale = new ScaleAnimation(0, 1.0f, 0, 1f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); myAnimation_Scale.setInterpolator(new AccelerateInterpolator()); AnimationSet as = new AnimationSet(true); as.addAnimation(myAnimation_Scale); as.setDuration(900); view.startAnimation(as); } public void ScaleInAnimation(View view) { myAnimation_Scale = new ScaleAnimation(1.0f, 0.5f, 1.0f, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); myAnimation_Scale.setInterpolator(new AccelerateInterpolator()); AnimationSet as = new AnimationSet(true); as.addAnimation(myAnimation_Scale); as.setDuration(300); view.startAnimation(as); } }