92 lines
3.1 KiB
Java
92 lines
3.1 KiB
Java
package com.discord.app;
|
|
|
|
import android.content.Context;
|
|
import androidx.annotation.AnimRes;
|
|
import androidx.appcompat.app.AppCompatActivity;
|
|
import androidx.core.app.ActivityOptionsCompat;
|
|
import com.discord.utilities.accessibility.AccessibilityUtils;
|
|
import d0.z.d.m;
|
|
/* compiled from: AppTransitionActivity.kt */
|
|
public abstract class AppTransitionActivity extends AppCompatActivity {
|
|
public static boolean i;
|
|
public a j = Transition.TYPE_SLIDE_POP_VERTICAL.getAnimations();
|
|
|
|
/* compiled from: AppTransitionActivity.kt */
|
|
public enum Transition {
|
|
TYPE_FADE(new a(2130771984, 2130771986, 2130771980, 2130771982)),
|
|
TYPE_FADE_FAST(new a(2130771985, 2130771987, 2130771981, 2130771983)),
|
|
TYPE_STANDARD(new a(2130772006, 2130772007, 2130772004, 2130772005)),
|
|
TYPE_SLIDE_HORIZONTAL(new a(2130771990, 2130771991, 2130771988, 2130771989)),
|
|
TYPE_SLIDE_VERTICAL(new a(2130772002, 2130772003, 2130772000, 2130772001)),
|
|
TYPE_SLIDE_VERTICAL_WITH_FADE(new a(2130772002, 2130771986, 2130771980, 2130772001)),
|
|
TYPE_SLIDE_POP_VERTICAL(new a(2130771998, 2130771999, 2130771996, 2130771997)),
|
|
TYPE_SLIDE_POP_HORIZONTAL(new a(2130771994, 2130771995, 2130771992, 2130771993)),
|
|
TYPE_NONE(new a(0, 0, 0, 0));
|
|
|
|
private final a animations;
|
|
|
|
private Transition(a aVar) {
|
|
this.animations = aVar;
|
|
}
|
|
|
|
public final a getAnimations() {
|
|
return this.animations;
|
|
}
|
|
|
|
public final ActivityOptionsCompat toActivityOptions(Context context) {
|
|
m.checkNotNullParameter(context, "context");
|
|
if ((!AccessibilityUtils.INSTANCE.isReducedMotionEnabled() ? this : null) == null) {
|
|
return null;
|
|
}
|
|
a aVar = this.animations;
|
|
return ActivityOptionsCompat.makeCustomAnimation(context, aVar.a, aVar.b);
|
|
}
|
|
}
|
|
|
|
/* compiled from: AppTransitionActivity.kt */
|
|
public static final class a {
|
|
public final int a;
|
|
public final int b;
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
|
public final int f1591c;
|
|
public final int d;
|
|
|
|
public a(@AnimRes int i, @AnimRes int i2, @AnimRes int i3, @AnimRes int i4) {
|
|
this.a = i;
|
|
this.b = i2;
|
|
this.f1591c = i3;
|
|
this.d = i4;
|
|
}
|
|
}
|
|
|
|
public final void a(boolean z2, boolean z3) {
|
|
a aVar;
|
|
if (z2 && z3) {
|
|
return;
|
|
}
|
|
if ((z2 || z3) && (aVar = this.j) != null) {
|
|
overridePendingTransition(z3 ? aVar.a : aVar.f1591c, z3 ? aVar.b : aVar.d);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.activity.ComponentActivity, android.app.Activity
|
|
public void onBackPressed() {
|
|
super.onBackPressed();
|
|
i = true;
|
|
}
|
|
|
|
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
|
public void onPause() {
|
|
super.onPause();
|
|
a(i, false);
|
|
}
|
|
|
|
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
|
public void onResume() {
|
|
super.onResume();
|
|
a(i, true);
|
|
i = false;
|
|
}
|
|
}
|