-
Notifications
You must be signed in to change notification settings - Fork 377
StateAnimatorView
ZieIony edited this page May 19, 2015
·
1 revision
public interface StateAnimatorView {
void removeStateAnimator(StateAnimator animator);
void addStateAnimator(StateAnimator animator);
}
private List<StateAnimator> stateAnimators = new ArrayList<>();
public void removeStateAnimator(StateAnimator animator) {
stateAnimators.remove(animator);
}
public void addStateAnimator(StateAnimator animator) {
this.stateAnimators.add(animator);
}
@Override
protected void drawableStateChanged() {
super.drawableStateChanged();
if (rippleDrawable != null && rippleDrawable.getStyle() != RippleDrawable.Style.Background)
rippleDrawable.setState(getDrawableState());
if (stateAnimators != null)
for (StateAnimator animator : stateAnimators)
animator.stateChanged(getDrawableState());
}
Copyright 2015 Marcin Korniluk 'Zielony'