I wasn't able to find a way to change Android's LayoutAnimationController
, but did come up with a simple solution that does what I want. I created a View
subclass that can selectively ignore calls to run an animation if I so choose.
public class AnimationAverseView extends View {
private boolean mIsAnimatable = true;
public void setAnimatible(boolean isAnimatable) {
if (!isAnimatable) {
clearAnimation();
}
mIsAnimatable = isAnimatable;
}
@Override
public void startAnimation(Animation animation) {
if (mIsAnimatable) {
super.startAnimation(animation);
}
}
}
I did not worry about any other possible animation-related methods, since I only animate the View
s via a LayoutAnimationController
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…