我有两个在两个活动中使用此功能,我该如何修复这个混乱?
public void startPlayActivityWithTransition() {
ViewCompat.animate(mNavigateMenu)
.translationX(-mNavigateMenu.getWidth())
.setDuration(150)
.setListener(new ViewPropertyAnimatorListenerAdapter() {
@Override
public void onAnimationEnd(View view) {
// http://stackoverflow.com/questions/40307283/why-does-running-a-second-viewpropertyanimation-on-a-view-break-the-animation-li
((ImageView)mNavigateMenu).setImageResource(R.drawable.ic_arrow_back);
ViewCompat
.animate(view)
.translationX(0)
.setDuration(150)
.setListener(new ViewPropertyAnimatorListenerAdapter() {
@Override
public void onAnimationEnd(View view) {
startPlayActivity();
}
})
.start();
}
})
.start();
}