261 lines
9.9 KiB
Java
261 lines
9.9 KiB
Java
package androidx.transition;
|
|
|
|
import android.animation.Animator;
|
|
import android.animation.AnimatorListenerAdapter;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import androidx.transition.AnimatorUtils;
|
|
import androidx.transition.Transition;
|
|
|
|
/* loaded from: classes.dex */
|
|
public abstract class Visibility extends Transition {
|
|
private static final String[] L = {"android:visibility:visibility", "android:visibility:parent"};
|
|
private int K = 3;
|
|
|
|
private static class VisibilityInfo {
|
|
boolean a;
|
|
boolean b;
|
|
int c;
|
|
int d;
|
|
ViewGroup e;
|
|
ViewGroup f;
|
|
|
|
VisibilityInfo() {
|
|
}
|
|
}
|
|
|
|
private VisibilityInfo b(TransitionValues transitionValues, TransitionValues transitionValues2) {
|
|
VisibilityInfo visibilityInfo = new VisibilityInfo();
|
|
visibilityInfo.a = false;
|
|
visibilityInfo.b = false;
|
|
if (transitionValues == null || !transitionValues.a.containsKey("android:visibility:visibility")) {
|
|
visibilityInfo.c = -1;
|
|
visibilityInfo.e = null;
|
|
} else {
|
|
visibilityInfo.c = ((Integer) transitionValues.a.get("android:visibility:visibility")).intValue();
|
|
visibilityInfo.e = (ViewGroup) transitionValues.a.get("android:visibility:parent");
|
|
}
|
|
if (transitionValues2 == null || !transitionValues2.a.containsKey("android:visibility:visibility")) {
|
|
visibilityInfo.d = -1;
|
|
visibilityInfo.f = null;
|
|
} else {
|
|
visibilityInfo.d = ((Integer) transitionValues2.a.get("android:visibility:visibility")).intValue();
|
|
visibilityInfo.f = (ViewGroup) transitionValues2.a.get("android:visibility:parent");
|
|
}
|
|
if (transitionValues == null || transitionValues2 == null) {
|
|
if (transitionValues == null && visibilityInfo.d == 0) {
|
|
visibilityInfo.b = true;
|
|
visibilityInfo.a = true;
|
|
} else if (transitionValues2 == null && visibilityInfo.c == 0) {
|
|
visibilityInfo.b = false;
|
|
visibilityInfo.a = true;
|
|
}
|
|
} else {
|
|
if (visibilityInfo.c == visibilityInfo.d && visibilityInfo.e == visibilityInfo.f) {
|
|
return visibilityInfo;
|
|
}
|
|
int i = visibilityInfo.c;
|
|
int i2 = visibilityInfo.d;
|
|
if (i != i2) {
|
|
if (i == 0) {
|
|
visibilityInfo.b = false;
|
|
visibilityInfo.a = true;
|
|
} else if (i2 == 0) {
|
|
visibilityInfo.b = true;
|
|
visibilityInfo.a = true;
|
|
}
|
|
} else if (visibilityInfo.f == null) {
|
|
visibilityInfo.b = false;
|
|
visibilityInfo.a = true;
|
|
} else if (visibilityInfo.e == null) {
|
|
visibilityInfo.b = true;
|
|
visibilityInfo.a = true;
|
|
}
|
|
}
|
|
return visibilityInfo;
|
|
}
|
|
|
|
private void d(TransitionValues transitionValues) {
|
|
transitionValues.a.put("android:visibility:visibility", Integer.valueOf(transitionValues.b.getVisibility()));
|
|
transitionValues.a.put("android:visibility:parent", transitionValues.b.getParent());
|
|
int[] iArr = new int[2];
|
|
transitionValues.b.getLocationOnScreen(iArr);
|
|
transitionValues.a.put("android:visibility:screenLocation", iArr);
|
|
}
|
|
|
|
public abstract Animator a(ViewGroup viewGroup, View view, TransitionValues transitionValues, TransitionValues transitionValues2);
|
|
|
|
public void a(int i) {
|
|
if ((i & (-4)) != 0) {
|
|
throw new IllegalArgumentException("Only MODE_IN and MODE_OUT flags are allowed");
|
|
}
|
|
this.K = i;
|
|
}
|
|
|
|
public abstract Animator b(ViewGroup viewGroup, View view, TransitionValues transitionValues, TransitionValues transitionValues2);
|
|
|
|
@Override // androidx.transition.Transition
|
|
public void c(TransitionValues transitionValues) {
|
|
d(transitionValues);
|
|
}
|
|
|
|
@Override // androidx.transition.Transition
|
|
public String[] r() {
|
|
return L;
|
|
}
|
|
|
|
@Override // androidx.transition.Transition
|
|
public void a(TransitionValues transitionValues) {
|
|
d(transitionValues);
|
|
}
|
|
|
|
@Override // androidx.transition.Transition
|
|
public Animator a(ViewGroup viewGroup, TransitionValues transitionValues, TransitionValues transitionValues2) {
|
|
VisibilityInfo b = b(transitionValues, transitionValues2);
|
|
if (!b.a) {
|
|
return null;
|
|
}
|
|
if (b.e == null && b.f == null) {
|
|
return null;
|
|
}
|
|
if (b.b) {
|
|
return a(viewGroup, transitionValues, b.c, transitionValues2, b.d);
|
|
}
|
|
return b(viewGroup, transitionValues, b.c, transitionValues2, b.d);
|
|
}
|
|
|
|
private static class DisappearListener extends AnimatorListenerAdapter implements Transition.TransitionListener, AnimatorUtils.AnimatorPauseListenerCompat {
|
|
private final View a;
|
|
private final int b;
|
|
private final ViewGroup c;
|
|
private final boolean d;
|
|
private boolean e;
|
|
boolean f = false;
|
|
|
|
DisappearListener(View view, int i, boolean z) {
|
|
this.a = view;
|
|
this.b = i;
|
|
this.c = (ViewGroup) view.getParent();
|
|
this.d = z;
|
|
a(true);
|
|
}
|
|
|
|
private void a() {
|
|
if (!this.f) {
|
|
ViewUtils.a(this.a, this.b);
|
|
ViewGroup viewGroup = this.c;
|
|
if (viewGroup != null) {
|
|
viewGroup.invalidate();
|
|
}
|
|
}
|
|
a(false);
|
|
}
|
|
|
|
@Override // androidx.transition.Transition.TransitionListener
|
|
public void a(Transition transition) {
|
|
}
|
|
|
|
@Override // androidx.transition.Transition.TransitionListener
|
|
public void b(Transition transition) {
|
|
a(false);
|
|
}
|
|
|
|
@Override // androidx.transition.Transition.TransitionListener
|
|
public void c(Transition transition) {
|
|
a();
|
|
transition.b(this);
|
|
}
|
|
|
|
@Override // androidx.transition.Transition.TransitionListener
|
|
public void d(Transition transition) {
|
|
a(true);
|
|
}
|
|
|
|
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
|
public void onAnimationCancel(Animator animator) {
|
|
this.f = true;
|
|
}
|
|
|
|
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
|
public void onAnimationEnd(Animator animator) {
|
|
a();
|
|
}
|
|
|
|
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorPauseListener, androidx.transition.AnimatorUtils.AnimatorPauseListenerCompat
|
|
public void onAnimationPause(Animator animator) {
|
|
if (this.f) {
|
|
return;
|
|
}
|
|
ViewUtils.a(this.a, this.b);
|
|
}
|
|
|
|
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
|
public void onAnimationRepeat(Animator animator) {
|
|
}
|
|
|
|
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorPauseListener, androidx.transition.AnimatorUtils.AnimatorPauseListenerCompat
|
|
public void onAnimationResume(Animator animator) {
|
|
if (this.f) {
|
|
return;
|
|
}
|
|
ViewUtils.a(this.a, 0);
|
|
}
|
|
|
|
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
|
|
public void onAnimationStart(Animator animator) {
|
|
}
|
|
|
|
private void a(boolean z) {
|
|
ViewGroup viewGroup;
|
|
if (!this.d || this.e == z || (viewGroup = this.c) == null) {
|
|
return;
|
|
}
|
|
this.e = z;
|
|
ViewGroupUtils.a(viewGroup, z);
|
|
}
|
|
}
|
|
|
|
public Animator a(ViewGroup viewGroup, TransitionValues transitionValues, int i, TransitionValues transitionValues2, int i2) {
|
|
if ((this.K & 1) != 1 || transitionValues2 == null) {
|
|
return null;
|
|
}
|
|
if (transitionValues == null) {
|
|
View view = (View) transitionValues2.b.getParent();
|
|
if (b(a(view, false), b(view, false)).a) {
|
|
return null;
|
|
}
|
|
}
|
|
return a(viewGroup, transitionValues2.b, transitionValues, transitionValues2);
|
|
}
|
|
|
|
@Override // androidx.transition.Transition
|
|
public boolean a(TransitionValues transitionValues, TransitionValues transitionValues2) {
|
|
if (transitionValues == null && transitionValues2 == null) {
|
|
return false;
|
|
}
|
|
if (transitionValues != null && transitionValues2 != null && transitionValues2.a.containsKey("android:visibility:visibility") != transitionValues.a.containsKey("android:visibility:visibility")) {
|
|
return false;
|
|
}
|
|
VisibilityInfo b = b(transitionValues, transitionValues2);
|
|
if (b.a) {
|
|
return b.c == 0 || b.d == 0;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:22:0x0087 A[ADDED_TO_REGION] */
|
|
/* JADX WARN: Removed duplicated region for block: B:29:0x00ce */
|
|
/* JADX WARN: Removed duplicated region for block: B:34:0x00ee A[RETURN] */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
public android.animation.Animator b(android.view.ViewGroup r7, androidx.transition.TransitionValues r8, int r9, androidx.transition.TransitionValues r10, int r11) {
|
|
/*
|
|
Method dump skipped, instructions count: 239
|
|
To view this dump change 'Code comments level' option to 'DEBUG'
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.transition.Visibility.b(android.view.ViewGroup, androidx.transition.TransitionValues, int, androidx.transition.TransitionValues, int):android.animation.Animator");
|
|
}
|
|
}
|