37 lines
1.3 KiB
Java
37 lines
1.3 KiB
Java
package com.twitter.sdk.android.tweetui.internal;
|
|
|
|
import android.animation.Animator;
|
|
import android.animation.AnimatorListenerAdapter;
|
|
import android.view.View;
|
|
import android.view.ViewPropertyAnimator;
|
|
|
|
/* loaded from: classes.dex */
|
|
class AnimationUtils {
|
|
public static ViewPropertyAnimator a(View view, int i) {
|
|
if (view.getVisibility() != 0) {
|
|
view.setAlpha(0.0f);
|
|
view.setVisibility(0);
|
|
}
|
|
view.clearAnimation();
|
|
ViewPropertyAnimator animate = view.animate();
|
|
animate.alpha(1.0f).setDuration(i).setListener(null);
|
|
return animate;
|
|
}
|
|
|
|
public static ViewPropertyAnimator b(final View view, int i) {
|
|
if (view.getVisibility() != 0) {
|
|
return null;
|
|
}
|
|
view.clearAnimation();
|
|
ViewPropertyAnimator animate = view.animate();
|
|
animate.alpha(0.0f).setDuration(i).setListener(new AnimatorListenerAdapter() { // from class: com.twitter.sdk.android.tweetui.internal.AnimationUtils.1
|
|
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
|
public void onAnimationEnd(Animator animator) {
|
|
view.setVisibility(4);
|
|
view.setAlpha(1.0f);
|
|
}
|
|
});
|
|
return animate;
|
|
}
|
|
}
|