Initial commit
This commit is contained in:
654
sources/androidx/fragment/app/BackStackRecord.java
Normal file
654
sources/androidx/fragment/app/BackStackRecord.java
Normal file
@@ -0,0 +1,654 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.util.Log;
|
||||
import androidx.core.util.LogWriter;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentManagerImpl;
|
||||
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class BackStackRecord extends FragmentTransaction implements FragmentManager.BackStackEntry, FragmentManagerImpl.OpGenerator {
|
||||
final FragmentManagerImpl a;
|
||||
int c;
|
||||
int d;
|
||||
int e;
|
||||
int f;
|
||||
int g;
|
||||
int h;
|
||||
boolean i;
|
||||
String k;
|
||||
boolean l;
|
||||
int n;
|
||||
CharSequence o;
|
||||
int p;
|
||||
CharSequence q;
|
||||
ArrayList<String> r;
|
||||
ArrayList<String> s;
|
||||
ArrayList<Runnable> u;
|
||||
ArrayList<Op> b = new ArrayList<>();
|
||||
boolean j = true;
|
||||
int m = -1;
|
||||
boolean t = false;
|
||||
|
||||
static final class Op {
|
||||
int a;
|
||||
Fragment b;
|
||||
int c;
|
||||
int d;
|
||||
int e;
|
||||
int f;
|
||||
|
||||
Op() {
|
||||
}
|
||||
|
||||
Op(int i, Fragment fragment) {
|
||||
this.a = i;
|
||||
this.b = fragment;
|
||||
}
|
||||
}
|
||||
|
||||
public BackStackRecord(FragmentManagerImpl fragmentManagerImpl) {
|
||||
this.a = fragmentManagerImpl;
|
||||
}
|
||||
|
||||
public void a(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
|
||||
a(str, printWriter, true);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransaction
|
||||
public FragmentTransaction b(int i, Fragment fragment) {
|
||||
b(i, fragment, null);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransaction
|
||||
public FragmentTransaction c(Fragment fragment) {
|
||||
a(new Op(4, fragment));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransaction
|
||||
public FragmentTransaction d(Fragment fragment) {
|
||||
a(new Op(3, fragment));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransaction
|
||||
public FragmentTransaction e(Fragment fragment) {
|
||||
a(new Op(5, fragment));
|
||||
return this;
|
||||
}
|
||||
|
||||
public String f() {
|
||||
return this.k;
|
||||
}
|
||||
|
||||
boolean g() {
|
||||
for (int i = 0; i < this.b.size(); i++) {
|
||||
if (b(this.b.get(i))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void h() {
|
||||
ArrayList<Runnable> arrayList = this.u;
|
||||
if (arrayList != null) {
|
||||
int size = arrayList.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
this.u.get(i).run();
|
||||
}
|
||||
this.u = null;
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder(PeripheralType.SERVO);
|
||||
sb.append("BackStackEntry{");
|
||||
sb.append(Integer.toHexString(System.identityHashCode(this)));
|
||||
if (this.m >= 0) {
|
||||
sb.append(" #");
|
||||
sb.append(this.m);
|
||||
}
|
||||
if (this.k != null) {
|
||||
sb.append(" ");
|
||||
sb.append(this.k);
|
||||
}
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void a(String str, PrintWriter printWriter, boolean z) {
|
||||
String str2;
|
||||
if (z) {
|
||||
printWriter.print(str);
|
||||
printWriter.print("mName=");
|
||||
printWriter.print(this.k);
|
||||
printWriter.print(" mIndex=");
|
||||
printWriter.print(this.m);
|
||||
printWriter.print(" mCommitted=");
|
||||
printWriter.println(this.l);
|
||||
if (this.g != 0) {
|
||||
printWriter.print(str);
|
||||
printWriter.print("mTransition=#");
|
||||
printWriter.print(Integer.toHexString(this.g));
|
||||
printWriter.print(" mTransitionStyle=#");
|
||||
printWriter.println(Integer.toHexString(this.h));
|
||||
}
|
||||
if (this.c != 0 || this.d != 0) {
|
||||
printWriter.print(str);
|
||||
printWriter.print("mEnterAnim=#");
|
||||
printWriter.print(Integer.toHexString(this.c));
|
||||
printWriter.print(" mExitAnim=#");
|
||||
printWriter.println(Integer.toHexString(this.d));
|
||||
}
|
||||
if (this.e != 0 || this.f != 0) {
|
||||
printWriter.print(str);
|
||||
printWriter.print("mPopEnterAnim=#");
|
||||
printWriter.print(Integer.toHexString(this.e));
|
||||
printWriter.print(" mPopExitAnim=#");
|
||||
printWriter.println(Integer.toHexString(this.f));
|
||||
}
|
||||
if (this.n != 0 || this.o != null) {
|
||||
printWriter.print(str);
|
||||
printWriter.print("mBreadCrumbTitleRes=#");
|
||||
printWriter.print(Integer.toHexString(this.n));
|
||||
printWriter.print(" mBreadCrumbTitleText=");
|
||||
printWriter.println(this.o);
|
||||
}
|
||||
if (this.p != 0 || this.q != null) {
|
||||
printWriter.print(str);
|
||||
printWriter.print("mBreadCrumbShortTitleRes=#");
|
||||
printWriter.print(Integer.toHexString(this.p));
|
||||
printWriter.print(" mBreadCrumbShortTitleText=");
|
||||
printWriter.println(this.q);
|
||||
}
|
||||
}
|
||||
if (this.b.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
printWriter.print(str);
|
||||
printWriter.println("Operations:");
|
||||
String str3 = str + " ";
|
||||
int size = this.b.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
Op op = this.b.get(i);
|
||||
switch (op.a) {
|
||||
case 0:
|
||||
str2 = "NULL";
|
||||
break;
|
||||
case 1:
|
||||
str2 = "ADD";
|
||||
break;
|
||||
case 2:
|
||||
str2 = "REPLACE";
|
||||
break;
|
||||
case 3:
|
||||
str2 = "REMOVE";
|
||||
break;
|
||||
case 4:
|
||||
str2 = "HIDE";
|
||||
break;
|
||||
case 5:
|
||||
str2 = "SHOW";
|
||||
break;
|
||||
case 6:
|
||||
str2 = "DETACH";
|
||||
break;
|
||||
case 7:
|
||||
str2 = "ATTACH";
|
||||
break;
|
||||
case 8:
|
||||
str2 = "SET_PRIMARY_NAV";
|
||||
break;
|
||||
case 9:
|
||||
str2 = "UNSET_PRIMARY_NAV";
|
||||
break;
|
||||
default:
|
||||
str2 = "cmd=" + op.a;
|
||||
break;
|
||||
}
|
||||
printWriter.print(str);
|
||||
printWriter.print(" Op #");
|
||||
printWriter.print(i);
|
||||
printWriter.print(": ");
|
||||
printWriter.print(str2);
|
||||
printWriter.print(" ");
|
||||
printWriter.println(op.b);
|
||||
if (z) {
|
||||
if (op.c != 0 || op.d != 0) {
|
||||
printWriter.print(str);
|
||||
printWriter.print("enterAnim=#");
|
||||
printWriter.print(Integer.toHexString(op.c));
|
||||
printWriter.print(" exitAnim=#");
|
||||
printWriter.println(Integer.toHexString(op.d));
|
||||
}
|
||||
if (op.e != 0 || op.f != 0) {
|
||||
printWriter.print(str);
|
||||
printWriter.print("popEnterAnim=#");
|
||||
printWriter.print(Integer.toHexString(op.e));
|
||||
printWriter.print(" popExitAnim=#");
|
||||
printWriter.println(Integer.toHexString(op.f));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransaction
|
||||
public FragmentTransaction b(int i, Fragment fragment, String str) {
|
||||
if (i == 0) {
|
||||
throw new IllegalArgumentException("Must use non-zero containerViewId");
|
||||
}
|
||||
a(i, fragment, str, 2);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransaction
|
||||
public void c() {
|
||||
d();
|
||||
this.a.b((FragmentManagerImpl.OpGenerator) this, true);
|
||||
}
|
||||
|
||||
public FragmentTransaction d() {
|
||||
if (this.i) {
|
||||
throw new IllegalStateException("This transaction is already being added to the back stack");
|
||||
}
|
||||
this.j = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
void e() {
|
||||
int size = this.b.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
Op op = this.b.get(i);
|
||||
Fragment fragment = op.b;
|
||||
if (fragment != null) {
|
||||
fragment.setNextTransition(this.g, this.h);
|
||||
}
|
||||
switch (op.a) {
|
||||
case 1:
|
||||
fragment.setNextAnim(op.c);
|
||||
this.a.a(fragment, false);
|
||||
break;
|
||||
case 2:
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown cmd: " + op.a);
|
||||
case 3:
|
||||
fragment.setNextAnim(op.d);
|
||||
this.a.l(fragment);
|
||||
break;
|
||||
case 4:
|
||||
fragment.setNextAnim(op.d);
|
||||
this.a.f(fragment);
|
||||
break;
|
||||
case 5:
|
||||
fragment.setNextAnim(op.c);
|
||||
this.a.p(fragment);
|
||||
break;
|
||||
case 6:
|
||||
fragment.setNextAnim(op.d);
|
||||
this.a.d(fragment);
|
||||
break;
|
||||
case 7:
|
||||
fragment.setNextAnim(op.c);
|
||||
this.a.b(fragment);
|
||||
break;
|
||||
case 8:
|
||||
this.a.o(fragment);
|
||||
break;
|
||||
case 9:
|
||||
this.a.o(null);
|
||||
break;
|
||||
}
|
||||
if (!this.t && op.a != 1 && fragment != null) {
|
||||
this.a.i(fragment);
|
||||
}
|
||||
}
|
||||
if (this.t) {
|
||||
return;
|
||||
}
|
||||
FragmentManagerImpl fragmentManagerImpl = this.a;
|
||||
fragmentManagerImpl.a(fragmentManagerImpl.l, true);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransaction
|
||||
public FragmentTransaction b(Fragment fragment) {
|
||||
a(new Op(6, fragment));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransaction
|
||||
public int b() {
|
||||
return a(true);
|
||||
}
|
||||
|
||||
boolean b(int i) {
|
||||
int size = this.b.size();
|
||||
for (int i2 = 0; i2 < size; i2++) {
|
||||
Fragment fragment = this.b.get(i2).b;
|
||||
int i3 = fragment != null ? fragment.mContainerId : 0;
|
||||
if (i3 != 0 && i3 == i) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void b(boolean z) {
|
||||
for (int size = this.b.size() - 1; size >= 0; size--) {
|
||||
Op op = this.b.get(size);
|
||||
Fragment fragment = op.b;
|
||||
if (fragment != null) {
|
||||
fragment.setNextTransition(FragmentManagerImpl.e(this.g), this.h);
|
||||
}
|
||||
switch (op.a) {
|
||||
case 1:
|
||||
fragment.setNextAnim(op.f);
|
||||
this.a.l(fragment);
|
||||
break;
|
||||
case 2:
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown cmd: " + op.a);
|
||||
case 3:
|
||||
fragment.setNextAnim(op.e);
|
||||
this.a.a(fragment, false);
|
||||
break;
|
||||
case 4:
|
||||
fragment.setNextAnim(op.e);
|
||||
this.a.p(fragment);
|
||||
break;
|
||||
case 5:
|
||||
fragment.setNextAnim(op.f);
|
||||
this.a.f(fragment);
|
||||
break;
|
||||
case 6:
|
||||
fragment.setNextAnim(op.e);
|
||||
this.a.b(fragment);
|
||||
break;
|
||||
case 7:
|
||||
fragment.setNextAnim(op.f);
|
||||
this.a.d(fragment);
|
||||
break;
|
||||
case 8:
|
||||
this.a.o(null);
|
||||
break;
|
||||
case 9:
|
||||
this.a.o(fragment);
|
||||
break;
|
||||
}
|
||||
if (!this.t && op.a != 3 && fragment != null) {
|
||||
this.a.i(fragment);
|
||||
}
|
||||
}
|
||||
if (this.t || !z) {
|
||||
return;
|
||||
}
|
||||
FragmentManagerImpl fragmentManagerImpl = this.a;
|
||||
fragmentManagerImpl.a(fragmentManagerImpl.l, true);
|
||||
}
|
||||
|
||||
Fragment b(ArrayList<Fragment> arrayList, Fragment fragment) {
|
||||
for (int i = 0; i < this.b.size(); i++) {
|
||||
Op op = this.b.get(i);
|
||||
int i2 = op.a;
|
||||
if (i2 != 1) {
|
||||
if (i2 != 3) {
|
||||
switch (i2) {
|
||||
case 8:
|
||||
fragment = null;
|
||||
break;
|
||||
case 9:
|
||||
fragment = op.b;
|
||||
break;
|
||||
}
|
||||
}
|
||||
arrayList.add(op.b);
|
||||
}
|
||||
arrayList.remove(op.b);
|
||||
}
|
||||
return fragment;
|
||||
}
|
||||
|
||||
private static boolean b(Op op) {
|
||||
Fragment fragment = op.b;
|
||||
return (fragment == null || !fragment.mAdded || fragment.mView == null || fragment.mDetached || fragment.mHidden || !fragment.isPostponed()) ? false : true;
|
||||
}
|
||||
|
||||
void a(Op op) {
|
||||
this.b.add(op);
|
||||
op.c = this.c;
|
||||
op.d = this.d;
|
||||
op.e = this.e;
|
||||
op.f = this.f;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransaction
|
||||
public FragmentTransaction a(Fragment fragment, String str) {
|
||||
a(0, fragment, str, 1);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransaction
|
||||
public FragmentTransaction a(int i, Fragment fragment) {
|
||||
a(i, fragment, (String) null, 1);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransaction
|
||||
public FragmentTransaction a(int i, Fragment fragment, String str) {
|
||||
a(i, fragment, str, 1);
|
||||
return this;
|
||||
}
|
||||
|
||||
private void a(int i, Fragment fragment, String str, int i2) {
|
||||
Class<?> cls = fragment.getClass();
|
||||
int modifiers = cls.getModifiers();
|
||||
if (!cls.isAnonymousClass() && Modifier.isPublic(modifiers) && (!cls.isMemberClass() || Modifier.isStatic(modifiers))) {
|
||||
fragment.mFragmentManager = this.a;
|
||||
if (str != null) {
|
||||
String str2 = fragment.mTag;
|
||||
if (str2 != null && !str.equals(str2)) {
|
||||
throw new IllegalStateException("Can't change tag of fragment " + fragment + ": was " + fragment.mTag + " now " + str);
|
||||
}
|
||||
fragment.mTag = str;
|
||||
}
|
||||
if (i != 0) {
|
||||
if (i != -1) {
|
||||
int i3 = fragment.mFragmentId;
|
||||
if (i3 != 0 && i3 != i) {
|
||||
throw new IllegalStateException("Can't change container ID of fragment " + fragment + ": was " + fragment.mFragmentId + " now " + i);
|
||||
}
|
||||
fragment.mFragmentId = i;
|
||||
fragment.mContainerId = i;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Can't add fragment " + fragment + " with tag " + str + " to container view with no id");
|
||||
}
|
||||
}
|
||||
a(new Op(i2, fragment));
|
||||
return;
|
||||
}
|
||||
throw new IllegalStateException("Fragment " + cls.getCanonicalName() + " must be a public static class to be properly recreated from instance state.");
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransaction
|
||||
public FragmentTransaction a(Fragment fragment) {
|
||||
a(new Op(7, fragment));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransaction
|
||||
public FragmentTransaction a(String str) {
|
||||
if (this.j) {
|
||||
this.i = true;
|
||||
this.k = str;
|
||||
return this;
|
||||
}
|
||||
throw new IllegalStateException("This FragmentTransaction is not allowed to be added to the back stack.");
|
||||
}
|
||||
|
||||
void a(int i) {
|
||||
if (this.i) {
|
||||
if (FragmentManagerImpl.F) {
|
||||
Log.v("FragmentManager", "Bump nesting in " + this + " by " + i);
|
||||
}
|
||||
int size = this.b.size();
|
||||
for (int i2 = 0; i2 < size; i2++) {
|
||||
Op op = this.b.get(i2);
|
||||
Fragment fragment = op.b;
|
||||
if (fragment != null) {
|
||||
fragment.mBackStackNesting += i;
|
||||
if (FragmentManagerImpl.F) {
|
||||
Log.v("FragmentManager", "Bump nesting of " + op.b + " to " + op.b.mBackStackNesting);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransaction
|
||||
public int a() {
|
||||
return a(false);
|
||||
}
|
||||
|
||||
int a(boolean z) {
|
||||
if (!this.l) {
|
||||
if (FragmentManagerImpl.F) {
|
||||
Log.v("FragmentManager", "Commit: " + this);
|
||||
PrintWriter printWriter = new PrintWriter(new LogWriter("FragmentManager"));
|
||||
a(" ", (FileDescriptor) null, printWriter, (String[]) null);
|
||||
printWriter.close();
|
||||
}
|
||||
this.l = true;
|
||||
if (this.i) {
|
||||
this.m = this.a.b(this);
|
||||
} else {
|
||||
this.m = -1;
|
||||
}
|
||||
this.a.a(this, z);
|
||||
return this.m;
|
||||
}
|
||||
throw new IllegalStateException("commit already called");
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentManagerImpl.OpGenerator
|
||||
public boolean a(ArrayList<BackStackRecord> arrayList, ArrayList<Boolean> arrayList2) {
|
||||
if (FragmentManagerImpl.F) {
|
||||
Log.v("FragmentManager", "Run: " + this);
|
||||
}
|
||||
arrayList.add(this);
|
||||
arrayList2.add(false);
|
||||
if (!this.i) {
|
||||
return true;
|
||||
}
|
||||
this.a.a(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean a(ArrayList<BackStackRecord> arrayList, int i, int i2) {
|
||||
if (i2 == i) {
|
||||
return false;
|
||||
}
|
||||
int size = this.b.size();
|
||||
int i3 = -1;
|
||||
for (int i4 = 0; i4 < size; i4++) {
|
||||
Fragment fragment = this.b.get(i4).b;
|
||||
int i5 = fragment != null ? fragment.mContainerId : 0;
|
||||
if (i5 != 0 && i5 != i3) {
|
||||
for (int i6 = i; i6 < i2; i6++) {
|
||||
BackStackRecord backStackRecord = arrayList.get(i6);
|
||||
int size2 = backStackRecord.b.size();
|
||||
for (int i7 = 0; i7 < size2; i7++) {
|
||||
Fragment fragment2 = backStackRecord.b.get(i7).b;
|
||||
if ((fragment2 != null ? fragment2.mContainerId : 0) == i5) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
i3 = i5;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Fragment a(ArrayList<Fragment> arrayList, Fragment fragment) {
|
||||
Fragment fragment2 = fragment;
|
||||
int i = 0;
|
||||
while (i < this.b.size()) {
|
||||
Op op = this.b.get(i);
|
||||
int i2 = op.a;
|
||||
if (i2 != 1) {
|
||||
if (i2 == 2) {
|
||||
Fragment fragment3 = op.b;
|
||||
int i3 = fragment3.mContainerId;
|
||||
Fragment fragment4 = fragment2;
|
||||
int i4 = i;
|
||||
boolean z = false;
|
||||
for (int size = arrayList.size() - 1; size >= 0; size--) {
|
||||
Fragment fragment5 = arrayList.get(size);
|
||||
if (fragment5.mContainerId == i3) {
|
||||
if (fragment5 == fragment3) {
|
||||
z = true;
|
||||
} else {
|
||||
if (fragment5 == fragment4) {
|
||||
this.b.add(i4, new Op(9, fragment5));
|
||||
i4++;
|
||||
fragment4 = null;
|
||||
}
|
||||
Op op2 = new Op(3, fragment5);
|
||||
op2.c = op.c;
|
||||
op2.e = op.e;
|
||||
op2.d = op.d;
|
||||
op2.f = op.f;
|
||||
this.b.add(i4, op2);
|
||||
arrayList.remove(fragment5);
|
||||
i4++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (z) {
|
||||
this.b.remove(i4);
|
||||
i4--;
|
||||
} else {
|
||||
op.a = 1;
|
||||
arrayList.add(fragment3);
|
||||
}
|
||||
i = i4;
|
||||
fragment2 = fragment4;
|
||||
} else if (i2 == 3 || i2 == 6) {
|
||||
arrayList.remove(op.b);
|
||||
Fragment fragment6 = op.b;
|
||||
if (fragment6 == fragment2) {
|
||||
this.b.add(i, new Op(9, fragment6));
|
||||
i++;
|
||||
fragment2 = null;
|
||||
}
|
||||
} else if (i2 != 7) {
|
||||
if (i2 == 8) {
|
||||
this.b.add(i, new Op(9, fragment2));
|
||||
i++;
|
||||
fragment2 = op.b;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
arrayList.add(op.b);
|
||||
i++;
|
||||
}
|
||||
return fragment2;
|
||||
}
|
||||
|
||||
void a(Fragment.OnStartEnterTransitionListener onStartEnterTransitionListener) {
|
||||
for (int i = 0; i < this.b.size(); i++) {
|
||||
Op op = this.b.get(i);
|
||||
if (b(op)) {
|
||||
op.b.setOnStartEnterTransitionListener(onStartEnterTransitionListener);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
162
sources/androidx/fragment/app/BackStackState.java
Normal file
162
sources/androidx/fragment/app/BackStackState.java
Normal file
@@ -0,0 +1,162 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import androidx.fragment.app.BackStackRecord;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* compiled from: BackStackRecord.java */
|
||||
/* loaded from: classes.dex */
|
||||
final class BackStackState implements Parcelable {
|
||||
public static final Parcelable.Creator<BackStackState> CREATOR = new Parcelable.Creator<BackStackState>() { // from class: androidx.fragment.app.BackStackState.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public BackStackState createFromParcel(Parcel parcel) {
|
||||
return new BackStackState(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public BackStackState[] newArray(int i) {
|
||||
return new BackStackState[i];
|
||||
}
|
||||
};
|
||||
final int mBreadCrumbShortTitleRes;
|
||||
final CharSequence mBreadCrumbShortTitleText;
|
||||
final int mBreadCrumbTitleRes;
|
||||
final CharSequence mBreadCrumbTitleText;
|
||||
final int mIndex;
|
||||
final String mName;
|
||||
final int[] mOps;
|
||||
final boolean mReorderingAllowed;
|
||||
final ArrayList<String> mSharedElementSourceNames;
|
||||
final ArrayList<String> mSharedElementTargetNames;
|
||||
final int mTransition;
|
||||
final int mTransitionStyle;
|
||||
|
||||
public BackStackState(BackStackRecord backStackRecord) {
|
||||
int size = backStackRecord.b.size();
|
||||
this.mOps = new int[size * 6];
|
||||
if (!backStackRecord.i) {
|
||||
throw new IllegalStateException("Not on back stack");
|
||||
}
|
||||
int i = 0;
|
||||
for (int i2 = 0; i2 < size; i2++) {
|
||||
BackStackRecord.Op op = backStackRecord.b.get(i2);
|
||||
int[] iArr = this.mOps;
|
||||
int i3 = i + 1;
|
||||
iArr[i] = op.a;
|
||||
int i4 = i3 + 1;
|
||||
Fragment fragment = op.b;
|
||||
iArr[i3] = fragment != null ? fragment.mIndex : -1;
|
||||
int[] iArr2 = this.mOps;
|
||||
int i5 = i4 + 1;
|
||||
iArr2[i4] = op.c;
|
||||
int i6 = i5 + 1;
|
||||
iArr2[i5] = op.d;
|
||||
int i7 = i6 + 1;
|
||||
iArr2[i6] = op.e;
|
||||
i = i7 + 1;
|
||||
iArr2[i7] = op.f;
|
||||
}
|
||||
this.mTransition = backStackRecord.g;
|
||||
this.mTransitionStyle = backStackRecord.h;
|
||||
this.mName = backStackRecord.k;
|
||||
this.mIndex = backStackRecord.m;
|
||||
this.mBreadCrumbTitleRes = backStackRecord.n;
|
||||
this.mBreadCrumbTitleText = backStackRecord.o;
|
||||
this.mBreadCrumbShortTitleRes = backStackRecord.p;
|
||||
this.mBreadCrumbShortTitleText = backStackRecord.q;
|
||||
this.mSharedElementSourceNames = backStackRecord.r;
|
||||
this.mSharedElementTargetNames = backStackRecord.s;
|
||||
this.mReorderingAllowed = backStackRecord.t;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public BackStackRecord instantiate(FragmentManagerImpl fragmentManagerImpl) {
|
||||
BackStackRecord backStackRecord = new BackStackRecord(fragmentManagerImpl);
|
||||
int i = 0;
|
||||
int i2 = 0;
|
||||
while (i < this.mOps.length) {
|
||||
BackStackRecord.Op op = new BackStackRecord.Op();
|
||||
int i3 = i + 1;
|
||||
op.a = this.mOps[i];
|
||||
if (FragmentManagerImpl.F) {
|
||||
Log.v("FragmentManager", "Instantiate " + backStackRecord + " op #" + i2 + " base fragment #" + this.mOps[i3]);
|
||||
}
|
||||
int i4 = i3 + 1;
|
||||
int i5 = this.mOps[i3];
|
||||
if (i5 >= 0) {
|
||||
op.b = fragmentManagerImpl.e.get(i5);
|
||||
} else {
|
||||
op.b = null;
|
||||
}
|
||||
int[] iArr = this.mOps;
|
||||
int i6 = i4 + 1;
|
||||
op.c = iArr[i4];
|
||||
int i7 = i6 + 1;
|
||||
op.d = iArr[i6];
|
||||
int i8 = i7 + 1;
|
||||
op.e = iArr[i7];
|
||||
op.f = iArr[i8];
|
||||
backStackRecord.c = op.c;
|
||||
backStackRecord.d = op.d;
|
||||
backStackRecord.e = op.e;
|
||||
backStackRecord.f = op.f;
|
||||
backStackRecord.a(op);
|
||||
i2++;
|
||||
i = i8 + 1;
|
||||
}
|
||||
backStackRecord.g = this.mTransition;
|
||||
backStackRecord.h = this.mTransitionStyle;
|
||||
backStackRecord.k = this.mName;
|
||||
backStackRecord.m = this.mIndex;
|
||||
backStackRecord.i = true;
|
||||
backStackRecord.n = this.mBreadCrumbTitleRes;
|
||||
backStackRecord.o = this.mBreadCrumbTitleText;
|
||||
backStackRecord.p = this.mBreadCrumbShortTitleRes;
|
||||
backStackRecord.q = this.mBreadCrumbShortTitleText;
|
||||
backStackRecord.r = this.mSharedElementSourceNames;
|
||||
backStackRecord.s = this.mSharedElementTargetNames;
|
||||
backStackRecord.t = this.mReorderingAllowed;
|
||||
backStackRecord.a(1);
|
||||
return backStackRecord;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeIntArray(this.mOps);
|
||||
parcel.writeInt(this.mTransition);
|
||||
parcel.writeInt(this.mTransitionStyle);
|
||||
parcel.writeString(this.mName);
|
||||
parcel.writeInt(this.mIndex);
|
||||
parcel.writeInt(this.mBreadCrumbTitleRes);
|
||||
TextUtils.writeToParcel(this.mBreadCrumbTitleText, parcel, 0);
|
||||
parcel.writeInt(this.mBreadCrumbShortTitleRes);
|
||||
TextUtils.writeToParcel(this.mBreadCrumbShortTitleText, parcel, 0);
|
||||
parcel.writeStringList(this.mSharedElementSourceNames);
|
||||
parcel.writeStringList(this.mSharedElementTargetNames);
|
||||
parcel.writeInt(this.mReorderingAllowed ? 1 : 0);
|
||||
}
|
||||
|
||||
public BackStackState(Parcel parcel) {
|
||||
this.mOps = parcel.createIntArray();
|
||||
this.mTransition = parcel.readInt();
|
||||
this.mTransitionStyle = parcel.readInt();
|
||||
this.mName = parcel.readString();
|
||||
this.mIndex = parcel.readInt();
|
||||
this.mBreadCrumbTitleRes = parcel.readInt();
|
||||
this.mBreadCrumbTitleText = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
|
||||
this.mBreadCrumbShortTitleRes = parcel.readInt();
|
||||
this.mBreadCrumbShortTitleText = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
|
||||
this.mSharedElementSourceNames = parcel.createStringArrayList();
|
||||
this.mSharedElementTargetNames = parcel.createStringArrayList();
|
||||
this.mReorderingAllowed = parcel.readInt() != 0;
|
||||
}
|
||||
}
|
220
sources/androidx/fragment/app/DialogFragment.java
Normal file
220
sources/androidx/fragment/app/DialogFragment.java
Normal file
@@ -0,0 +1,220 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DialogFragment extends Fragment implements DialogInterface.OnCancelListener, DialogInterface.OnDismissListener {
|
||||
int a = 0;
|
||||
int b = 0;
|
||||
boolean c = true;
|
||||
boolean d = true;
|
||||
int e = -1;
|
||||
Dialog f;
|
||||
boolean g;
|
||||
boolean h;
|
||||
boolean i;
|
||||
|
||||
public Dialog a(Bundle bundle) {
|
||||
throw null;
|
||||
}
|
||||
|
||||
public void a(FragmentManager fragmentManager, String str) {
|
||||
this.h = false;
|
||||
this.i = true;
|
||||
FragmentTransaction a = fragmentManager.a();
|
||||
a.a(this, str);
|
||||
a.a();
|
||||
}
|
||||
|
||||
public Dialog b() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onActivityCreated(Bundle bundle) {
|
||||
Bundle bundle2;
|
||||
super.onActivityCreated(bundle);
|
||||
if (this.d) {
|
||||
View view = getView();
|
||||
if (view != null) {
|
||||
if (view.getParent() != null) {
|
||||
throw new IllegalStateException("DialogFragment can not be attached to a container view");
|
||||
}
|
||||
this.f.setContentView(view);
|
||||
}
|
||||
FragmentActivity activity = getActivity();
|
||||
if (activity != null) {
|
||||
this.f.setOwnerActivity(activity);
|
||||
}
|
||||
this.f.setCancelable(this.c);
|
||||
this.f.setOnCancelListener(this);
|
||||
this.f.setOnDismissListener(this);
|
||||
if (bundle == null || (bundle2 = bundle.getBundle("android:savedDialogState")) == null) {
|
||||
return;
|
||||
}
|
||||
this.f.onRestoreInstanceState(bundle2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
if (this.i) {
|
||||
return;
|
||||
}
|
||||
this.h = false;
|
||||
}
|
||||
|
||||
@Override // android.content.DialogInterface.OnCancelListener
|
||||
public void onCancel(DialogInterface dialogInterface) {
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
this.d = this.mContainerId == 0;
|
||||
if (bundle != null) {
|
||||
this.a = bundle.getInt("android:style", 0);
|
||||
this.b = bundle.getInt("android:theme", 0);
|
||||
this.c = bundle.getBoolean("android:cancelable", true);
|
||||
this.d = bundle.getBoolean("android:showsDialog", this.d);
|
||||
this.e = bundle.getInt("android:backStackId", -1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
Dialog dialog = this.f;
|
||||
if (dialog != null) {
|
||||
this.g = true;
|
||||
dialog.dismiss();
|
||||
this.f = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
if (this.i || this.h) {
|
||||
return;
|
||||
}
|
||||
this.h = true;
|
||||
}
|
||||
|
||||
@Override // android.content.DialogInterface.OnDismissListener
|
||||
public void onDismiss(DialogInterface dialogInterface) {
|
||||
if (this.g) {
|
||||
return;
|
||||
}
|
||||
a(true);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public LayoutInflater onGetLayoutInflater(Bundle bundle) {
|
||||
if (!this.d) {
|
||||
return super.onGetLayoutInflater(bundle);
|
||||
}
|
||||
this.f = a(bundle);
|
||||
Dialog dialog = this.f;
|
||||
if (dialog == null) {
|
||||
return (LayoutInflater) this.mHost.c().getSystemService("layout_inflater");
|
||||
}
|
||||
a(dialog, this.a);
|
||||
return (LayoutInflater) this.f.getContext().getSystemService("layout_inflater");
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onSaveInstanceState(Bundle bundle) {
|
||||
Bundle onSaveInstanceState;
|
||||
super.onSaveInstanceState(bundle);
|
||||
Dialog dialog = this.f;
|
||||
if (dialog != null && (onSaveInstanceState = dialog.onSaveInstanceState()) != null) {
|
||||
bundle.putBundle("android:savedDialogState", onSaveInstanceState);
|
||||
}
|
||||
int i = this.a;
|
||||
if (i != 0) {
|
||||
bundle.putInt("android:style", i);
|
||||
}
|
||||
int i2 = this.b;
|
||||
if (i2 != 0) {
|
||||
bundle.putInt("android:theme", i2);
|
||||
}
|
||||
boolean z = this.c;
|
||||
if (!z) {
|
||||
bundle.putBoolean("android:cancelable", z);
|
||||
}
|
||||
boolean z2 = this.d;
|
||||
if (!z2) {
|
||||
bundle.putBoolean("android:showsDialog", z2);
|
||||
}
|
||||
int i3 = this.e;
|
||||
if (i3 != -1) {
|
||||
bundle.putInt("android:backStackId", i3);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
Dialog dialog = this.f;
|
||||
if (dialog != null) {
|
||||
this.g = false;
|
||||
dialog.show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
Dialog dialog = this.f;
|
||||
if (dialog != null) {
|
||||
dialog.hide();
|
||||
}
|
||||
}
|
||||
|
||||
public void b(boolean z) {
|
||||
this.d = z;
|
||||
}
|
||||
|
||||
void a(boolean z) {
|
||||
if (this.h) {
|
||||
return;
|
||||
}
|
||||
this.h = true;
|
||||
this.i = false;
|
||||
Dialog dialog = this.f;
|
||||
if (dialog != null) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
this.g = true;
|
||||
if (this.e >= 0) {
|
||||
getFragmentManager().a(this.e, 1);
|
||||
this.e = -1;
|
||||
return;
|
||||
}
|
||||
FragmentTransaction a = getFragmentManager().a();
|
||||
a.d(this);
|
||||
if (z) {
|
||||
a.b();
|
||||
} else {
|
||||
a.a();
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Dialog dialog, int i) {
|
||||
if (i != 1 && i != 2) {
|
||||
if (i != 3) {
|
||||
return;
|
||||
} else {
|
||||
dialog.getWindow().addFlags(24);
|
||||
}
|
||||
}
|
||||
dialog.requestWindowFeature(1);
|
||||
}
|
||||
}
|
1586
sources/androidx/fragment/app/Fragment.java
Normal file
1586
sources/androidx/fragment/app/Fragment.java
Normal file
File diff suppressed because it is too large
Load Diff
644
sources/androidx/fragment/app/FragmentActivity.java
Normal file
644
sources/androidx/fragment/app/FragmentActivity.java
Normal file
@@ -0,0 +1,644 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.os.Parcelable;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import androidx.collection.SparseArrayCompat;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.app.ComponentActivity;
|
||||
import androidx.core.app.SharedElementCallback;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.ViewModelStore;
|
||||
import androidx.lifecycle.ViewModelStoreOwner;
|
||||
import androidx.loader.app.LoaderManager;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class FragmentActivity extends ComponentActivity implements ViewModelStoreOwner, ActivityCompat.OnRequestPermissionsResultCallback, ActivityCompat.RequestPermissionsRequestCodeValidator {
|
||||
static final String ALLOCATED_REQUEST_INDICIES_TAG = "android:support:request_indicies";
|
||||
static final String FRAGMENTS_TAG = "android:support:fragments";
|
||||
static final int MAX_NUM_PENDING_FRAGMENT_ACTIVITY_RESULTS = 65534;
|
||||
static final int MSG_RESUME_PENDING = 2;
|
||||
static final String NEXT_CANDIDATE_REQUEST_INDEX_TAG = "android:support:next_request_index";
|
||||
static final String REQUEST_FRAGMENT_WHO_TAG = "android:support:request_fragment_who";
|
||||
private static final String TAG = "FragmentActivity";
|
||||
boolean mCreated;
|
||||
int mNextCandidateRequestIndex;
|
||||
SparseArrayCompat<String> mPendingFragmentActivityResults;
|
||||
boolean mRequestedPermissionsFromFragment;
|
||||
boolean mResumed;
|
||||
boolean mStartedActivityFromFragment;
|
||||
boolean mStartedIntentSenderFromFragment;
|
||||
private ViewModelStore mViewModelStore;
|
||||
final Handler mHandler = new Handler() { // from class: androidx.fragment.app.FragmentActivity.1
|
||||
@Override // android.os.Handler
|
||||
public void handleMessage(Message message) {
|
||||
if (message.what != 2) {
|
||||
super.handleMessage(message);
|
||||
} else {
|
||||
FragmentActivity.this.onResumeFragments();
|
||||
FragmentActivity.this.mFragments.i();
|
||||
}
|
||||
}
|
||||
};
|
||||
final FragmentController mFragments = FragmentController.a(new HostCallbacks());
|
||||
boolean mStopped = true;
|
||||
|
||||
class HostCallbacks extends FragmentHostCallback<FragmentActivity> {
|
||||
public HostCallbacks() {
|
||||
super(FragmentActivity.this);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentHostCallback
|
||||
public void a(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
|
||||
FragmentActivity.this.dump(str, fileDescriptor, printWriter, strArr);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentHostCallback
|
||||
public boolean b(Fragment fragment) {
|
||||
return !FragmentActivity.this.isFinishing();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentHostCallback
|
||||
public LayoutInflater g() {
|
||||
return FragmentActivity.this.getLayoutInflater().cloneInContext(FragmentActivity.this);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentHostCallback
|
||||
public int h() {
|
||||
Window window = FragmentActivity.this.getWindow();
|
||||
if (window == null) {
|
||||
return 0;
|
||||
}
|
||||
return window.getAttributes().windowAnimations;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentHostCallback
|
||||
public boolean i() {
|
||||
return FragmentActivity.this.getWindow() != null;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentHostCallback
|
||||
public void j() {
|
||||
FragmentActivity.this.supportInvalidateOptionsMenu();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentHostCallback
|
||||
public void a(Fragment fragment, Intent intent, int i, Bundle bundle) {
|
||||
FragmentActivity.this.startActivityFromFragment(fragment, intent, i, bundle);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.fragment.app.FragmentHostCallback
|
||||
public FragmentActivity f() {
|
||||
return FragmentActivity.this;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentHostCallback
|
||||
public void a(Fragment fragment, IntentSender intentSender, int i, Intent intent, int i2, int i3, int i4, Bundle bundle) throws IntentSender.SendIntentException {
|
||||
FragmentActivity.this.startIntentSenderFromFragment(fragment, intentSender, i, intent, i2, i3, i4, bundle);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentHostCallback
|
||||
public void a(Fragment fragment, String[] strArr, int i) {
|
||||
FragmentActivity.this.requestPermissionsFromFragment(fragment, strArr, i);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentHostCallback
|
||||
public boolean a(String str) {
|
||||
return ActivityCompat.a((Activity) FragmentActivity.this, str);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentHostCallback
|
||||
public void a(Fragment fragment) {
|
||||
FragmentActivity.this.onAttachFragment(fragment);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentContainer
|
||||
public View a(int i) {
|
||||
return FragmentActivity.this.findViewById(i);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentContainer
|
||||
public boolean a() {
|
||||
Window window = FragmentActivity.this.getWindow();
|
||||
return (window == null || window.peekDecorView() == null) ? false : true;
|
||||
}
|
||||
}
|
||||
|
||||
static final class NonConfigurationInstances {
|
||||
Object a;
|
||||
ViewModelStore b;
|
||||
FragmentManagerNonConfig c;
|
||||
|
||||
NonConfigurationInstances() {
|
||||
}
|
||||
}
|
||||
|
||||
private int allocateRequestIndex(Fragment fragment) {
|
||||
if (this.mPendingFragmentActivityResults.b() >= MAX_NUM_PENDING_FRAGMENT_ACTIVITY_RESULTS) {
|
||||
throw new IllegalStateException("Too many pending Fragment activity results.");
|
||||
}
|
||||
while (this.mPendingFragmentActivityResults.c(this.mNextCandidateRequestIndex) >= 0) {
|
||||
this.mNextCandidateRequestIndex = (this.mNextCandidateRequestIndex + 1) % MAX_NUM_PENDING_FRAGMENT_ACTIVITY_RESULTS;
|
||||
}
|
||||
int i = this.mNextCandidateRequestIndex;
|
||||
this.mPendingFragmentActivityResults.c(i, fragment.mWho);
|
||||
this.mNextCandidateRequestIndex = (this.mNextCandidateRequestIndex + 1) % MAX_NUM_PENDING_FRAGMENT_ACTIVITY_RESULTS;
|
||||
return i;
|
||||
}
|
||||
|
||||
static void checkForValidRequestCode(int i) {
|
||||
if ((i & (-65536)) != 0) {
|
||||
throw new IllegalArgumentException("Can only use lower 16 bits for requestCode");
|
||||
}
|
||||
}
|
||||
|
||||
private void markFragmentsCreated() {
|
||||
while (markState(getSupportFragmentManager(), Lifecycle.State.CREATED)) {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean markState(FragmentManager fragmentManager, Lifecycle.State state) {
|
||||
boolean z = false;
|
||||
for (Fragment fragment : fragmentManager.b()) {
|
||||
if (fragment != null) {
|
||||
if (fragment.getLifecycle().a().isAtLeast(Lifecycle.State.STARTED)) {
|
||||
fragment.mLifecycleRegistry.a(state);
|
||||
z = true;
|
||||
}
|
||||
FragmentManager peekChildFragmentManager = fragment.peekChildFragmentManager();
|
||||
if (peekChildFragmentManager != null) {
|
||||
z |= markState(peekChildFragmentManager, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
return z;
|
||||
}
|
||||
|
||||
final View dispatchFragmentsOnCreateView(View view, String str, Context context, AttributeSet attributeSet) {
|
||||
return this.mFragments.a(view, str, context, attributeSet);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void dump(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
|
||||
super.dump(str, fileDescriptor, printWriter, strArr);
|
||||
printWriter.print(str);
|
||||
printWriter.print("Local FragmentActivity ");
|
||||
printWriter.print(Integer.toHexString(System.identityHashCode(this)));
|
||||
printWriter.println(" State:");
|
||||
String str2 = str + " ";
|
||||
printWriter.print(str2);
|
||||
printWriter.print("mCreated=");
|
||||
printWriter.print(this.mCreated);
|
||||
printWriter.print(" mResumed=");
|
||||
printWriter.print(this.mResumed);
|
||||
printWriter.print(" mStopped=");
|
||||
printWriter.print(this.mStopped);
|
||||
if (getApplication() != null) {
|
||||
LoaderManager.a(this).a(str2, fileDescriptor, printWriter, strArr);
|
||||
}
|
||||
this.mFragments.j().a(str, fileDescriptor, printWriter, strArr);
|
||||
}
|
||||
|
||||
public Object getLastCustomNonConfigurationInstance() {
|
||||
NonConfigurationInstances nonConfigurationInstances = (NonConfigurationInstances) getLastNonConfigurationInstance();
|
||||
if (nonConfigurationInstances != null) {
|
||||
return nonConfigurationInstances.a;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ComponentActivity, androidx.lifecycle.LifecycleOwner
|
||||
public Lifecycle getLifecycle() {
|
||||
return super.getLifecycle();
|
||||
}
|
||||
|
||||
public FragmentManager getSupportFragmentManager() {
|
||||
return this.mFragments.j();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public LoaderManager getSupportLoaderManager() {
|
||||
return LoaderManager.a(this);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ViewModelStoreOwner
|
||||
public ViewModelStore getViewModelStore() {
|
||||
if (getApplication() == null) {
|
||||
throw new IllegalStateException("Your activity is not yet attached to the Application instance. You can't request ViewModel before onCreate call.");
|
||||
}
|
||||
if (this.mViewModelStore == null) {
|
||||
NonConfigurationInstances nonConfigurationInstances = (NonConfigurationInstances) getLastNonConfigurationInstance();
|
||||
if (nonConfigurationInstances != null) {
|
||||
this.mViewModelStore = nonConfigurationInstances.b;
|
||||
}
|
||||
if (this.mViewModelStore == null) {
|
||||
this.mViewModelStore = new ViewModelStore();
|
||||
}
|
||||
}
|
||||
return this.mViewModelStore;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onActivityResult(int i, int i2, Intent intent) {
|
||||
this.mFragments.k();
|
||||
int i3 = i >> 16;
|
||||
if (i3 == 0) {
|
||||
ActivityCompat.PermissionCompatDelegate a = ActivityCompat.a();
|
||||
if (a == null || !a.a(this, i, i2, intent)) {
|
||||
super.onActivityResult(i, i2, intent);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
int i4 = i3 - 1;
|
||||
String b = this.mPendingFragmentActivityResults.b(i4);
|
||||
this.mPendingFragmentActivityResults.e(i4);
|
||||
if (b == null) {
|
||||
Log.w(TAG, "Activity result delivered for unknown Fragment.");
|
||||
return;
|
||||
}
|
||||
Fragment a2 = this.mFragments.a(b);
|
||||
if (a2 != null) {
|
||||
a2.onActivityResult(i & 65535, i2, intent);
|
||||
return;
|
||||
}
|
||||
Log.w(TAG, "Activity result no fragment exists for who: " + b);
|
||||
}
|
||||
|
||||
public void onAttachFragment(Fragment fragment) {
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void onBackPressed() {
|
||||
FragmentManager j = this.mFragments.j();
|
||||
boolean c = j.c();
|
||||
if (!c || Build.VERSION.SDK_INT > 25) {
|
||||
if (c || !j.e()) {
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.content.ComponentCallbacks
|
||||
public void onConfigurationChanged(Configuration configuration) {
|
||||
super.onConfigurationChanged(configuration);
|
||||
this.mFragments.k();
|
||||
this.mFragments.a(configuration);
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
ViewModelStore viewModelStore;
|
||||
this.mFragments.a((Fragment) null);
|
||||
super.onCreate(bundle);
|
||||
NonConfigurationInstances nonConfigurationInstances = (NonConfigurationInstances) getLastNonConfigurationInstance();
|
||||
if (nonConfigurationInstances != null && (viewModelStore = nonConfigurationInstances.b) != null && this.mViewModelStore == null) {
|
||||
this.mViewModelStore = viewModelStore;
|
||||
}
|
||||
if (bundle != null) {
|
||||
this.mFragments.a(bundle.getParcelable(FRAGMENTS_TAG), nonConfigurationInstances != null ? nonConfigurationInstances.c : null);
|
||||
if (bundle.containsKey(NEXT_CANDIDATE_REQUEST_INDEX_TAG)) {
|
||||
this.mNextCandidateRequestIndex = bundle.getInt(NEXT_CANDIDATE_REQUEST_INDEX_TAG);
|
||||
int[] intArray = bundle.getIntArray(ALLOCATED_REQUEST_INDICIES_TAG);
|
||||
String[] stringArray = bundle.getStringArray(REQUEST_FRAGMENT_WHO_TAG);
|
||||
if (intArray == null || stringArray == null || intArray.length != stringArray.length) {
|
||||
Log.w(TAG, "Invalid requestCode mapping in savedInstanceState.");
|
||||
} else {
|
||||
this.mPendingFragmentActivityResults = new SparseArrayCompat<>(intArray.length);
|
||||
for (int i = 0; i < intArray.length; i++) {
|
||||
this.mPendingFragmentActivityResults.c(intArray[i], stringArray[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.mPendingFragmentActivityResults == null) {
|
||||
this.mPendingFragmentActivityResults = new SparseArrayCompat<>();
|
||||
this.mNextCandidateRequestIndex = 0;
|
||||
}
|
||||
this.mFragments.b();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.Window.Callback
|
||||
public boolean onCreatePanelMenu(int i, Menu menu) {
|
||||
return i == 0 ? super.onCreatePanelMenu(i, menu) | this.mFragments.a(menu, getMenuInflater()) : super.onCreatePanelMenu(i, menu);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.LayoutInflater.Factory2
|
||||
public View onCreateView(View view, String str, Context context, AttributeSet attributeSet) {
|
||||
View dispatchFragmentsOnCreateView = dispatchFragmentsOnCreateView(view, str, context, attributeSet);
|
||||
return dispatchFragmentsOnCreateView == null ? super.onCreateView(view, str, context, attributeSet) : dispatchFragmentsOnCreateView;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (this.mViewModelStore != null && !isChangingConfigurations()) {
|
||||
this.mViewModelStore.a();
|
||||
}
|
||||
this.mFragments.c();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.content.ComponentCallbacks
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
this.mFragments.d();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.Window.Callback
|
||||
public boolean onMenuItemSelected(int i, MenuItem menuItem) {
|
||||
if (super.onMenuItemSelected(i, menuItem)) {
|
||||
return true;
|
||||
}
|
||||
if (i == 0) {
|
||||
return this.mFragments.b(menuItem);
|
||||
}
|
||||
if (i != 6) {
|
||||
return false;
|
||||
}
|
||||
return this.mFragments.a(menuItem);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void onMultiWindowModeChanged(boolean z) {
|
||||
this.mFragments.a(z);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
this.mFragments.k();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.Window.Callback
|
||||
public void onPanelClosed(int i, Menu menu) {
|
||||
if (i == 0) {
|
||||
this.mFragments.a(menu);
|
||||
}
|
||||
super.onPanelClosed(i, menu);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
this.mResumed = false;
|
||||
if (this.mHandler.hasMessages(2)) {
|
||||
this.mHandler.removeMessages(2);
|
||||
onResumeFragments();
|
||||
}
|
||||
this.mFragments.e();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void onPictureInPictureModeChanged(boolean z) {
|
||||
this.mFragments.b(z);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onPostResume() {
|
||||
super.onPostResume();
|
||||
this.mHandler.removeMessages(2);
|
||||
onResumeFragments();
|
||||
this.mFragments.i();
|
||||
}
|
||||
|
||||
protected boolean onPrepareOptionsPanel(View view, Menu menu) {
|
||||
return super.onPreparePanel(0, view, menu);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.Window.Callback
|
||||
public boolean onPreparePanel(int i, View view, Menu menu) {
|
||||
return (i != 0 || menu == null) ? super.onPreparePanel(i, view, menu) : onPrepareOptionsPanel(view, menu) | this.mFragments.b(menu);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback
|
||||
public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
|
||||
this.mFragments.k();
|
||||
int i2 = (i >> 16) & 65535;
|
||||
if (i2 != 0) {
|
||||
int i3 = i2 - 1;
|
||||
String b = this.mPendingFragmentActivityResults.b(i3);
|
||||
this.mPendingFragmentActivityResults.e(i3);
|
||||
if (b == null) {
|
||||
Log.w(TAG, "Activity result delivered for unknown Fragment.");
|
||||
return;
|
||||
}
|
||||
Fragment a = this.mFragments.a(b);
|
||||
if (a != null) {
|
||||
a.onRequestPermissionsResult(i & 65535, strArr, iArr);
|
||||
return;
|
||||
}
|
||||
Log.w(TAG, "Activity result no fragment exists for who: " + b);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
this.mHandler.sendEmptyMessage(2);
|
||||
this.mResumed = true;
|
||||
this.mFragments.i();
|
||||
}
|
||||
|
||||
protected void onResumeFragments() {
|
||||
this.mFragments.f();
|
||||
}
|
||||
|
||||
public Object onRetainCustomNonConfigurationInstance() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public final Object onRetainNonConfigurationInstance() {
|
||||
Object onRetainCustomNonConfigurationInstance = onRetainCustomNonConfigurationInstance();
|
||||
FragmentManagerNonConfig l = this.mFragments.l();
|
||||
if (l == null && this.mViewModelStore == null && onRetainCustomNonConfigurationInstance == null) {
|
||||
return null;
|
||||
}
|
||||
NonConfigurationInstances nonConfigurationInstances = new NonConfigurationInstances();
|
||||
nonConfigurationInstances.a = onRetainCustomNonConfigurationInstance;
|
||||
nonConfigurationInstances.b = this.mViewModelStore;
|
||||
nonConfigurationInstances.c = l;
|
||||
return nonConfigurationInstances;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onSaveInstanceState(Bundle bundle) {
|
||||
super.onSaveInstanceState(bundle);
|
||||
markFragmentsCreated();
|
||||
Parcelable m = this.mFragments.m();
|
||||
if (m != null) {
|
||||
bundle.putParcelable(FRAGMENTS_TAG, m);
|
||||
}
|
||||
if (this.mPendingFragmentActivityResults.b() > 0) {
|
||||
bundle.putInt(NEXT_CANDIDATE_REQUEST_INDEX_TAG, this.mNextCandidateRequestIndex);
|
||||
int[] iArr = new int[this.mPendingFragmentActivityResults.b()];
|
||||
String[] strArr = new String[this.mPendingFragmentActivityResults.b()];
|
||||
for (int i = 0; i < this.mPendingFragmentActivityResults.b(); i++) {
|
||||
iArr[i] = this.mPendingFragmentActivityResults.d(i);
|
||||
strArr[i] = this.mPendingFragmentActivityResults.f(i);
|
||||
}
|
||||
bundle.putIntArray(ALLOCATED_REQUEST_INDICIES_TAG, iArr);
|
||||
bundle.putStringArray(REQUEST_FRAGMENT_WHO_TAG, strArr);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
this.mStopped = false;
|
||||
if (!this.mCreated) {
|
||||
this.mCreated = true;
|
||||
this.mFragments.a();
|
||||
}
|
||||
this.mFragments.k();
|
||||
this.mFragments.i();
|
||||
this.mFragments.g();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void onStateNotSaved() {
|
||||
this.mFragments.k();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
this.mStopped = true;
|
||||
markFragmentsCreated();
|
||||
this.mFragments.h();
|
||||
}
|
||||
|
||||
void requestPermissionsFromFragment(Fragment fragment, String[] strArr, int i) {
|
||||
if (i == -1) {
|
||||
ActivityCompat.a(this, strArr, i);
|
||||
return;
|
||||
}
|
||||
checkForValidRequestCode(i);
|
||||
try {
|
||||
this.mRequestedPermissionsFromFragment = true;
|
||||
ActivityCompat.a(this, strArr, ((allocateRequestIndex(fragment) + 1) << 16) + (i & 65535));
|
||||
} finally {
|
||||
this.mRequestedPermissionsFromFragment = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void setEnterSharedElementCallback(SharedElementCallback sharedElementCallback) {
|
||||
ActivityCompat.a(this, sharedElementCallback);
|
||||
}
|
||||
|
||||
public void setExitSharedElementCallback(SharedElementCallback sharedElementCallback) {
|
||||
ActivityCompat.b(this, sharedElementCallback);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void startActivityForResult(Intent intent, int i) {
|
||||
if (!this.mStartedActivityFromFragment && i != -1) {
|
||||
checkForValidRequestCode(i);
|
||||
}
|
||||
super.startActivityForResult(intent, i);
|
||||
}
|
||||
|
||||
public void startActivityFromFragment(Fragment fragment, Intent intent, int i) {
|
||||
startActivityFromFragment(fragment, intent, i, (Bundle) null);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void startIntentSenderForResult(IntentSender intentSender, int i, Intent intent, int i2, int i3, int i4) throws IntentSender.SendIntentException {
|
||||
if (!this.mStartedIntentSenderFromFragment && i != -1) {
|
||||
checkForValidRequestCode(i);
|
||||
}
|
||||
super.startIntentSenderForResult(intentSender, i, intent, i2, i3, i4);
|
||||
}
|
||||
|
||||
public void startIntentSenderFromFragment(Fragment fragment, IntentSender intentSender, int i, Intent intent, int i2, int i3, int i4, Bundle bundle) throws IntentSender.SendIntentException {
|
||||
this.mStartedIntentSenderFromFragment = true;
|
||||
try {
|
||||
if (i == -1) {
|
||||
ActivityCompat.a(this, intentSender, i, intent, i2, i3, i4, bundle);
|
||||
} else {
|
||||
checkForValidRequestCode(i);
|
||||
ActivityCompat.a(this, intentSender, ((allocateRequestIndex(fragment) + 1) << 16) + (i & 65535), intent, i2, i3, i4, bundle);
|
||||
}
|
||||
} finally {
|
||||
this.mStartedIntentSenderFromFragment = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void supportFinishAfterTransition() {
|
||||
ActivityCompat.b((Activity) this);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void supportInvalidateOptionsMenu() {
|
||||
invalidateOptionsMenu();
|
||||
}
|
||||
|
||||
public void supportPostponeEnterTransition() {
|
||||
ActivityCompat.c((Activity) this);
|
||||
}
|
||||
|
||||
public void supportStartPostponedEnterTransition() {
|
||||
ActivityCompat.d(this);
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ActivityCompat.RequestPermissionsRequestCodeValidator
|
||||
public final void validateRequestPermissionsRequestCode(int i) {
|
||||
if (this.mRequestedPermissionsFromFragment || i == -1) {
|
||||
return;
|
||||
}
|
||||
checkForValidRequestCode(i);
|
||||
}
|
||||
|
||||
public void startActivityFromFragment(Fragment fragment, Intent intent, int i, Bundle bundle) {
|
||||
this.mStartedActivityFromFragment = true;
|
||||
try {
|
||||
if (i == -1) {
|
||||
ActivityCompat.a(this, intent, -1, bundle);
|
||||
} else {
|
||||
checkForValidRequestCode(i);
|
||||
ActivityCompat.a(this, intent, ((allocateRequestIndex(fragment) + 1) << 16) + (i & 65535), bundle);
|
||||
}
|
||||
} finally {
|
||||
this.mStartedActivityFromFragment = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.LayoutInflater.Factory
|
||||
public View onCreateView(String str, Context context, AttributeSet attributeSet) {
|
||||
View dispatchFragmentsOnCreateView = dispatchFragmentsOnCreateView(null, str, context, attributeSet);
|
||||
return dispatchFragmentsOnCreateView == null ? super.onCreateView(str, context, attributeSet) : dispatchFragmentsOnCreateView;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void startActivityForResult(Intent intent, int i, Bundle bundle) {
|
||||
if (!this.mStartedActivityFromFragment && i != -1) {
|
||||
checkForValidRequestCode(i);
|
||||
}
|
||||
super.startActivityForResult(intent, i, bundle);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void startIntentSenderForResult(IntentSender intentSender, int i, Intent intent, int i2, int i3, int i4, Bundle bundle) throws IntentSender.SendIntentException {
|
||||
if (!this.mStartedIntentSenderFromFragment && i != -1) {
|
||||
checkForValidRequestCode(i);
|
||||
}
|
||||
super.startIntentSenderForResult(intentSender, i, intent, i2, i3, i4, bundle);
|
||||
}
|
||||
}
|
16
sources/androidx/fragment/app/FragmentContainer.java
Normal file
16
sources/androidx/fragment/app/FragmentContainer.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class FragmentContainer {
|
||||
public abstract View a(int i);
|
||||
|
||||
public Fragment a(Context context, String str, Bundle bundle) {
|
||||
return Fragment.instantiate(context, str, bundle);
|
||||
}
|
||||
|
||||
public abstract boolean a();
|
||||
}
|
124
sources/androidx/fragment/app/FragmentController.java
Normal file
124
sources/androidx/fragment/app/FragmentController.java
Normal file
@@ -0,0 +1,124 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Parcelable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class FragmentController {
|
||||
private final FragmentHostCallback<?> a;
|
||||
|
||||
private FragmentController(FragmentHostCallback<?> fragmentHostCallback) {
|
||||
this.a = fragmentHostCallback;
|
||||
}
|
||||
|
||||
public static FragmentController a(FragmentHostCallback<?> fragmentHostCallback) {
|
||||
return new FragmentController(fragmentHostCallback);
|
||||
}
|
||||
|
||||
public void b() {
|
||||
this.a.d.g();
|
||||
}
|
||||
|
||||
public void c() {
|
||||
this.a.d.h();
|
||||
}
|
||||
|
||||
public void d() {
|
||||
this.a.d.j();
|
||||
}
|
||||
|
||||
public void e() {
|
||||
this.a.d.k();
|
||||
}
|
||||
|
||||
public void f() {
|
||||
this.a.d.l();
|
||||
}
|
||||
|
||||
public void g() {
|
||||
this.a.d.m();
|
||||
}
|
||||
|
||||
public void h() {
|
||||
this.a.d.n();
|
||||
}
|
||||
|
||||
public boolean i() {
|
||||
return this.a.d.p();
|
||||
}
|
||||
|
||||
public FragmentManager j() {
|
||||
return this.a.d();
|
||||
}
|
||||
|
||||
public void k() {
|
||||
this.a.d.s();
|
||||
}
|
||||
|
||||
public FragmentManagerNonConfig l() {
|
||||
return this.a.d.u();
|
||||
}
|
||||
|
||||
public Parcelable m() {
|
||||
return this.a.d.v();
|
||||
}
|
||||
|
||||
public Fragment a(String str) {
|
||||
return this.a.d.b(str);
|
||||
}
|
||||
|
||||
public void b(boolean z) {
|
||||
this.a.d.b(z);
|
||||
}
|
||||
|
||||
public void a(Fragment fragment) {
|
||||
FragmentHostCallback<?> fragmentHostCallback = this.a;
|
||||
fragmentHostCallback.d.a(fragmentHostCallback, fragmentHostCallback, fragment);
|
||||
}
|
||||
|
||||
public boolean b(Menu menu) {
|
||||
return this.a.d.b(menu);
|
||||
}
|
||||
|
||||
public View a(View view, String str, Context context, AttributeSet attributeSet) {
|
||||
return this.a.d.onCreateView(view, str, context, attributeSet);
|
||||
}
|
||||
|
||||
public boolean b(MenuItem menuItem) {
|
||||
return this.a.d.b(menuItem);
|
||||
}
|
||||
|
||||
public void a(Parcelable parcelable, FragmentManagerNonConfig fragmentManagerNonConfig) {
|
||||
this.a.d.a(parcelable, fragmentManagerNonConfig);
|
||||
}
|
||||
|
||||
public void a() {
|
||||
this.a.d.f();
|
||||
}
|
||||
|
||||
public void a(boolean z) {
|
||||
this.a.d.a(z);
|
||||
}
|
||||
|
||||
public void a(Configuration configuration) {
|
||||
this.a.d.a(configuration);
|
||||
}
|
||||
|
||||
public boolean a(Menu menu, MenuInflater menuInflater) {
|
||||
return this.a.d.a(menu, menuInflater);
|
||||
}
|
||||
|
||||
public boolean a(MenuItem menuItem) {
|
||||
return this.a.d.a(menuItem);
|
||||
}
|
||||
|
||||
public void a(Menu menu) {
|
||||
this.a.d.a(menu);
|
||||
}
|
||||
}
|
73
sources/androidx/fragment/app/FragmentHostCallback.java
Normal file
73
sources/androidx/fragment/app/FragmentHostCallback.java
Normal file
@@ -0,0 +1,73 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.LayoutInflater;
|
||||
import androidx.core.util.Preconditions;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class FragmentHostCallback<E> extends FragmentContainer {
|
||||
private final Activity a;
|
||||
private final Context b;
|
||||
private final Handler c;
|
||||
final FragmentManagerImpl d;
|
||||
|
||||
FragmentHostCallback(FragmentActivity fragmentActivity) {
|
||||
this(fragmentActivity, fragmentActivity, fragmentActivity.mHandler, 0);
|
||||
}
|
||||
|
||||
abstract void a(Fragment fragment);
|
||||
|
||||
public abstract void a(Fragment fragment, Intent intent, int i, Bundle bundle);
|
||||
|
||||
public abstract void a(Fragment fragment, IntentSender intentSender, int i, Intent intent, int i2, int i3, int i4, Bundle bundle) throws IntentSender.SendIntentException;
|
||||
|
||||
public abstract void a(Fragment fragment, String[] strArr, int i);
|
||||
|
||||
public abstract void a(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr);
|
||||
|
||||
public abstract boolean a(String str);
|
||||
|
||||
Activity b() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public abstract boolean b(Fragment fragment);
|
||||
|
||||
Context c() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
FragmentManagerImpl d() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
Handler e() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public abstract E f();
|
||||
|
||||
public abstract LayoutInflater g();
|
||||
|
||||
public abstract int h();
|
||||
|
||||
public abstract boolean i();
|
||||
|
||||
public abstract void j();
|
||||
|
||||
FragmentHostCallback(Activity activity, Context context, Handler handler, int i) {
|
||||
this.d = new FragmentManagerImpl();
|
||||
this.a = activity;
|
||||
Preconditions.a(context, "context == null");
|
||||
this.b = context;
|
||||
Preconditions.a(handler, "handler == null");
|
||||
this.c = handler;
|
||||
}
|
||||
}
|
72
sources/androidx/fragment/app/FragmentManager.java
Normal file
72
sources/androidx/fragment/app/FragmentManager.java
Normal file
@@ -0,0 +1,72 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class FragmentManager {
|
||||
|
||||
public interface BackStackEntry {
|
||||
}
|
||||
|
||||
public static abstract class FragmentLifecycleCallbacks {
|
||||
public abstract void a(FragmentManager fragmentManager, Fragment fragment);
|
||||
|
||||
public abstract void a(FragmentManager fragmentManager, Fragment fragment, Context context);
|
||||
|
||||
public abstract void a(FragmentManager fragmentManager, Fragment fragment, Bundle bundle);
|
||||
|
||||
public abstract void a(FragmentManager fragmentManager, Fragment fragment, View view, Bundle bundle);
|
||||
|
||||
public abstract void b(FragmentManager fragmentManager, Fragment fragment);
|
||||
|
||||
public abstract void b(FragmentManager fragmentManager, Fragment fragment, Context context);
|
||||
|
||||
public abstract void b(FragmentManager fragmentManager, Fragment fragment, Bundle bundle);
|
||||
|
||||
public abstract void c(FragmentManager fragmentManager, Fragment fragment);
|
||||
|
||||
public abstract void c(FragmentManager fragmentManager, Fragment fragment, Bundle bundle);
|
||||
|
||||
public abstract void d(FragmentManager fragmentManager, Fragment fragment);
|
||||
|
||||
public abstract void d(FragmentManager fragmentManager, Fragment fragment, Bundle bundle);
|
||||
|
||||
public abstract void e(FragmentManager fragmentManager, Fragment fragment);
|
||||
|
||||
public abstract void f(FragmentManager fragmentManager, Fragment fragment);
|
||||
|
||||
public abstract void g(FragmentManager fragmentManager, Fragment fragment);
|
||||
}
|
||||
|
||||
public interface OnBackStackChangedListener {
|
||||
void a();
|
||||
}
|
||||
|
||||
public abstract Fragment.SavedState a(Fragment fragment);
|
||||
|
||||
public abstract Fragment a(Bundle bundle, String str);
|
||||
|
||||
public abstract Fragment a(String str);
|
||||
|
||||
public abstract FragmentTransaction a();
|
||||
|
||||
public abstract void a(int i, int i2);
|
||||
|
||||
public abstract void a(Bundle bundle, String str, Fragment fragment);
|
||||
|
||||
public abstract void a(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr);
|
||||
|
||||
public abstract List<Fragment> b();
|
||||
|
||||
public abstract boolean c();
|
||||
|
||||
public abstract void d();
|
||||
|
||||
public abstract boolean e();
|
||||
}
|
2735
sources/androidx/fragment/app/FragmentManagerImpl.java
Normal file
2735
sources/androidx/fragment/app/FragmentManagerImpl.java
Normal file
File diff suppressed because it is too large
Load Diff
29
sources/androidx/fragment/app/FragmentManagerNonConfig.java
Normal file
29
sources/androidx/fragment/app/FragmentManagerNonConfig.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import androidx.lifecycle.ViewModelStore;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class FragmentManagerNonConfig {
|
||||
private final List<Fragment> a;
|
||||
private final List<FragmentManagerNonConfig> b;
|
||||
private final List<ViewModelStore> c;
|
||||
|
||||
FragmentManagerNonConfig(List<Fragment> list, List<FragmentManagerNonConfig> list2, List<ViewModelStore> list3) {
|
||||
this.a = list;
|
||||
this.b = list2;
|
||||
this.c = list3;
|
||||
}
|
||||
|
||||
List<FragmentManagerNonConfig> a() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
List<Fragment> b() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
List<ViewModelStore> c() {
|
||||
return this.c;
|
||||
}
|
||||
}
|
54
sources/androidx/fragment/app/FragmentManagerState.java
Normal file
54
sources/androidx/fragment/app/FragmentManagerState.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/* compiled from: FragmentManager.java */
|
||||
/* loaded from: classes.dex */
|
||||
final class FragmentManagerState implements Parcelable {
|
||||
public static final Parcelable.Creator<FragmentManagerState> CREATOR = new Parcelable.Creator<FragmentManagerState>() { // from class: androidx.fragment.app.FragmentManagerState.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public FragmentManagerState createFromParcel(Parcel parcel) {
|
||||
return new FragmentManagerState(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public FragmentManagerState[] newArray(int i) {
|
||||
return new FragmentManagerState[i];
|
||||
}
|
||||
};
|
||||
FragmentState[] mActive;
|
||||
int[] mAdded;
|
||||
BackStackState[] mBackStack;
|
||||
int mNextFragmentIndex;
|
||||
int mPrimaryNavActiveIndex;
|
||||
|
||||
public FragmentManagerState() {
|
||||
this.mPrimaryNavActiveIndex = -1;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeTypedArray(this.mActive, i);
|
||||
parcel.writeIntArray(this.mAdded);
|
||||
parcel.writeTypedArray(this.mBackStack, i);
|
||||
parcel.writeInt(this.mPrimaryNavActiveIndex);
|
||||
parcel.writeInt(this.mNextFragmentIndex);
|
||||
}
|
||||
|
||||
public FragmentManagerState(Parcel parcel) {
|
||||
this.mPrimaryNavActiveIndex = -1;
|
||||
this.mActive = (FragmentState[]) parcel.createTypedArray(FragmentState.CREATOR);
|
||||
this.mAdded = parcel.createIntArray();
|
||||
this.mBackStack = (BackStackState[]) parcel.createTypedArray(BackStackState.CREATOR);
|
||||
this.mPrimaryNavActiveIndex = parcel.readInt();
|
||||
this.mNextFragmentIndex = parcel.readInt();
|
||||
}
|
||||
}
|
103
sources/androidx/fragment/app/FragmentPagerAdapter.java
Normal file
103
sources/androidx/fragment/app/FragmentPagerAdapter.java
Normal file
@@ -0,0 +1,103 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.os.Parcelable;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class FragmentPagerAdapter extends PagerAdapter {
|
||||
private static final boolean DEBUG = false;
|
||||
private static final String TAG = "FragmentPagerAdapter";
|
||||
private FragmentTransaction mCurTransaction = null;
|
||||
private Fragment mCurrentPrimaryItem = null;
|
||||
private final FragmentManager mFragmentManager;
|
||||
|
||||
public FragmentPagerAdapter(FragmentManager fragmentManager) {
|
||||
this.mFragmentManager = fragmentManager;
|
||||
}
|
||||
|
||||
private static String makeFragmentName(int i, long j) {
|
||||
return "android:switcher:" + i + ":" + j;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public void destroyItem(ViewGroup viewGroup, int i, Object obj) {
|
||||
if (this.mCurTransaction == null) {
|
||||
this.mCurTransaction = this.mFragmentManager.a();
|
||||
}
|
||||
this.mCurTransaction.b((Fragment) obj);
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public void finishUpdate(ViewGroup viewGroup) {
|
||||
FragmentTransaction fragmentTransaction = this.mCurTransaction;
|
||||
if (fragmentTransaction != null) {
|
||||
fragmentTransaction.c();
|
||||
this.mCurTransaction = null;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract Fragment getItem(int i);
|
||||
|
||||
public long getItemId(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public Object instantiateItem(ViewGroup viewGroup, int i) {
|
||||
if (this.mCurTransaction == null) {
|
||||
this.mCurTransaction = this.mFragmentManager.a();
|
||||
}
|
||||
long itemId = getItemId(i);
|
||||
Fragment a = this.mFragmentManager.a(makeFragmentName(viewGroup.getId(), itemId));
|
||||
if (a != null) {
|
||||
this.mCurTransaction.a(a);
|
||||
} else {
|
||||
a = getItem(i);
|
||||
this.mCurTransaction.a(viewGroup.getId(), a, makeFragmentName(viewGroup.getId(), itemId));
|
||||
}
|
||||
if (a != this.mCurrentPrimaryItem) {
|
||||
a.setMenuVisibility(false);
|
||||
a.setUserVisibleHint(false);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public boolean isViewFromObject(View view, Object obj) {
|
||||
return ((Fragment) obj).getView() == view;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public void restoreState(Parcelable parcelable, ClassLoader classLoader) {
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public Parcelable saveState() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public void setPrimaryItem(ViewGroup viewGroup, int i, Object obj) {
|
||||
Fragment fragment = (Fragment) obj;
|
||||
Fragment fragment2 = this.mCurrentPrimaryItem;
|
||||
if (fragment != fragment2) {
|
||||
if (fragment2 != null) {
|
||||
fragment2.setMenuVisibility(false);
|
||||
this.mCurrentPrimaryItem.setUserVisibleHint(false);
|
||||
}
|
||||
fragment.setMenuVisibility(true);
|
||||
fragment.setUserVisibleHint(true);
|
||||
this.mCurrentPrimaryItem = fragment;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public void startUpdate(ViewGroup viewGroup) {
|
||||
if (viewGroup.getId() != -1) {
|
||||
return;
|
||||
}
|
||||
throw new IllegalStateException("ViewPager with adapter " + this + " requires a view id");
|
||||
}
|
||||
}
|
122
sources/androidx/fragment/app/FragmentState.java
Normal file
122
sources/androidx/fragment/app/FragmentState.java
Normal file
@@ -0,0 +1,122 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
import androidx.lifecycle.ViewModelStore;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class FragmentState implements Parcelable {
|
||||
public static final Parcelable.Creator<FragmentState> CREATOR = new Parcelable.Creator<FragmentState>() { // from class: androidx.fragment.app.FragmentState.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public FragmentState createFromParcel(Parcel parcel) {
|
||||
return new FragmentState(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public FragmentState[] newArray(int i) {
|
||||
return new FragmentState[i];
|
||||
}
|
||||
};
|
||||
final Bundle mArguments;
|
||||
final String mClassName;
|
||||
final int mContainerId;
|
||||
final boolean mDetached;
|
||||
final int mFragmentId;
|
||||
final boolean mFromLayout;
|
||||
final boolean mHidden;
|
||||
final int mIndex;
|
||||
Fragment mInstance;
|
||||
final boolean mRetainInstance;
|
||||
Bundle mSavedFragmentState;
|
||||
final String mTag;
|
||||
|
||||
FragmentState(Fragment fragment) {
|
||||
this.mClassName = fragment.getClass().getName();
|
||||
this.mIndex = fragment.mIndex;
|
||||
this.mFromLayout = fragment.mFromLayout;
|
||||
this.mFragmentId = fragment.mFragmentId;
|
||||
this.mContainerId = fragment.mContainerId;
|
||||
this.mTag = fragment.mTag;
|
||||
this.mRetainInstance = fragment.mRetainInstance;
|
||||
this.mDetached = fragment.mDetached;
|
||||
this.mArguments = fragment.mArguments;
|
||||
this.mHidden = fragment.mHidden;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Fragment instantiate(FragmentHostCallback fragmentHostCallback, FragmentContainer fragmentContainer, Fragment fragment, FragmentManagerNonConfig fragmentManagerNonConfig, ViewModelStore viewModelStore) {
|
||||
if (this.mInstance == null) {
|
||||
Context c = fragmentHostCallback.c();
|
||||
Bundle bundle = this.mArguments;
|
||||
if (bundle != null) {
|
||||
bundle.setClassLoader(c.getClassLoader());
|
||||
}
|
||||
if (fragmentContainer != null) {
|
||||
this.mInstance = fragmentContainer.a(c, this.mClassName, this.mArguments);
|
||||
} else {
|
||||
this.mInstance = Fragment.instantiate(c, this.mClassName, this.mArguments);
|
||||
}
|
||||
Bundle bundle2 = this.mSavedFragmentState;
|
||||
if (bundle2 != null) {
|
||||
bundle2.setClassLoader(c.getClassLoader());
|
||||
this.mInstance.mSavedFragmentState = this.mSavedFragmentState;
|
||||
}
|
||||
this.mInstance.setIndex(this.mIndex, fragment);
|
||||
Fragment fragment2 = this.mInstance;
|
||||
fragment2.mFromLayout = this.mFromLayout;
|
||||
fragment2.mRestored = true;
|
||||
fragment2.mFragmentId = this.mFragmentId;
|
||||
fragment2.mContainerId = this.mContainerId;
|
||||
fragment2.mTag = this.mTag;
|
||||
fragment2.mRetainInstance = this.mRetainInstance;
|
||||
fragment2.mDetached = this.mDetached;
|
||||
fragment2.mHidden = this.mHidden;
|
||||
fragment2.mFragmentManager = fragmentHostCallback.d;
|
||||
if (FragmentManagerImpl.F) {
|
||||
Log.v("FragmentManager", "Instantiated fragment " + this.mInstance);
|
||||
}
|
||||
}
|
||||
Fragment fragment3 = this.mInstance;
|
||||
fragment3.mChildNonConfig = fragmentManagerNonConfig;
|
||||
fragment3.mViewModelStore = viewModelStore;
|
||||
return fragment3;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeString(this.mClassName);
|
||||
parcel.writeInt(this.mIndex);
|
||||
parcel.writeInt(this.mFromLayout ? 1 : 0);
|
||||
parcel.writeInt(this.mFragmentId);
|
||||
parcel.writeInt(this.mContainerId);
|
||||
parcel.writeString(this.mTag);
|
||||
parcel.writeInt(this.mRetainInstance ? 1 : 0);
|
||||
parcel.writeInt(this.mDetached ? 1 : 0);
|
||||
parcel.writeBundle(this.mArguments);
|
||||
parcel.writeInt(this.mHidden ? 1 : 0);
|
||||
parcel.writeBundle(this.mSavedFragmentState);
|
||||
}
|
||||
|
||||
FragmentState(Parcel parcel) {
|
||||
this.mClassName = parcel.readString();
|
||||
this.mIndex = parcel.readInt();
|
||||
this.mFromLayout = parcel.readInt() != 0;
|
||||
this.mFragmentId = parcel.readInt();
|
||||
this.mContainerId = parcel.readInt();
|
||||
this.mTag = parcel.readString();
|
||||
this.mRetainInstance = parcel.readInt() != 0;
|
||||
this.mDetached = parcel.readInt() != 0;
|
||||
this.mArguments = parcel.readBundle();
|
||||
this.mHidden = parcel.readInt() != 0;
|
||||
this.mSavedFragmentState = parcel.readBundle();
|
||||
}
|
||||
}
|
156
sources/androidx/fragment/app/FragmentStatePagerAdapter.java
Normal file
156
sources/androidx/fragment/app/FragmentStatePagerAdapter.java
Normal file
@@ -0,0 +1,156 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class FragmentStatePagerAdapter extends PagerAdapter {
|
||||
private static final boolean DEBUG = false;
|
||||
private static final String TAG = "FragmentStatePagerAdapt";
|
||||
private final FragmentManager mFragmentManager;
|
||||
private FragmentTransaction mCurTransaction = null;
|
||||
private ArrayList<Fragment.SavedState> mSavedState = new ArrayList<>();
|
||||
private ArrayList<Fragment> mFragments = new ArrayList<>();
|
||||
private Fragment mCurrentPrimaryItem = null;
|
||||
|
||||
public FragmentStatePagerAdapter(FragmentManager fragmentManager) {
|
||||
this.mFragmentManager = fragmentManager;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public void destroyItem(ViewGroup viewGroup, int i, Object obj) {
|
||||
Fragment fragment = (Fragment) obj;
|
||||
if (this.mCurTransaction == null) {
|
||||
this.mCurTransaction = this.mFragmentManager.a();
|
||||
}
|
||||
while (this.mSavedState.size() <= i) {
|
||||
this.mSavedState.add(null);
|
||||
}
|
||||
this.mSavedState.set(i, fragment.isAdded() ? this.mFragmentManager.a(fragment) : null);
|
||||
this.mFragments.set(i, null);
|
||||
this.mCurTransaction.d(fragment);
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public void finishUpdate(ViewGroup viewGroup) {
|
||||
FragmentTransaction fragmentTransaction = this.mCurTransaction;
|
||||
if (fragmentTransaction != null) {
|
||||
fragmentTransaction.c();
|
||||
this.mCurTransaction = null;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract Fragment getItem(int i);
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public Object instantiateItem(ViewGroup viewGroup, int i) {
|
||||
Fragment.SavedState savedState;
|
||||
Fragment fragment;
|
||||
if (this.mFragments.size() > i && (fragment = this.mFragments.get(i)) != null) {
|
||||
return fragment;
|
||||
}
|
||||
if (this.mCurTransaction == null) {
|
||||
this.mCurTransaction = this.mFragmentManager.a();
|
||||
}
|
||||
Fragment item = getItem(i);
|
||||
if (this.mSavedState.size() > i && (savedState = this.mSavedState.get(i)) != null) {
|
||||
item.setInitialSavedState(savedState);
|
||||
}
|
||||
while (this.mFragments.size() <= i) {
|
||||
this.mFragments.add(null);
|
||||
}
|
||||
item.setMenuVisibility(false);
|
||||
item.setUserVisibleHint(false);
|
||||
this.mFragments.set(i, item);
|
||||
this.mCurTransaction.a(viewGroup.getId(), item);
|
||||
return item;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public boolean isViewFromObject(View view, Object obj) {
|
||||
return ((Fragment) obj).getView() == view;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public void restoreState(Parcelable parcelable, ClassLoader classLoader) {
|
||||
if (parcelable != null) {
|
||||
Bundle bundle = (Bundle) parcelable;
|
||||
bundle.setClassLoader(classLoader);
|
||||
Parcelable[] parcelableArray = bundle.getParcelableArray("states");
|
||||
this.mSavedState.clear();
|
||||
this.mFragments.clear();
|
||||
if (parcelableArray != null) {
|
||||
for (Parcelable parcelable2 : parcelableArray) {
|
||||
this.mSavedState.add((Fragment.SavedState) parcelable2);
|
||||
}
|
||||
}
|
||||
for (String str : bundle.keySet()) {
|
||||
if (str.startsWith("f")) {
|
||||
int parseInt = Integer.parseInt(str.substring(1));
|
||||
Fragment a = this.mFragmentManager.a(bundle, str);
|
||||
if (a != null) {
|
||||
while (this.mFragments.size() <= parseInt) {
|
||||
this.mFragments.add(null);
|
||||
}
|
||||
a.setMenuVisibility(false);
|
||||
this.mFragments.set(parseInt, a);
|
||||
} else {
|
||||
Log.w(TAG, "Bad fragment at key " + str);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public Parcelable saveState() {
|
||||
Bundle bundle;
|
||||
if (this.mSavedState.size() > 0) {
|
||||
bundle = new Bundle();
|
||||
Fragment.SavedState[] savedStateArr = new Fragment.SavedState[this.mSavedState.size()];
|
||||
this.mSavedState.toArray(savedStateArr);
|
||||
bundle.putParcelableArray("states", savedStateArr);
|
||||
} else {
|
||||
bundle = null;
|
||||
}
|
||||
for (int i = 0; i < this.mFragments.size(); i++) {
|
||||
Fragment fragment = this.mFragments.get(i);
|
||||
if (fragment != null && fragment.isAdded()) {
|
||||
if (bundle == null) {
|
||||
bundle = new Bundle();
|
||||
}
|
||||
this.mFragmentManager.a(bundle, "f" + i, fragment);
|
||||
}
|
||||
}
|
||||
return bundle;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public void setPrimaryItem(ViewGroup viewGroup, int i, Object obj) {
|
||||
Fragment fragment = (Fragment) obj;
|
||||
Fragment fragment2 = this.mCurrentPrimaryItem;
|
||||
if (fragment != fragment2) {
|
||||
if (fragment2 != null) {
|
||||
fragment2.setMenuVisibility(false);
|
||||
this.mCurrentPrimaryItem.setUserVisibleHint(false);
|
||||
}
|
||||
fragment.setMenuVisibility(true);
|
||||
fragment.setUserVisibleHint(true);
|
||||
this.mCurrentPrimaryItem = fragment;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public void startUpdate(ViewGroup viewGroup) {
|
||||
if (viewGroup.getId() != -1) {
|
||||
return;
|
||||
}
|
||||
throw new IllegalStateException("ViewPager with adapter " + this + " requires a view id");
|
||||
}
|
||||
}
|
@@ -0,0 +1,42 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.view.View;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class FragmentTabHost$SavedState extends View.BaseSavedState {
|
||||
public static final Parcelable.Creator<FragmentTabHost$SavedState> CREATOR = new Parcelable.Creator<FragmentTabHost$SavedState>() { // from class: androidx.fragment.app.FragmentTabHost$SavedState.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public FragmentTabHost$SavedState createFromParcel(Parcel parcel) {
|
||||
return new FragmentTabHost$SavedState(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public FragmentTabHost$SavedState[] newArray(int i) {
|
||||
return new FragmentTabHost$SavedState[i];
|
||||
}
|
||||
};
|
||||
String curTab;
|
||||
|
||||
FragmentTabHost$SavedState(Parcelable parcelable) {
|
||||
super(parcelable);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "FragmentTabHost.SavedState{" + Integer.toHexString(System.identityHashCode(this)) + " curTab=" + this.curTab + "}";
|
||||
}
|
||||
|
||||
@Override // android.view.View.BaseSavedState, android.view.AbsSavedState, android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
super.writeToParcel(parcel, i);
|
||||
parcel.writeString(this.curTab);
|
||||
}
|
||||
|
||||
FragmentTabHost$SavedState(Parcel parcel) {
|
||||
super(parcel);
|
||||
this.curTab = parcel.readString();
|
||||
}
|
||||
}
|
32
sources/androidx/fragment/app/FragmentTransaction.java
Normal file
32
sources/androidx/fragment/app/FragmentTransaction.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class FragmentTransaction {
|
||||
public abstract int a();
|
||||
|
||||
public abstract FragmentTransaction a(int i, Fragment fragment);
|
||||
|
||||
public abstract FragmentTransaction a(int i, Fragment fragment, String str);
|
||||
|
||||
public abstract FragmentTransaction a(Fragment fragment);
|
||||
|
||||
public abstract FragmentTransaction a(Fragment fragment, String str);
|
||||
|
||||
public abstract FragmentTransaction a(String str);
|
||||
|
||||
public abstract int b();
|
||||
|
||||
public abstract FragmentTransaction b(int i, Fragment fragment);
|
||||
|
||||
public abstract FragmentTransaction b(int i, Fragment fragment, String str);
|
||||
|
||||
public abstract FragmentTransaction b(Fragment fragment);
|
||||
|
||||
public abstract FragmentTransaction c(Fragment fragment);
|
||||
|
||||
public abstract void c();
|
||||
|
||||
public abstract FragmentTransaction d(Fragment fragment);
|
||||
|
||||
public abstract FragmentTransaction e(Fragment fragment);
|
||||
}
|
706
sources/androidx/fragment/app/FragmentTransition.java
Normal file
706
sources/androidx/fragment/app/FragmentTransition.java
Normal file
@@ -0,0 +1,706 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.os.Build;
|
||||
import android.util.SparseArray;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.collection.ArrayMap;
|
||||
import androidx.core.app.SharedElementCallback;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class FragmentTransition {
|
||||
private static final int[] a = {0, 3, 0, 1, 5, 4, 7, 6, 9, 8};
|
||||
private static final FragmentTransitionImpl b;
|
||||
private static final FragmentTransitionImpl c;
|
||||
|
||||
static class FragmentContainerTransition {
|
||||
public Fragment a;
|
||||
public boolean b;
|
||||
public BackStackRecord c;
|
||||
public Fragment d;
|
||||
public boolean e;
|
||||
public BackStackRecord f;
|
||||
|
||||
FragmentContainerTransition() {
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
b = Build.VERSION.SDK_INT >= 21 ? new FragmentTransitionCompat21() : null;
|
||||
c = a();
|
||||
}
|
||||
|
||||
private static FragmentTransitionImpl a() {
|
||||
try {
|
||||
return (FragmentTransitionImpl) Class.forName("androidx.transition.FragmentTransitionSupport").getDeclaredConstructor(new Class[0]).newInstance(new Object[0]);
|
||||
} catch (Exception unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static void b(FragmentManagerImpl fragmentManagerImpl, int i, FragmentContainerTransition fragmentContainerTransition, View view, ArrayMap<String, String> arrayMap) {
|
||||
Fragment fragment;
|
||||
Fragment fragment2;
|
||||
FragmentTransitionImpl a2;
|
||||
Object obj;
|
||||
ViewGroup viewGroup = fragmentManagerImpl.n.a() ? (ViewGroup) fragmentManagerImpl.n.a(i) : null;
|
||||
if (viewGroup == null || (a2 = a((fragment2 = fragmentContainerTransition.d), (fragment = fragmentContainerTransition.a))) == null) {
|
||||
return;
|
||||
}
|
||||
boolean z = fragmentContainerTransition.b;
|
||||
boolean z2 = fragmentContainerTransition.e;
|
||||
ArrayList<View> arrayList = new ArrayList<>();
|
||||
ArrayList<View> arrayList2 = new ArrayList<>();
|
||||
Object a3 = a(a2, fragment, z);
|
||||
Object b2 = b(a2, fragment2, z2);
|
||||
Object b3 = b(a2, viewGroup, view, arrayMap, fragmentContainerTransition, arrayList2, arrayList, a3, b2);
|
||||
if (a3 == null && b3 == null) {
|
||||
obj = b2;
|
||||
if (obj == null) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
obj = b2;
|
||||
}
|
||||
ArrayList<View> a4 = a(a2, obj, fragment2, arrayList2, view);
|
||||
ArrayList<View> a5 = a(a2, a3, fragment, arrayList, view);
|
||||
a(a5, 4);
|
||||
Object a6 = a(a2, a3, obj, b3, fragment, z);
|
||||
if (a6 != null) {
|
||||
a(a2, obj, fragment2, a4);
|
||||
ArrayList<String> a7 = a2.a(arrayList);
|
||||
a2.a(a6, a3, a5, obj, a4, b3, arrayList);
|
||||
a2.a(viewGroup, a6);
|
||||
a2.a(viewGroup, arrayList2, arrayList, a7, arrayMap);
|
||||
a(a5, 0);
|
||||
a2.b(b3, arrayList2, arrayList);
|
||||
}
|
||||
}
|
||||
|
||||
static void a(FragmentManagerImpl fragmentManagerImpl, ArrayList<BackStackRecord> arrayList, ArrayList<Boolean> arrayList2, int i, int i2, boolean z) {
|
||||
if (fragmentManagerImpl.l < 1) {
|
||||
return;
|
||||
}
|
||||
SparseArray sparseArray = new SparseArray();
|
||||
for (int i3 = i; i3 < i2; i3++) {
|
||||
BackStackRecord backStackRecord = arrayList.get(i3);
|
||||
if (arrayList2.get(i3).booleanValue()) {
|
||||
b(backStackRecord, (SparseArray<FragmentContainerTransition>) sparseArray, z);
|
||||
} else {
|
||||
a(backStackRecord, (SparseArray<FragmentContainerTransition>) sparseArray, z);
|
||||
}
|
||||
}
|
||||
if (sparseArray.size() != 0) {
|
||||
View view = new View(fragmentManagerImpl.m.c());
|
||||
int size = sparseArray.size();
|
||||
for (int i4 = 0; i4 < size; i4++) {
|
||||
int keyAt = sparseArray.keyAt(i4);
|
||||
ArrayMap<String, String> a2 = a(keyAt, arrayList, arrayList2, i, i2);
|
||||
FragmentContainerTransition fragmentContainerTransition = (FragmentContainerTransition) sparseArray.valueAt(i4);
|
||||
if (z) {
|
||||
b(fragmentManagerImpl, keyAt, fragmentContainerTransition, view, a2);
|
||||
} else {
|
||||
a(fragmentManagerImpl, keyAt, fragmentContainerTransition, view, a2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static ArrayMap<String, String> a(int i, ArrayList<BackStackRecord> arrayList, ArrayList<Boolean> arrayList2, int i2, int i3) {
|
||||
ArrayList<String> arrayList3;
|
||||
ArrayList<String> arrayList4;
|
||||
ArrayMap<String, String> arrayMap = new ArrayMap<>();
|
||||
for (int i4 = i3 - 1; i4 >= i2; i4--) {
|
||||
BackStackRecord backStackRecord = arrayList.get(i4);
|
||||
if (backStackRecord.b(i)) {
|
||||
boolean booleanValue = arrayList2.get(i4).booleanValue();
|
||||
ArrayList<String> arrayList5 = backStackRecord.r;
|
||||
if (arrayList5 != null) {
|
||||
int size = arrayList5.size();
|
||||
if (booleanValue) {
|
||||
arrayList3 = backStackRecord.r;
|
||||
arrayList4 = backStackRecord.s;
|
||||
} else {
|
||||
ArrayList<String> arrayList6 = backStackRecord.r;
|
||||
arrayList3 = backStackRecord.s;
|
||||
arrayList4 = arrayList6;
|
||||
}
|
||||
for (int i5 = 0; i5 < size; i5++) {
|
||||
String str = arrayList4.get(i5);
|
||||
String str2 = arrayList3.get(i5);
|
||||
String remove = arrayMap.remove(str2);
|
||||
if (remove != null) {
|
||||
arrayMap.put(str, remove);
|
||||
} else {
|
||||
arrayMap.put(str, str2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return arrayMap;
|
||||
}
|
||||
|
||||
private static Object b(FragmentTransitionImpl fragmentTransitionImpl, Fragment fragment, boolean z) {
|
||||
Object exitTransition;
|
||||
if (fragment == null) {
|
||||
return null;
|
||||
}
|
||||
if (z) {
|
||||
exitTransition = fragment.getReturnTransition();
|
||||
} else {
|
||||
exitTransition = fragment.getExitTransition();
|
||||
}
|
||||
return fragmentTransitionImpl.b(exitTransition);
|
||||
}
|
||||
|
||||
private static Object b(final FragmentTransitionImpl fragmentTransitionImpl, ViewGroup viewGroup, View view, ArrayMap<String, String> arrayMap, FragmentContainerTransition fragmentContainerTransition, ArrayList<View> arrayList, ArrayList<View> arrayList2, Object obj, Object obj2) {
|
||||
Object obj3;
|
||||
final View view2;
|
||||
final Rect rect;
|
||||
final Fragment fragment = fragmentContainerTransition.a;
|
||||
final Fragment fragment2 = fragmentContainerTransition.d;
|
||||
if (fragment != null) {
|
||||
fragment.getView().setVisibility(0);
|
||||
}
|
||||
if (fragment == null || fragment2 == null) {
|
||||
return null;
|
||||
}
|
||||
final boolean z = fragmentContainerTransition.b;
|
||||
Object a2 = arrayMap.isEmpty() ? null : a(fragmentTransitionImpl, fragment, fragment2, z);
|
||||
ArrayMap<String, View> b2 = b(fragmentTransitionImpl, arrayMap, a2, fragmentContainerTransition);
|
||||
final ArrayMap<String, View> a3 = a(fragmentTransitionImpl, arrayMap, a2, fragmentContainerTransition);
|
||||
if (arrayMap.isEmpty()) {
|
||||
if (b2 != null) {
|
||||
b2.clear();
|
||||
}
|
||||
if (a3 != null) {
|
||||
a3.clear();
|
||||
}
|
||||
obj3 = null;
|
||||
} else {
|
||||
a(arrayList, b2, arrayMap.keySet());
|
||||
a(arrayList2, a3, arrayMap.values());
|
||||
obj3 = a2;
|
||||
}
|
||||
if (obj == null && obj2 == null && obj3 == null) {
|
||||
return null;
|
||||
}
|
||||
a(fragment, fragment2, z, b2, true);
|
||||
if (obj3 != null) {
|
||||
arrayList2.add(view);
|
||||
fragmentTransitionImpl.b(obj3, view, arrayList);
|
||||
a(fragmentTransitionImpl, obj3, obj2, b2, fragmentContainerTransition.e, fragmentContainerTransition.f);
|
||||
Rect rect2 = new Rect();
|
||||
View a4 = a(a3, fragmentContainerTransition, obj, z);
|
||||
if (a4 != null) {
|
||||
fragmentTransitionImpl.a(obj, rect2);
|
||||
}
|
||||
rect = rect2;
|
||||
view2 = a4;
|
||||
} else {
|
||||
view2 = null;
|
||||
rect = null;
|
||||
}
|
||||
OneShotPreDrawListener.a(viewGroup, new Runnable() { // from class: androidx.fragment.app.FragmentTransition.3
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
FragmentTransition.a(Fragment.this, fragment2, z, (ArrayMap<String, View>) a3, false);
|
||||
View view3 = view2;
|
||||
if (view3 != null) {
|
||||
fragmentTransitionImpl.a(view3, rect);
|
||||
}
|
||||
}
|
||||
});
|
||||
return obj3;
|
||||
}
|
||||
|
||||
private static void a(FragmentTransitionImpl fragmentTransitionImpl, Object obj, Fragment fragment, final ArrayList<View> arrayList) {
|
||||
if (fragment != null && obj != null && fragment.mAdded && fragment.mHidden && fragment.mHiddenChanged) {
|
||||
fragment.setHideReplaced(true);
|
||||
fragmentTransitionImpl.a(obj, fragment.getView(), arrayList);
|
||||
OneShotPreDrawListener.a(fragment.mContainer, new Runnable() { // from class: androidx.fragment.app.FragmentTransition.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
FragmentTransition.a((ArrayList<View>) arrayList, 4);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private static void a(FragmentManagerImpl fragmentManagerImpl, int i, FragmentContainerTransition fragmentContainerTransition, View view, ArrayMap<String, String> arrayMap) {
|
||||
Fragment fragment;
|
||||
Fragment fragment2;
|
||||
FragmentTransitionImpl a2;
|
||||
Object obj;
|
||||
ViewGroup viewGroup = fragmentManagerImpl.n.a() ? (ViewGroup) fragmentManagerImpl.n.a(i) : null;
|
||||
if (viewGroup == null || (a2 = a((fragment2 = fragmentContainerTransition.d), (fragment = fragmentContainerTransition.a))) == null) {
|
||||
return;
|
||||
}
|
||||
boolean z = fragmentContainerTransition.b;
|
||||
boolean z2 = fragmentContainerTransition.e;
|
||||
Object a3 = a(a2, fragment, z);
|
||||
Object b2 = b(a2, fragment2, z2);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
ArrayList<View> arrayList2 = new ArrayList<>();
|
||||
Object a4 = a(a2, viewGroup, view, arrayMap, fragmentContainerTransition, (ArrayList<View>) arrayList, arrayList2, a3, b2);
|
||||
if (a3 == null && a4 == null) {
|
||||
obj = b2;
|
||||
if (obj == null) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
obj = b2;
|
||||
}
|
||||
ArrayList<View> a5 = a(a2, obj, fragment2, (ArrayList<View>) arrayList, view);
|
||||
Object obj2 = (a5 == null || a5.isEmpty()) ? null : obj;
|
||||
a2.a(a3, view);
|
||||
Object a6 = a(a2, a3, obj2, a4, fragment, fragmentContainerTransition.b);
|
||||
if (a6 != null) {
|
||||
ArrayList<View> arrayList3 = new ArrayList<>();
|
||||
a2.a(a6, a3, arrayList3, obj2, a5, a4, arrayList2);
|
||||
a(a2, viewGroup, fragment, view, arrayList2, a3, arrayList3, obj2, a5);
|
||||
a2.a((View) viewGroup, arrayList2, (Map<String, String>) arrayMap);
|
||||
a2.a(viewGroup, a6);
|
||||
a2.a(viewGroup, arrayList2, (Map<String, String>) arrayMap);
|
||||
}
|
||||
}
|
||||
|
||||
private static ArrayMap<String, View> b(FragmentTransitionImpl fragmentTransitionImpl, ArrayMap<String, String> arrayMap, Object obj, FragmentContainerTransition fragmentContainerTransition) {
|
||||
SharedElementCallback exitTransitionCallback;
|
||||
ArrayList<String> arrayList;
|
||||
if (!arrayMap.isEmpty() && obj != null) {
|
||||
Fragment fragment = fragmentContainerTransition.d;
|
||||
ArrayMap<String, View> arrayMap2 = new ArrayMap<>();
|
||||
fragmentTransitionImpl.a((Map<String, View>) arrayMap2, fragment.getView());
|
||||
BackStackRecord backStackRecord = fragmentContainerTransition.f;
|
||||
if (fragmentContainerTransition.e) {
|
||||
exitTransitionCallback = fragment.getEnterTransitionCallback();
|
||||
arrayList = backStackRecord.s;
|
||||
} else {
|
||||
exitTransitionCallback = fragment.getExitTransitionCallback();
|
||||
arrayList = backStackRecord.r;
|
||||
}
|
||||
arrayMap2.a((Collection<?>) arrayList);
|
||||
if (exitTransitionCallback != null) {
|
||||
exitTransitionCallback.a(arrayList, arrayMap2);
|
||||
for (int size = arrayList.size() - 1; size >= 0; size--) {
|
||||
String str = arrayList.get(size);
|
||||
View view = arrayMap2.get(str);
|
||||
if (view == null) {
|
||||
arrayMap.remove(str);
|
||||
} else if (!str.equals(ViewCompat.p(view))) {
|
||||
arrayMap.put(ViewCompat.p(view), arrayMap.remove(str));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
arrayMap.a((Collection<?>) arrayMap2.keySet());
|
||||
}
|
||||
return arrayMap2;
|
||||
}
|
||||
arrayMap.clear();
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void a(final FragmentTransitionImpl fragmentTransitionImpl, ViewGroup viewGroup, final Fragment fragment, final View view, final ArrayList<View> arrayList, final Object obj, final ArrayList<View> arrayList2, final Object obj2, final ArrayList<View> arrayList3) {
|
||||
OneShotPreDrawListener.a(viewGroup, new Runnable() { // from class: androidx.fragment.app.FragmentTransition.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
Object obj3 = obj;
|
||||
if (obj3 != null) {
|
||||
fragmentTransitionImpl.b(obj3, view);
|
||||
arrayList2.addAll(FragmentTransition.a(fragmentTransitionImpl, obj, fragment, (ArrayList<View>) arrayList, view));
|
||||
}
|
||||
if (arrayList3 != null) {
|
||||
if (obj2 != null) {
|
||||
ArrayList<View> arrayList4 = new ArrayList<>();
|
||||
arrayList4.add(view);
|
||||
fragmentTransitionImpl.a(obj2, arrayList3, arrayList4);
|
||||
}
|
||||
arrayList3.clear();
|
||||
arrayList3.add(view);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static FragmentTransitionImpl a(Fragment fragment, Fragment fragment2) {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if (fragment != null) {
|
||||
Object exitTransition = fragment.getExitTransition();
|
||||
if (exitTransition != null) {
|
||||
arrayList.add(exitTransition);
|
||||
}
|
||||
Object returnTransition = fragment.getReturnTransition();
|
||||
if (returnTransition != null) {
|
||||
arrayList.add(returnTransition);
|
||||
}
|
||||
Object sharedElementReturnTransition = fragment.getSharedElementReturnTransition();
|
||||
if (sharedElementReturnTransition != null) {
|
||||
arrayList.add(sharedElementReturnTransition);
|
||||
}
|
||||
}
|
||||
if (fragment2 != null) {
|
||||
Object enterTransition = fragment2.getEnterTransition();
|
||||
if (enterTransition != null) {
|
||||
arrayList.add(enterTransition);
|
||||
}
|
||||
Object reenterTransition = fragment2.getReenterTransition();
|
||||
if (reenterTransition != null) {
|
||||
arrayList.add(reenterTransition);
|
||||
}
|
||||
Object sharedElementEnterTransition = fragment2.getSharedElementEnterTransition();
|
||||
if (sharedElementEnterTransition != null) {
|
||||
arrayList.add(sharedElementEnterTransition);
|
||||
}
|
||||
}
|
||||
if (arrayList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
FragmentTransitionImpl fragmentTransitionImpl = b;
|
||||
if (fragmentTransitionImpl != null && a(fragmentTransitionImpl, arrayList)) {
|
||||
return b;
|
||||
}
|
||||
FragmentTransitionImpl fragmentTransitionImpl2 = c;
|
||||
if (fragmentTransitionImpl2 != null && a(fragmentTransitionImpl2, arrayList)) {
|
||||
return c;
|
||||
}
|
||||
if (b == null && c == null) {
|
||||
return null;
|
||||
}
|
||||
throw new IllegalArgumentException("Invalid Transition types");
|
||||
}
|
||||
|
||||
public static void b(BackStackRecord backStackRecord, SparseArray<FragmentContainerTransition> sparseArray, boolean z) {
|
||||
if (backStackRecord.a.n.a()) {
|
||||
for (int size = backStackRecord.b.size() - 1; size >= 0; size--) {
|
||||
a(backStackRecord, backStackRecord.b.get(size), sparseArray, true, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean a(FragmentTransitionImpl fragmentTransitionImpl, List<Object> list) {
|
||||
int size = list.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
if (!fragmentTransitionImpl.a(list.get(i))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static Object a(FragmentTransitionImpl fragmentTransitionImpl, Fragment fragment, Fragment fragment2, boolean z) {
|
||||
Object sharedElementEnterTransition;
|
||||
if (fragment == null || fragment2 == null) {
|
||||
return null;
|
||||
}
|
||||
if (z) {
|
||||
sharedElementEnterTransition = fragment2.getSharedElementReturnTransition();
|
||||
} else {
|
||||
sharedElementEnterTransition = fragment.getSharedElementEnterTransition();
|
||||
}
|
||||
return fragmentTransitionImpl.c(fragmentTransitionImpl.b(sharedElementEnterTransition));
|
||||
}
|
||||
|
||||
private static Object a(FragmentTransitionImpl fragmentTransitionImpl, Fragment fragment, boolean z) {
|
||||
Object enterTransition;
|
||||
if (fragment == null) {
|
||||
return null;
|
||||
}
|
||||
if (z) {
|
||||
enterTransition = fragment.getReenterTransition();
|
||||
} else {
|
||||
enterTransition = fragment.getEnterTransition();
|
||||
}
|
||||
return fragmentTransitionImpl.b(enterTransition);
|
||||
}
|
||||
|
||||
private static void a(ArrayList<View> arrayList, ArrayMap<String, View> arrayMap, Collection<String> collection) {
|
||||
for (int size = arrayMap.size() - 1; size >= 0; size--) {
|
||||
View d = arrayMap.d(size);
|
||||
if (collection.contains(ViewCompat.p(d))) {
|
||||
arrayList.add(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Object a(final FragmentTransitionImpl fragmentTransitionImpl, ViewGroup viewGroup, final View view, final ArrayMap<String, String> arrayMap, final FragmentContainerTransition fragmentContainerTransition, final ArrayList<View> arrayList, final ArrayList<View> arrayList2, final Object obj, Object obj2) {
|
||||
Object a2;
|
||||
ArrayMap<String, String> arrayMap2;
|
||||
Object obj3;
|
||||
Rect rect;
|
||||
final Fragment fragment = fragmentContainerTransition.a;
|
||||
final Fragment fragment2 = fragmentContainerTransition.d;
|
||||
if (fragment == null || fragment2 == null) {
|
||||
return null;
|
||||
}
|
||||
final boolean z = fragmentContainerTransition.b;
|
||||
if (arrayMap.isEmpty()) {
|
||||
arrayMap2 = arrayMap;
|
||||
a2 = null;
|
||||
} else {
|
||||
a2 = a(fragmentTransitionImpl, fragment, fragment2, z);
|
||||
arrayMap2 = arrayMap;
|
||||
}
|
||||
ArrayMap<String, View> b2 = b(fragmentTransitionImpl, arrayMap2, a2, fragmentContainerTransition);
|
||||
if (arrayMap.isEmpty()) {
|
||||
obj3 = null;
|
||||
} else {
|
||||
arrayList.addAll(b2.values());
|
||||
obj3 = a2;
|
||||
}
|
||||
if (obj == null && obj2 == null && obj3 == null) {
|
||||
return null;
|
||||
}
|
||||
a(fragment, fragment2, z, b2, true);
|
||||
if (obj3 != null) {
|
||||
rect = new Rect();
|
||||
fragmentTransitionImpl.b(obj3, view, arrayList);
|
||||
a(fragmentTransitionImpl, obj3, obj2, b2, fragmentContainerTransition.e, fragmentContainerTransition.f);
|
||||
if (obj != null) {
|
||||
fragmentTransitionImpl.a(obj, rect);
|
||||
}
|
||||
} else {
|
||||
rect = null;
|
||||
}
|
||||
final Object obj4 = obj3;
|
||||
final Rect rect2 = rect;
|
||||
OneShotPreDrawListener.a(viewGroup, new Runnable() { // from class: androidx.fragment.app.FragmentTransition.4
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
ArrayMap<String, View> a3 = FragmentTransition.a(FragmentTransitionImpl.this, (ArrayMap<String, String>) arrayMap, obj4, fragmentContainerTransition);
|
||||
if (a3 != null) {
|
||||
arrayList2.addAll(a3.values());
|
||||
arrayList2.add(view);
|
||||
}
|
||||
FragmentTransition.a(fragment, fragment2, z, a3, false);
|
||||
Object obj5 = obj4;
|
||||
if (obj5 != null) {
|
||||
FragmentTransitionImpl.this.b(obj5, arrayList, arrayList2);
|
||||
View a4 = FragmentTransition.a(a3, fragmentContainerTransition, obj, z);
|
||||
if (a4 != null) {
|
||||
FragmentTransitionImpl.this.a(a4, rect2);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return obj3;
|
||||
}
|
||||
|
||||
static ArrayMap<String, View> a(FragmentTransitionImpl fragmentTransitionImpl, ArrayMap<String, String> arrayMap, Object obj, FragmentContainerTransition fragmentContainerTransition) {
|
||||
SharedElementCallback enterTransitionCallback;
|
||||
ArrayList<String> arrayList;
|
||||
String a2;
|
||||
Fragment fragment = fragmentContainerTransition.a;
|
||||
View view = fragment.getView();
|
||||
if (!arrayMap.isEmpty() && obj != null && view != null) {
|
||||
ArrayMap<String, View> arrayMap2 = new ArrayMap<>();
|
||||
fragmentTransitionImpl.a((Map<String, View>) arrayMap2, view);
|
||||
BackStackRecord backStackRecord = fragmentContainerTransition.c;
|
||||
if (fragmentContainerTransition.b) {
|
||||
enterTransitionCallback = fragment.getExitTransitionCallback();
|
||||
arrayList = backStackRecord.r;
|
||||
} else {
|
||||
enterTransitionCallback = fragment.getEnterTransitionCallback();
|
||||
arrayList = backStackRecord.s;
|
||||
}
|
||||
if (arrayList != null) {
|
||||
arrayMap2.a((Collection<?>) arrayList);
|
||||
arrayMap2.a((Collection<?>) arrayMap.values());
|
||||
}
|
||||
if (enterTransitionCallback != null) {
|
||||
enterTransitionCallback.a(arrayList, arrayMap2);
|
||||
for (int size = arrayList.size() - 1; size >= 0; size--) {
|
||||
String str = arrayList.get(size);
|
||||
View view2 = arrayMap2.get(str);
|
||||
if (view2 == null) {
|
||||
String a3 = a(arrayMap, str);
|
||||
if (a3 != null) {
|
||||
arrayMap.remove(a3);
|
||||
}
|
||||
} else if (!str.equals(ViewCompat.p(view2)) && (a2 = a(arrayMap, str)) != null) {
|
||||
arrayMap.put(a2, ViewCompat.p(view2));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
a(arrayMap, arrayMap2);
|
||||
}
|
||||
return arrayMap2;
|
||||
}
|
||||
arrayMap.clear();
|
||||
return null;
|
||||
}
|
||||
|
||||
private static String a(ArrayMap<String, String> arrayMap, String str) {
|
||||
int size = arrayMap.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
if (str.equals(arrayMap.d(i))) {
|
||||
return arrayMap.b(i);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static View a(ArrayMap<String, View> arrayMap, FragmentContainerTransition fragmentContainerTransition, Object obj, boolean z) {
|
||||
ArrayList<String> arrayList;
|
||||
String str;
|
||||
BackStackRecord backStackRecord = fragmentContainerTransition.c;
|
||||
if (obj == null || arrayMap == null || (arrayList = backStackRecord.r) == null || arrayList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
if (z) {
|
||||
str = backStackRecord.r.get(0);
|
||||
} else {
|
||||
str = backStackRecord.s.get(0);
|
||||
}
|
||||
return arrayMap.get(str);
|
||||
}
|
||||
|
||||
private static void a(FragmentTransitionImpl fragmentTransitionImpl, Object obj, Object obj2, ArrayMap<String, View> arrayMap, boolean z, BackStackRecord backStackRecord) {
|
||||
String str;
|
||||
ArrayList<String> arrayList = backStackRecord.r;
|
||||
if (arrayList == null || arrayList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (z) {
|
||||
str = backStackRecord.s.get(0);
|
||||
} else {
|
||||
str = backStackRecord.r.get(0);
|
||||
}
|
||||
View view = arrayMap.get(str);
|
||||
fragmentTransitionImpl.c(obj, view);
|
||||
if (obj2 != null) {
|
||||
fragmentTransitionImpl.c(obj2, view);
|
||||
}
|
||||
}
|
||||
|
||||
private static void a(ArrayMap<String, String> arrayMap, ArrayMap<String, View> arrayMap2) {
|
||||
for (int size = arrayMap.size() - 1; size >= 0; size--) {
|
||||
if (!arrayMap2.containsKey(arrayMap.d(size))) {
|
||||
arrayMap.c(size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void a(Fragment fragment, Fragment fragment2, boolean z, ArrayMap<String, View> arrayMap, boolean z2) {
|
||||
SharedElementCallback enterTransitionCallback;
|
||||
if (z) {
|
||||
enterTransitionCallback = fragment2.getEnterTransitionCallback();
|
||||
} else {
|
||||
enterTransitionCallback = fragment.getEnterTransitionCallback();
|
||||
}
|
||||
if (enterTransitionCallback != null) {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
ArrayList arrayList2 = new ArrayList();
|
||||
int size = arrayMap == null ? 0 : arrayMap.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
arrayList2.add(arrayMap.b(i));
|
||||
arrayList.add(arrayMap.d(i));
|
||||
}
|
||||
if (z2) {
|
||||
enterTransitionCallback.b(arrayList2, arrayList, null);
|
||||
} else {
|
||||
enterTransitionCallback.a(arrayList2, arrayList, (List<View>) null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static ArrayList<View> a(FragmentTransitionImpl fragmentTransitionImpl, Object obj, Fragment fragment, ArrayList<View> arrayList, View view) {
|
||||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
ArrayList<View> arrayList2 = new ArrayList<>();
|
||||
View view2 = fragment.getView();
|
||||
if (view2 != null) {
|
||||
fragmentTransitionImpl.a(arrayList2, view2);
|
||||
}
|
||||
if (arrayList != null) {
|
||||
arrayList2.removeAll(arrayList);
|
||||
}
|
||||
if (arrayList2.isEmpty()) {
|
||||
return arrayList2;
|
||||
}
|
||||
arrayList2.add(view);
|
||||
fragmentTransitionImpl.a(obj, arrayList2);
|
||||
return arrayList2;
|
||||
}
|
||||
|
||||
static void a(ArrayList<View> arrayList, int i) {
|
||||
if (arrayList == null) {
|
||||
return;
|
||||
}
|
||||
for (int size = arrayList.size() - 1; size >= 0; size--) {
|
||||
arrayList.get(size).setVisibility(i);
|
||||
}
|
||||
}
|
||||
|
||||
private static Object a(FragmentTransitionImpl fragmentTransitionImpl, Object obj, Object obj2, Object obj3, Fragment fragment, boolean z) {
|
||||
boolean z2;
|
||||
if (obj == null || obj2 == null || fragment == null) {
|
||||
z2 = true;
|
||||
} else if (z) {
|
||||
z2 = fragment.getAllowReturnTransitionOverlap();
|
||||
} else {
|
||||
z2 = fragment.getAllowEnterTransitionOverlap();
|
||||
}
|
||||
if (z2) {
|
||||
return fragmentTransitionImpl.b(obj2, obj, obj3);
|
||||
}
|
||||
return fragmentTransitionImpl.a(obj2, obj, obj3);
|
||||
}
|
||||
|
||||
public static void a(BackStackRecord backStackRecord, SparseArray<FragmentContainerTransition> sparseArray, boolean z) {
|
||||
int size = backStackRecord.b.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
a(backStackRecord, backStackRecord.b.get(i), sparseArray, false, z);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:100:0x0092, code lost:
|
||||
|
||||
if (r10.mHidden == false) goto L70;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:63:0x0041, code lost:
|
||||
|
||||
if (r10.mAdded != false) goto L70;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:64:0x0094, code lost:
|
||||
|
||||
r1 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:75:0x0076, code lost:
|
||||
|
||||
r1 = true;
|
||||
*/
|
||||
/* JADX WARN: Removed duplicated region for block: B:26:0x00a2 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:29:0x00b0 A[ADDED_TO_REGION] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:42:0x00d5 A[ADDED_TO_REGION] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:47:0x00e7 A[ADDED_TO_REGION] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:56:? A[ADDED_TO_REGION, RETURN, SYNTHETIC] */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private static void a(androidx.fragment.app.BackStackRecord r16, androidx.fragment.app.BackStackRecord.Op r17, android.util.SparseArray<androidx.fragment.app.FragmentTransition.FragmentContainerTransition> r18, boolean r19, boolean r20) {
|
||||
/*
|
||||
Method dump skipped, instructions count: 242
|
||||
To view this dump change 'Code comments level' option to 'DEBUG'
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.fragment.app.FragmentTransition.a(androidx.fragment.app.BackStackRecord, androidx.fragment.app.BackStackRecord$Op, android.util.SparseArray, boolean, boolean):void");
|
||||
}
|
||||
|
||||
private static FragmentContainerTransition a(FragmentContainerTransition fragmentContainerTransition, SparseArray<FragmentContainerTransition> sparseArray, int i) {
|
||||
if (fragmentContainerTransition != null) {
|
||||
return fragmentContainerTransition;
|
||||
}
|
||||
FragmentContainerTransition fragmentContainerTransition2 = new FragmentContainerTransition();
|
||||
sparseArray.put(i, fragmentContainerTransition2);
|
||||
return fragmentContainerTransition2;
|
||||
}
|
||||
}
|
273
sources/androidx/fragment/app/FragmentTransitionCompat21.java
Normal file
273
sources/androidx/fragment/app/FragmentTransitionCompat21.java
Normal file
@@ -0,0 +1,273 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.transition.Transition;
|
||||
import android.transition.TransitionManager;
|
||||
import android.transition.TransitionSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class FragmentTransitionCompat21 extends FragmentTransitionImpl {
|
||||
FragmentTransitionCompat21() {
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransitionImpl
|
||||
public boolean a(Object obj) {
|
||||
return obj instanceof Transition;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransitionImpl
|
||||
public Object b(Object obj) {
|
||||
if (obj != null) {
|
||||
return ((Transition) obj).clone();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransitionImpl
|
||||
public Object c(Object obj) {
|
||||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
TransitionSet transitionSet = new TransitionSet();
|
||||
transitionSet.addTransition((Transition) obj);
|
||||
return transitionSet;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransitionImpl
|
||||
public void a(Object obj, ArrayList<View> arrayList) {
|
||||
Transition transition = (Transition) obj;
|
||||
if (transition == null) {
|
||||
return;
|
||||
}
|
||||
int i = 0;
|
||||
if (transition instanceof TransitionSet) {
|
||||
TransitionSet transitionSet = (TransitionSet) transition;
|
||||
int transitionCount = transitionSet.getTransitionCount();
|
||||
while (i < transitionCount) {
|
||||
a(transitionSet.getTransitionAt(i), arrayList);
|
||||
i++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (a(transition) || !FragmentTransitionImpl.a((List) transition.getTargets())) {
|
||||
return;
|
||||
}
|
||||
int size = arrayList.size();
|
||||
while (i < size) {
|
||||
transition.addTarget(arrayList.get(i));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransitionImpl
|
||||
public void b(Object obj, View view, ArrayList<View> arrayList) {
|
||||
TransitionSet transitionSet = (TransitionSet) obj;
|
||||
List<View> targets = transitionSet.getTargets();
|
||||
targets.clear();
|
||||
int size = arrayList.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
FragmentTransitionImpl.a(targets, arrayList.get(i));
|
||||
}
|
||||
targets.add(view);
|
||||
arrayList.add(view);
|
||||
a(transitionSet, arrayList);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransitionImpl
|
||||
public void c(Object obj, View view) {
|
||||
if (view != null) {
|
||||
final Rect rect = new Rect();
|
||||
a(view, rect);
|
||||
((Transition) obj).setEpicenterCallback(new Transition.EpicenterCallback(this) { // from class: androidx.fragment.app.FragmentTransitionCompat21.1
|
||||
@Override // android.transition.Transition.EpicenterCallback
|
||||
public Rect onGetEpicenter(Transition transition) {
|
||||
return rect;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransitionImpl
|
||||
public Object b(Object obj, Object obj2, Object obj3) {
|
||||
TransitionSet transitionSet = new TransitionSet();
|
||||
if (obj != null) {
|
||||
transitionSet.addTransition((Transition) obj);
|
||||
}
|
||||
if (obj2 != null) {
|
||||
transitionSet.addTransition((Transition) obj2);
|
||||
}
|
||||
if (obj3 != null) {
|
||||
transitionSet.addTransition((Transition) obj3);
|
||||
}
|
||||
return transitionSet;
|
||||
}
|
||||
|
||||
private static boolean a(Transition transition) {
|
||||
return (FragmentTransitionImpl.a((List) transition.getTargetIds()) && FragmentTransitionImpl.a((List) transition.getTargetNames()) && FragmentTransitionImpl.a((List) transition.getTargetTypes())) ? false : true;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransitionImpl
|
||||
public void b(Object obj, ArrayList<View> arrayList, ArrayList<View> arrayList2) {
|
||||
TransitionSet transitionSet = (TransitionSet) obj;
|
||||
if (transitionSet != null) {
|
||||
transitionSet.getTargets().clear();
|
||||
transitionSet.getTargets().addAll(arrayList2);
|
||||
a((Object) transitionSet, arrayList, arrayList2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransitionImpl
|
||||
public void a(Object obj, final View view, final ArrayList<View> arrayList) {
|
||||
((Transition) obj).addListener(new Transition.TransitionListener(this) { // from class: androidx.fragment.app.FragmentTransitionCompat21.2
|
||||
@Override // android.transition.Transition.TransitionListener
|
||||
public void onTransitionCancel(Transition transition) {
|
||||
}
|
||||
|
||||
@Override // android.transition.Transition.TransitionListener
|
||||
public void onTransitionEnd(Transition transition) {
|
||||
transition.removeListener(this);
|
||||
view.setVisibility(8);
|
||||
int size = arrayList.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
((View) arrayList.get(i)).setVisibility(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.transition.Transition.TransitionListener
|
||||
public void onTransitionPause(Transition transition) {
|
||||
}
|
||||
|
||||
@Override // android.transition.Transition.TransitionListener
|
||||
public void onTransitionResume(Transition transition) {
|
||||
}
|
||||
|
||||
@Override // android.transition.Transition.TransitionListener
|
||||
public void onTransitionStart(Transition transition) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransitionImpl
|
||||
public Object a(Object obj, Object obj2, Object obj3) {
|
||||
Transition transition = (Transition) obj;
|
||||
Transition transition2 = (Transition) obj2;
|
||||
Transition transition3 = (Transition) obj3;
|
||||
if (transition != null && transition2 != null) {
|
||||
transition = new TransitionSet().addTransition(transition).addTransition(transition2).setOrdering(1);
|
||||
} else if (transition == null) {
|
||||
transition = transition2 != null ? transition2 : null;
|
||||
}
|
||||
if (transition3 == null) {
|
||||
return transition;
|
||||
}
|
||||
TransitionSet transitionSet = new TransitionSet();
|
||||
if (transition != null) {
|
||||
transitionSet.addTransition(transition);
|
||||
}
|
||||
transitionSet.addTransition(transition3);
|
||||
return transitionSet;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransitionImpl
|
||||
public void b(Object obj, View view) {
|
||||
if (obj != null) {
|
||||
((Transition) obj).removeTarget(view);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransitionImpl
|
||||
public void a(ViewGroup viewGroup, Object obj) {
|
||||
TransitionManager.beginDelayedTransition(viewGroup, (Transition) obj);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransitionImpl
|
||||
public void a(Object obj, final Object obj2, final ArrayList<View> arrayList, final Object obj3, final ArrayList<View> arrayList2, final Object obj4, final ArrayList<View> arrayList3) {
|
||||
((Transition) obj).addListener(new Transition.TransitionListener() { // from class: androidx.fragment.app.FragmentTransitionCompat21.3
|
||||
@Override // android.transition.Transition.TransitionListener
|
||||
public void onTransitionCancel(Transition transition) {
|
||||
}
|
||||
|
||||
@Override // android.transition.Transition.TransitionListener
|
||||
public void onTransitionEnd(Transition transition) {
|
||||
}
|
||||
|
||||
@Override // android.transition.Transition.TransitionListener
|
||||
public void onTransitionPause(Transition transition) {
|
||||
}
|
||||
|
||||
@Override // android.transition.Transition.TransitionListener
|
||||
public void onTransitionResume(Transition transition) {
|
||||
}
|
||||
|
||||
@Override // android.transition.Transition.TransitionListener
|
||||
public void onTransitionStart(Transition transition) {
|
||||
Object obj5 = obj2;
|
||||
if (obj5 != null) {
|
||||
FragmentTransitionCompat21.this.a(obj5, arrayList, (ArrayList<View>) null);
|
||||
}
|
||||
Object obj6 = obj3;
|
||||
if (obj6 != null) {
|
||||
FragmentTransitionCompat21.this.a(obj6, arrayList2, (ArrayList<View>) null);
|
||||
}
|
||||
Object obj7 = obj4;
|
||||
if (obj7 != null) {
|
||||
FragmentTransitionCompat21.this.a(obj7, arrayList3, (ArrayList<View>) null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransitionImpl
|
||||
public void a(Object obj, ArrayList<View> arrayList, ArrayList<View> arrayList2) {
|
||||
List<View> targets;
|
||||
Transition transition = (Transition) obj;
|
||||
int i = 0;
|
||||
if (transition instanceof TransitionSet) {
|
||||
TransitionSet transitionSet = (TransitionSet) transition;
|
||||
int transitionCount = transitionSet.getTransitionCount();
|
||||
while (i < transitionCount) {
|
||||
a((Object) transitionSet.getTransitionAt(i), arrayList, arrayList2);
|
||||
i++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (a(transition) || (targets = transition.getTargets()) == null || targets.size() != arrayList.size() || !targets.containsAll(arrayList)) {
|
||||
return;
|
||||
}
|
||||
int size = arrayList2 == null ? 0 : arrayList2.size();
|
||||
while (i < size) {
|
||||
transition.addTarget(arrayList2.get(i));
|
||||
i++;
|
||||
}
|
||||
for (int size2 = arrayList.size() - 1; size2 >= 0; size2--) {
|
||||
transition.removeTarget(arrayList.get(size2));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransitionImpl
|
||||
public void a(Object obj, View view) {
|
||||
if (obj != null) {
|
||||
((Transition) obj).addTarget(view);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentTransitionImpl
|
||||
public void a(Object obj, final Rect rect) {
|
||||
if (obj != null) {
|
||||
((Transition) obj).setEpicenterCallback(new Transition.EpicenterCallback(this) { // from class: androidx.fragment.app.FragmentTransitionCompat21.4
|
||||
@Override // android.transition.Transition.EpicenterCallback
|
||||
public Rect onGetEpicenter(Transition transition) {
|
||||
Rect rect2 = rect;
|
||||
if (rect2 == null || rect2.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return rect;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
202
sources/androidx/fragment/app/FragmentTransitionImpl.java
Normal file
202
sources/androidx/fragment/app/FragmentTransitionImpl.java
Normal file
@@ -0,0 +1,202 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.ViewGroupCompat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class FragmentTransitionImpl {
|
||||
public abstract Object a(Object obj, Object obj2, Object obj3);
|
||||
|
||||
protected void a(View view, Rect rect) {
|
||||
int[] iArr = new int[2];
|
||||
view.getLocationOnScreen(iArr);
|
||||
rect.set(iArr[0], iArr[1], iArr[0] + view.getWidth(), iArr[1] + view.getHeight());
|
||||
}
|
||||
|
||||
public abstract void a(ViewGroup viewGroup, Object obj);
|
||||
|
||||
public abstract void a(Object obj, Rect rect);
|
||||
|
||||
public abstract void a(Object obj, View view);
|
||||
|
||||
public abstract void a(Object obj, View view, ArrayList<View> arrayList);
|
||||
|
||||
public abstract void a(Object obj, Object obj2, ArrayList<View> arrayList, Object obj3, ArrayList<View> arrayList2, Object obj4, ArrayList<View> arrayList3);
|
||||
|
||||
public abstract void a(Object obj, ArrayList<View> arrayList);
|
||||
|
||||
public abstract void a(Object obj, ArrayList<View> arrayList, ArrayList<View> arrayList2);
|
||||
|
||||
public abstract boolean a(Object obj);
|
||||
|
||||
public abstract Object b(Object obj);
|
||||
|
||||
public abstract Object b(Object obj, Object obj2, Object obj3);
|
||||
|
||||
public abstract void b(Object obj, View view);
|
||||
|
||||
public abstract void b(Object obj, View view, ArrayList<View> arrayList);
|
||||
|
||||
public abstract void b(Object obj, ArrayList<View> arrayList, ArrayList<View> arrayList2);
|
||||
|
||||
public abstract Object c(Object obj);
|
||||
|
||||
public abstract void c(Object obj, View view);
|
||||
|
||||
ArrayList<String> a(ArrayList<View> arrayList) {
|
||||
ArrayList<String> arrayList2 = new ArrayList<>();
|
||||
int size = arrayList.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
View view = arrayList.get(i);
|
||||
arrayList2.add(ViewCompat.p(view));
|
||||
ViewCompat.a(view, (String) null);
|
||||
}
|
||||
return arrayList2;
|
||||
}
|
||||
|
||||
void a(View view, final ArrayList<View> arrayList, final ArrayList<View> arrayList2, final ArrayList<String> arrayList3, Map<String, String> map) {
|
||||
final int size = arrayList2.size();
|
||||
final ArrayList arrayList4 = new ArrayList();
|
||||
for (int i = 0; i < size; i++) {
|
||||
View view2 = arrayList.get(i);
|
||||
String p = ViewCompat.p(view2);
|
||||
arrayList4.add(p);
|
||||
if (p != null) {
|
||||
ViewCompat.a(view2, (String) null);
|
||||
String str = map.get(p);
|
||||
int i2 = 0;
|
||||
while (true) {
|
||||
if (i2 >= size) {
|
||||
break;
|
||||
}
|
||||
if (str.equals(arrayList3.get(i2))) {
|
||||
ViewCompat.a(arrayList2.get(i2), p);
|
||||
break;
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
}
|
||||
OneShotPreDrawListener.a(view, new Runnable(this) { // from class: androidx.fragment.app.FragmentTransitionImpl.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
for (int i3 = 0; i3 < size; i3++) {
|
||||
ViewCompat.a((View) arrayList2.get(i3), (String) arrayList3.get(i3));
|
||||
ViewCompat.a((View) arrayList.get(i3), (String) arrayList4.get(i3));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void a(ArrayList<View> arrayList, View view) {
|
||||
if (view.getVisibility() == 0) {
|
||||
if (view instanceof ViewGroup) {
|
||||
ViewGroup viewGroup = (ViewGroup) view;
|
||||
if (ViewGroupCompat.a(viewGroup)) {
|
||||
arrayList.add(viewGroup);
|
||||
return;
|
||||
}
|
||||
int childCount = viewGroup.getChildCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
a(arrayList, viewGroup.getChildAt(i));
|
||||
}
|
||||
return;
|
||||
}
|
||||
arrayList.add(view);
|
||||
}
|
||||
}
|
||||
|
||||
void a(Map<String, View> map, View view) {
|
||||
if (view.getVisibility() == 0) {
|
||||
String p = ViewCompat.p(view);
|
||||
if (p != null) {
|
||||
map.put(p, view);
|
||||
}
|
||||
if (view instanceof ViewGroup) {
|
||||
ViewGroup viewGroup = (ViewGroup) view;
|
||||
int childCount = viewGroup.getChildCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
a(map, viewGroup.getChildAt(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void a(View view, final ArrayList<View> arrayList, final Map<String, String> map) {
|
||||
OneShotPreDrawListener.a(view, new Runnable(this) { // from class: androidx.fragment.app.FragmentTransitionImpl.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
int size = arrayList.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
View view2 = (View) arrayList.get(i);
|
||||
String p = ViewCompat.p(view2);
|
||||
if (p != null) {
|
||||
ViewCompat.a(view2, FragmentTransitionImpl.a((Map<String, String>) map, p));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void a(ViewGroup viewGroup, final ArrayList<View> arrayList, final Map<String, String> map) {
|
||||
OneShotPreDrawListener.a(viewGroup, new Runnable(this) { // from class: androidx.fragment.app.FragmentTransitionImpl.3
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
int size = arrayList.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
View view = (View) arrayList.get(i);
|
||||
ViewCompat.a(view, (String) map.get(ViewCompat.p(view)));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected static void a(List<View> list, View view) {
|
||||
int size = list.size();
|
||||
if (a(list, view, size)) {
|
||||
return;
|
||||
}
|
||||
list.add(view);
|
||||
for (int i = size; i < list.size(); i++) {
|
||||
View view2 = list.get(i);
|
||||
if (view2 instanceof ViewGroup) {
|
||||
ViewGroup viewGroup = (ViewGroup) view2;
|
||||
int childCount = viewGroup.getChildCount();
|
||||
for (int i2 = 0; i2 < childCount; i2++) {
|
||||
View childAt = viewGroup.getChildAt(i2);
|
||||
if (!a(list, childAt, size)) {
|
||||
list.add(childAt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean a(List<View> list, View view, int i) {
|
||||
for (int i2 = 0; i2 < i; i2++) {
|
||||
if (list.get(i2) == view) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected static boolean a(List list) {
|
||||
return list == null || list.isEmpty();
|
||||
}
|
||||
|
||||
static String a(Map<String, String> map, String str) {
|
||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||
if (str.equals(entry.getValue())) {
|
||||
return entry.getKey();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
50
sources/androidx/fragment/app/OneShotPreDrawListener.java
Normal file
50
sources/androidx/fragment/app/OneShotPreDrawListener.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class OneShotPreDrawListener implements ViewTreeObserver.OnPreDrawListener, View.OnAttachStateChangeListener {
|
||||
private final View a;
|
||||
private ViewTreeObserver b;
|
||||
private final Runnable c;
|
||||
|
||||
private OneShotPreDrawListener(View view, Runnable runnable) {
|
||||
this.a = view;
|
||||
this.b = view.getViewTreeObserver();
|
||||
this.c = runnable;
|
||||
}
|
||||
|
||||
public static OneShotPreDrawListener a(View view, Runnable runnable) {
|
||||
OneShotPreDrawListener oneShotPreDrawListener = new OneShotPreDrawListener(view, runnable);
|
||||
view.getViewTreeObserver().addOnPreDrawListener(oneShotPreDrawListener);
|
||||
view.addOnAttachStateChangeListener(oneShotPreDrawListener);
|
||||
return oneShotPreDrawListener;
|
||||
}
|
||||
|
||||
@Override // android.view.ViewTreeObserver.OnPreDrawListener
|
||||
public boolean onPreDraw() {
|
||||
a();
|
||||
this.c.run();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnAttachStateChangeListener
|
||||
public void onViewAttachedToWindow(View view) {
|
||||
this.b = view.getViewTreeObserver();
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnAttachStateChangeListener
|
||||
public void onViewDetachedFromWindow(View view) {
|
||||
a();
|
||||
}
|
||||
|
||||
public void a() {
|
||||
if (this.b.isAlive()) {
|
||||
this.b.removeOnPreDrawListener(this);
|
||||
} else {
|
||||
this.a.getViewTreeObserver().removeOnPreDrawListener(this);
|
||||
}
|
||||
this.a.removeOnAttachStateChangeListener(this);
|
||||
}
|
||||
}
|
10
sources/androidx/fragment/app/SuperNotCalledException.java
Normal file
10
sources/androidx/fragment/app/SuperNotCalledException.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package androidx.fragment.app;
|
||||
|
||||
import android.util.AndroidRuntimeException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class SuperNotCalledException extends AndroidRuntimeException {
|
||||
public SuperNotCalledException(String str) {
|
||||
super(str);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user