Here are the examples of the java api com.nineoldandroids.animation.AnimatorSet.play() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
17
Source : LoadingProgressBar.java
with Apache License 2.0
from ApolloAuto
with Apache License 2.0
from ApolloAuto
public void loadFinished() {
mProgressBar.setVisibility(View.GONE);
mRateTv.setVisibility(View.GONE);
ObjectAnimator logoScaleX1 = ObjectAnimator.ofFloat(mLogoIv, "scaleX", 0.75f, 0.6f).setDuration(200);
ObjectAnimator logoScaleY1 = ObjectAnimator.ofFloat(mLogoIv, "scaleY", 0.75f, 0.6f).setDuration(200);
ObjectAnimator logoScaleX2 = ObjectAnimator.ofFloat(mLogoIv, "scaleX", 0.6f, 1).setDuration(500);
ObjectAnimator logoScaleY2 = ObjectAnimator.ofFloat(mLogoIv, "scaleY", 0.6f, 1).setDuration(500);
ObjectAnimator logoScaleAlpha2 = ObjectAnimator.ofFloat(mLogoIv, "alpha", 0.2f, 0.6f).setDuration(300);
ObjectAnimator logoScaleAlpha3 = ObjectAnimator.ofFloat(mLogoIv, "alpha", 0.6f, 1).setDuration(200);
animSet1 = new AnimatorSet();
animSet1.playTogether(logoScaleX1, logoScaleY1);
animSet2 = new AnimatorSet();
animSet2.playTogether(logoScaleX2, logoScaleY2, logoScaleAlpha2);
animSet3 = new AnimatorSet();
animSet3.play(animSet1).before(animSet2);
animSet3.play(animSet2).before(logoScaleAlpha3);
animSet3.start();
animSet3.addListener(new AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
mLogoNameIv.setVisibility(View.VISIBLE);
ObjectAnimator logoNameScaleAlpha = ObjectAnimator.ofFloat(mLogoNameIv, "alpha", 0, 1).setDuration(300);
ObjectAnimator logoNameScaleX = ObjectAnimator.ofFloat(mLogoNameIv, "scaleX", 0, 1).setDuration(300);
ObjectAnimator logoNameScaleY = ObjectAnimator.ofFloat(mLogoNameIv, "scaleY", 0, 1).setDuration(300);
logoNameAnimSet = new AnimatorSet();
logoNameAnimSet.play(logoNameScaleAlpha).with(logoNameScaleX).with(logoNameScaleY);
logoNameAnimSet.start();
logoNameAnimSet.addListener(new AnimatorListener() {
@Override
public void onAnimationStart(Animator arg0) {
}
@Override
public void onAnimationRepeat(Animator arg0) {
}
@Override
public void onAnimationEnd(Animator arg0) {
LogUtil.d(TAG, "onAnimationEnd");
if (!cancel) {
LogUtil.d(TAG, "check cancel=false");
stopAnimation();
} else {
LogUtil.d(TAG, "check cancel=ture");
cancel = false;
}
try {
if (ConnectManager.getInstance().getConnectType() == ConnectManager.CONNECTED_BY_AOA && ConnectClient.getInstance().isCarlifeConnected()) {
String hintResStr = getResources().getString(R.string.usb_connect_aoa_request_md_permisson);
MainFragment.getInstance().updateExceptionTips(hintResStr);
}
} catch (Exception ex) {
LogUtil.d(TAG, "aoa connection get exception");
ex.printStackTrace();
}
}
@Override
public void onAnimationCancel(Animator arg0) {
LogUtil.d(TAG, "onAnimationCancel");
}
});
}
@Override
public void onAnimationCancel(Animator animation) {
}
});
}