193 lines
7.5 KiB
Java
193 lines
7.5 KiB
Java
package o;
|
|
|
|
import android.animation.Animator;
|
|
import android.animation.AnimatorInflater;
|
|
import android.content.Context;
|
|
import android.content.res.Resources;
|
|
import android.content.res.TypedArray;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.animation.Animation;
|
|
import android.view.animation.AnimationSet;
|
|
import android.view.animation.AnimationUtils;
|
|
import android.view.animation.Transformation;
|
|
import androidx.fragment.app.Fragment;
|
|
import o.IUF;
|
|
|
|
/* loaded from: classes.dex */
|
|
final class gLd {
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static LWm e(Context context, Fragment fragment, boolean z, boolean z2) {
|
|
int exitAnim;
|
|
int i;
|
|
int resourceId;
|
|
int nextTransition = fragment.getNextTransition();
|
|
if (z2) {
|
|
if (z) {
|
|
exitAnim = fragment.getPopEnterAnim();
|
|
} else {
|
|
exitAnim = fragment.getPopExitAnim();
|
|
}
|
|
} else if (z) {
|
|
exitAnim = fragment.getEnterAnim();
|
|
} else {
|
|
exitAnim = fragment.getExitAnim();
|
|
}
|
|
fragment.setAnimations(0, 0, 0, 0);
|
|
if (fragment.mContainer != null && fragment.mContainer.getTag(IUF.IeS.visible_removing_fragment_view_tag) != null) {
|
|
fragment.mContainer.setTag(IUF.IeS.visible_removing_fragment_view_tag, null);
|
|
}
|
|
if (fragment.mContainer != null && fragment.mContainer.getLayoutTransition() != null) {
|
|
return null;
|
|
}
|
|
Animation onCreateAnimation = fragment.onCreateAnimation(nextTransition, z, exitAnim);
|
|
if (onCreateAnimation != null) {
|
|
return new LWm(onCreateAnimation);
|
|
}
|
|
Animator onCreateAnimator = fragment.onCreateAnimator(nextTransition, z, exitAnim);
|
|
if (onCreateAnimator != null) {
|
|
return new LWm(onCreateAnimator);
|
|
}
|
|
if (exitAnim == 0 && nextTransition != 0) {
|
|
if (nextTransition == 4097) {
|
|
i = z ? IUF.Sts.fragment_open_enter : IUF.Sts.fragment_open_exit;
|
|
} else if (nextTransition != 8194) {
|
|
if (nextTransition != 8197) {
|
|
if (nextTransition == 4099) {
|
|
i = z ? IUF.Sts.fragment_fade_enter : IUF.Sts.fragment_fade_exit;
|
|
} else if (nextTransition != 4100) {
|
|
exitAnim = -1;
|
|
} else if (z) {
|
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(android.R.style.Animation.Activity, new int[]{android.R.attr.activityOpenEnterAnimation});
|
|
resourceId = obtainStyledAttributes.getResourceId(0, -1);
|
|
obtainStyledAttributes.recycle();
|
|
} else {
|
|
TypedArray obtainStyledAttributes2 = context.obtainStyledAttributes(android.R.style.Animation.Activity, new int[]{android.R.attr.activityOpenExitAnimation});
|
|
resourceId = obtainStyledAttributes2.getResourceId(0, -1);
|
|
obtainStyledAttributes2.recycle();
|
|
}
|
|
} else if (z) {
|
|
TypedArray obtainStyledAttributes3 = context.obtainStyledAttributes(android.R.style.Animation.Activity, new int[]{android.R.attr.activityCloseEnterAnimation});
|
|
resourceId = obtainStyledAttributes3.getResourceId(0, -1);
|
|
obtainStyledAttributes3.recycle();
|
|
} else {
|
|
TypedArray obtainStyledAttributes4 = context.obtainStyledAttributes(android.R.style.Animation.Activity, new int[]{android.R.attr.activityCloseExitAnimation});
|
|
resourceId = obtainStyledAttributes4.getResourceId(0, -1);
|
|
obtainStyledAttributes4.recycle();
|
|
}
|
|
exitAnim = resourceId;
|
|
} else {
|
|
i = z ? IUF.Sts.fragment_close_enter : IUF.Sts.fragment_close_exit;
|
|
}
|
|
exitAnim = i;
|
|
}
|
|
if (exitAnim != 0) {
|
|
boolean equals = "anim".equals(context.getResources().getResourceTypeName(exitAnim));
|
|
if (equals) {
|
|
try {
|
|
Animation loadAnimation = AnimationUtils.loadAnimation(context, exitAnim);
|
|
if (loadAnimation != null) {
|
|
return new LWm(loadAnimation);
|
|
}
|
|
} catch (Resources.NotFoundException e) {
|
|
throw e;
|
|
} catch (RuntimeException unused) {
|
|
}
|
|
}
|
|
try {
|
|
Animator loadAnimator = AnimatorInflater.loadAnimator(context, exitAnim);
|
|
if (loadAnimator != null) {
|
|
return new LWm(loadAnimator);
|
|
}
|
|
} catch (RuntimeException e2) {
|
|
if (equals) {
|
|
throw e2;
|
|
}
|
|
Animation loadAnimation2 = AnimationUtils.loadAnimation(context, exitAnim);
|
|
if (loadAnimation2 != null) {
|
|
return new LWm(loadAnimation2);
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
static class LWm {
|
|
public final Animator b;
|
|
public final Animation e;
|
|
|
|
LWm(Animation animation) {
|
|
this.e = animation;
|
|
this.b = null;
|
|
if (animation == null) {
|
|
throw new IllegalStateException("Animation cannot be null");
|
|
}
|
|
}
|
|
|
|
LWm(Animator animator) {
|
|
this.e = null;
|
|
this.b = animator;
|
|
if (animator == null) {
|
|
throw new IllegalStateException("Animator cannot be null");
|
|
}
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
static class HBt extends AnimationSet implements Runnable {
|
|
private boolean a;
|
|
private final ViewGroup b;
|
|
private boolean c;
|
|
private final View d;
|
|
private boolean e;
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public HBt(Animation animation, ViewGroup viewGroup, View view) {
|
|
super(false);
|
|
this.c = true;
|
|
this.b = viewGroup;
|
|
this.d = view;
|
|
addAnimation(animation);
|
|
viewGroup.post(this);
|
|
}
|
|
|
|
@Override // android.view.animation.AnimationSet, android.view.animation.Animation
|
|
public final boolean getTransformation(long j, Transformation transformation) {
|
|
this.c = true;
|
|
if (this.e) {
|
|
return !this.a;
|
|
}
|
|
if (!super.getTransformation(j, transformation)) {
|
|
this.e = true;
|
|
ViewTreeObserverOnPreDrawListenerC17759zYL.c(this.b, this);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@Override // android.view.animation.Animation
|
|
public final boolean getTransformation(long j, Transformation transformation, float f) {
|
|
this.c = true;
|
|
if (this.e) {
|
|
return !this.a;
|
|
}
|
|
if (!super.getTransformation(j, transformation, f)) {
|
|
this.e = true;
|
|
ViewTreeObserverOnPreDrawListenerC17759zYL.c(this.b, this);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
if (!this.e && this.c) {
|
|
this.c = false;
|
|
this.b.post(this);
|
|
} else {
|
|
this.b.endViewTransition(this.d);
|
|
this.a = true;
|
|
}
|
|
}
|
|
}
|
|
}
|