494 lines
16 KiB
Java
494 lines
16 KiB
Java
package androidx.fragment.app;
|
|
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.IntentSender;
|
|
import android.content.res.Configuration;
|
|
import android.os.Bundle;
|
|
import android.util.AttributeSet;
|
|
import android.view.LayoutInflater;
|
|
import android.view.MenuItem;
|
|
import android.view.View;
|
|
import android.view.Window;
|
|
import androidx.activity.ComponentActivity;
|
|
import androidx.activity.OnBackPressedDispatcher;
|
|
import androidx.core.app.ActivityCompat;
|
|
import androidx.core.app.SharedElementCallback;
|
|
import androidx.fragment.app.FragmentActivity;
|
|
import java.io.FileDescriptor;
|
|
import java.io.PrintWriter;
|
|
import o.AHZ;
|
|
import o.C0801Ovz;
|
|
import o.CeN;
|
|
import o.DLs;
|
|
import o.FNE;
|
|
import o.InterfaceC0940Ryk;
|
|
import o.InterfaceC16139lbS;
|
|
import o.InterfaceC17278vUG;
|
|
import o.InterfaceC17396wQp;
|
|
import o.InterfaceC9254dgJ;
|
|
import o.LPk;
|
|
import o.NHB;
|
|
import o.NPK;
|
|
import o.QUU;
|
|
import o.RIz;
|
|
import o.VYa;
|
|
import o.WDF;
|
|
import o.gxQ;
|
|
import o.mxa;
|
|
import o.sUv;
|
|
import o.vPa;
|
|
import o.vjh;
|
|
import o.wdQ;
|
|
import o.yRS;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class FragmentActivity extends ComponentActivity implements ActivityCompat.IeS {
|
|
static final String LIFECYCLE_TAG = "android:support:lifecycle";
|
|
boolean mCreated;
|
|
final LPk mFragmentLifecycleRegistry;
|
|
final DLs mFragments;
|
|
boolean mResumed;
|
|
boolean mStopped;
|
|
|
|
@Deprecated
|
|
public void onAttachFragment(Fragment fragment) {
|
|
}
|
|
|
|
@Override // androidx.core.app.ActivityCompat.IeS
|
|
@Deprecated
|
|
public final void validateRequestPermissionsRequestCode(int i) {
|
|
}
|
|
|
|
public FragmentActivity() {
|
|
this.mFragments = DLs.c(new IeS(this));
|
|
this.mFragmentLifecycleRegistry = new LPk(this);
|
|
this.mStopped = true;
|
|
init();
|
|
}
|
|
|
|
public FragmentActivity(int i) {
|
|
super(i);
|
|
this.mFragments = DLs.c(new IeS(this));
|
|
this.mFragmentLifecycleRegistry = new LPk(this);
|
|
this.mStopped = true;
|
|
init();
|
|
}
|
|
|
|
private void init() {
|
|
getSavedStateRegistry().a(LIFECYCLE_TAG, new FNE.Sts(this) { // from class: o.gML
|
|
public final FragmentActivity e;
|
|
|
|
@Override // o.FNE.Sts
|
|
public final Bundle AK_() {
|
|
return this.e.m2lambda$init$0$androidxfragmentappFragmentActivity();
|
|
}
|
|
|
|
{
|
|
this.e = this;
|
|
}
|
|
});
|
|
addOnConfigurationChangedListener(new QUU(this) { // from class: o.TOj
|
|
public final FragmentActivity e;
|
|
|
|
@Override // o.QUU
|
|
public final void accept(Object obj) {
|
|
this.e.m3lambda$init$1$androidxfragmentappFragmentActivity((Configuration) obj);
|
|
}
|
|
|
|
{
|
|
this.e = this;
|
|
}
|
|
});
|
|
addOnNewIntentListener(new QUU(this) { // from class: o.eGR
|
|
public final FragmentActivity d;
|
|
|
|
@Override // o.QUU
|
|
public final void accept(Object obj) {
|
|
this.d.m4lambda$init$2$androidxfragmentappFragmentActivity((Intent) obj);
|
|
}
|
|
|
|
{
|
|
this.d = this;
|
|
}
|
|
});
|
|
addOnContextAvailableListener(new InterfaceC17278vUG(this) { // from class: o.BhV
|
|
public final FragmentActivity c;
|
|
|
|
@Override // o.InterfaceC17278vUG
|
|
public final void a(Context context) {
|
|
this.c.m5lambda$init$3$androidxfragmentappFragmentActivity(context);
|
|
}
|
|
|
|
{
|
|
this.c = this;
|
|
}
|
|
});
|
|
}
|
|
|
|
/* renamed from: lambda$init$0$androidx-fragment-app-FragmentActivity, reason: not valid java name */
|
|
public /* synthetic */ Bundle m2lambda$init$0$androidxfragmentappFragmentActivity() {
|
|
markFragmentsCreated();
|
|
this.mFragmentLifecycleRegistry.d(wdQ.HBt.ON_STOP);
|
|
return new Bundle();
|
|
}
|
|
|
|
/* renamed from: lambda$init$1$androidx-fragment-app-FragmentActivity, reason: not valid java name */
|
|
public /* synthetic */ void m3lambda$init$1$androidxfragmentappFragmentActivity(Configuration configuration) {
|
|
this.mFragments.f();
|
|
}
|
|
|
|
/* renamed from: lambda$init$2$androidx-fragment-app-FragmentActivity, reason: not valid java name */
|
|
public /* synthetic */ void m4lambda$init$2$androidxfragmentappFragmentActivity(Intent intent) {
|
|
this.mFragments.f();
|
|
}
|
|
|
|
/* renamed from: lambda$init$3$androidx-fragment-app-FragmentActivity, reason: not valid java name */
|
|
public /* synthetic */ void m5lambda$init$3$androidxfragmentappFragmentActivity(Context context) {
|
|
this.mFragments.b(null);
|
|
}
|
|
|
|
@Override // androidx.activity.ComponentActivity, android.app.Activity
|
|
public void onActivityResult(int i, int i2, Intent intent) {
|
|
this.mFragments.f();
|
|
super.onActivityResult(i, i2, intent);
|
|
}
|
|
|
|
public void supportFinishAfterTransition() {
|
|
ActivityCompat.lI_(this);
|
|
}
|
|
|
|
public void setEnterSharedElementCallback(SharedElementCallback sharedElementCallback) {
|
|
ActivityCompat.lN_(this, sharedElementCallback);
|
|
}
|
|
|
|
public void setExitSharedElementCallback(SharedElementCallback sharedElementCallback) {
|
|
ActivityCompat.lO_(this, sharedElementCallback);
|
|
}
|
|
|
|
public void supportPostponeEnterTransition() {
|
|
ActivityCompat.lK_(this);
|
|
}
|
|
|
|
public void supportStartPostponedEnterTransition() {
|
|
ActivityCompat.lS_(this);
|
|
}
|
|
|
|
@Override // androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
|
public void onCreate(Bundle bundle) {
|
|
super.onCreate(bundle);
|
|
this.mFragmentLifecycleRegistry.d(wdQ.HBt.ON_CREATE);
|
|
this.mFragments.c();
|
|
}
|
|
|
|
@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, 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;
|
|
}
|
|
|
|
final View dispatchFragmentsOnCreateView(View view, String str, Context context, AttributeSet attributeSet) {
|
|
return this.mFragments.ym_(view, str, context, attributeSet);
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void onDestroy() {
|
|
super.onDestroy();
|
|
this.mFragments.b();
|
|
this.mFragmentLifecycleRegistry.d(wdQ.HBt.ON_DESTROY);
|
|
}
|
|
|
|
@Override // androidx.activity.ComponentActivity, android.app.Activity, android.view.Window.Callback
|
|
public boolean onMenuItemSelected(int i, MenuItem menuItem) {
|
|
if (super.onMenuItemSelected(i, menuItem)) {
|
|
return true;
|
|
}
|
|
if (i == 6) {
|
|
return this.mFragments.yl_(menuItem);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@Override // androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
|
public void onPause() {
|
|
super.onPause();
|
|
this.mResumed = false;
|
|
this.mFragments.e();
|
|
this.mFragmentLifecycleRegistry.d(wdQ.HBt.ON_PAUSE);
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void onStateNotSaved() {
|
|
this.mFragments.f();
|
|
}
|
|
|
|
@Override // androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
|
public void onResume() {
|
|
this.mFragments.f();
|
|
super.onResume();
|
|
this.mResumed = true;
|
|
this.mFragments.h();
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void onPostResume() {
|
|
super.onPostResume();
|
|
onResumeFragments();
|
|
}
|
|
|
|
protected void onResumeFragments() {
|
|
this.mFragmentLifecycleRegistry.d(wdQ.HBt.ON_RESUME);
|
|
this.mFragments.a();
|
|
}
|
|
|
|
@Override // androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
|
public void onStart() {
|
|
this.mFragments.f();
|
|
super.onStart();
|
|
this.mStopped = false;
|
|
if (!this.mCreated) {
|
|
this.mCreated = true;
|
|
this.mFragments.d();
|
|
}
|
|
this.mFragments.h();
|
|
this.mFragmentLifecycleRegistry.d(wdQ.HBt.ON_START);
|
|
this.mFragments.g();
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void onStop() {
|
|
super.onStop();
|
|
this.mStopped = true;
|
|
markFragmentsCreated();
|
|
this.mFragments.j();
|
|
this.mFragmentLifecycleRegistry.d(wdQ.HBt.ON_STOP);
|
|
}
|
|
|
|
@Deprecated
|
|
public void supportInvalidateOptionsMenu() {
|
|
invalidateOptionsMenu();
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public void dump(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
|
|
super.dump(str, fileDescriptor, printWriter, strArr);
|
|
if (shouldDumpInternalState(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) {
|
|
NPK.a(this).e(str2, fileDescriptor, printWriter, strArr);
|
|
}
|
|
this.mFragments.i().e(str, fileDescriptor, printWriter, strArr);
|
|
}
|
|
}
|
|
|
|
public yRS getSupportFragmentManager() {
|
|
return this.mFragments.i();
|
|
}
|
|
|
|
@Deprecated
|
|
public NPK getSupportLoaderManager() {
|
|
return NPK.a(this);
|
|
}
|
|
|
|
@Override // androidx.activity.ComponentActivity, android.app.Activity
|
|
public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
|
|
this.mFragments.f();
|
|
super.onRequestPermissionsResult(i, strArr, iArr);
|
|
}
|
|
|
|
public void startActivityFromFragment(Fragment fragment, Intent intent, int i) {
|
|
startActivityFromFragment(fragment, intent, i, (Bundle) null);
|
|
}
|
|
|
|
public void startActivityFromFragment(Fragment fragment, Intent intent, int i, Bundle bundle) {
|
|
if (i == -1) {
|
|
ActivityCompat.lQ_(this, intent, -1, bundle);
|
|
} else {
|
|
fragment.startActivityForResult(intent, i, bundle);
|
|
}
|
|
}
|
|
|
|
@Deprecated
|
|
public void startIntentSenderFromFragment(Fragment fragment, IntentSender intentSender, int i, Intent intent, int i2, int i3, int i4, Bundle bundle) throws IntentSender.SendIntentException {
|
|
if (i == -1) {
|
|
ActivityCompat.lR_(this, intentSender, i, intent, i2, i3, i4, bundle);
|
|
} else {
|
|
fragment.startIntentSenderForResult(intentSender, i, intent, i2, i3, i4, bundle);
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
class IeS extends vjh<FragmentActivity> implements VYa, InterfaceC16139lbS, InterfaceC17396wQp, WDF, InterfaceC0940Ryk, NHB, mxa, InterfaceC9254dgJ, gxQ, RIz {
|
|
final FragmentActivity b;
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public IeS(FragmentActivity fragmentActivity) {
|
|
super(fragmentActivity);
|
|
this.b = fragmentActivity;
|
|
}
|
|
|
|
@Override // o.InterfaceC16541pFg
|
|
public final wdQ getLifecycle() {
|
|
return this.b.mFragmentLifecycleRegistry;
|
|
}
|
|
|
|
@Override // o.InterfaceC0940Ryk
|
|
public final sUv getViewModelStore() {
|
|
return this.b.getViewModelStore();
|
|
}
|
|
|
|
@Override // o.NHB
|
|
public final OnBackPressedDispatcher getOnBackPressedDispatcher() {
|
|
return this.b.getOnBackPressedDispatcher();
|
|
}
|
|
|
|
@Override // o.vjh
|
|
public final void c(String str, PrintWriter printWriter, String[] strArr) {
|
|
this.b.dump(str, null, printWriter, strArr);
|
|
}
|
|
|
|
@Override // o.vjh
|
|
public final LayoutInflater yp_() {
|
|
return this.b.getLayoutInflater().cloneInContext(this.b);
|
|
}
|
|
|
|
@Override // o.vjh
|
|
public final void a() {
|
|
this.b.invalidateOptionsMenu();
|
|
}
|
|
|
|
@Override // o.vjh
|
|
public final boolean a(String str) {
|
|
return ActivityCompat.lP_(this.b, str);
|
|
}
|
|
|
|
@Override // o.gxQ
|
|
public final void d(yRS yrs, Fragment fragment) {
|
|
this.b.onAttachFragment(fragment);
|
|
}
|
|
|
|
@Override // o.vjh, o.wTJ
|
|
public final View b(int i) {
|
|
return this.b.findViewById(i);
|
|
}
|
|
|
|
@Override // o.vjh, o.wTJ
|
|
public final boolean c() {
|
|
Window window = this.b.getWindow();
|
|
return (window == null || window.peekDecorView() == null) ? false : true;
|
|
}
|
|
|
|
@Override // o.mxa
|
|
public final CeN getActivityResultRegistry() {
|
|
return this.b.getActivityResultRegistry();
|
|
}
|
|
|
|
@Override // o.InterfaceC9254dgJ
|
|
public final FNE getSavedStateRegistry() {
|
|
return this.b.getSavedStateRegistry();
|
|
}
|
|
|
|
@Override // o.VYa
|
|
public final void addOnConfigurationChangedListener(QUU<Configuration> quu) {
|
|
this.b.addOnConfigurationChangedListener(quu);
|
|
}
|
|
|
|
@Override // o.VYa
|
|
public final void removeOnConfigurationChangedListener(QUU<Configuration> quu) {
|
|
this.b.removeOnConfigurationChangedListener(quu);
|
|
}
|
|
|
|
@Override // o.InterfaceC16139lbS
|
|
public final void addOnTrimMemoryListener(QUU<Integer> quu) {
|
|
this.b.addOnTrimMemoryListener(quu);
|
|
}
|
|
|
|
@Override // o.InterfaceC16139lbS
|
|
public final void removeOnTrimMemoryListener(QUU<Integer> quu) {
|
|
this.b.removeOnTrimMemoryListener(quu);
|
|
}
|
|
|
|
@Override // o.InterfaceC17396wQp
|
|
public final void addOnMultiWindowModeChangedListener(QUU<vPa> quu) {
|
|
this.b.addOnMultiWindowModeChangedListener(quu);
|
|
}
|
|
|
|
@Override // o.InterfaceC17396wQp
|
|
public final void removeOnMultiWindowModeChangedListener(QUU<vPa> quu) {
|
|
this.b.removeOnMultiWindowModeChangedListener(quu);
|
|
}
|
|
|
|
@Override // o.WDF
|
|
public final void addOnPictureInPictureModeChangedListener(QUU<C0801Ovz> quu) {
|
|
this.b.addOnPictureInPictureModeChangedListener(quu);
|
|
}
|
|
|
|
@Override // o.WDF
|
|
public final void removeOnPictureInPictureModeChangedListener(QUU<C0801Ovz> quu) {
|
|
this.b.removeOnPictureInPictureModeChangedListener(quu);
|
|
}
|
|
|
|
@Override // o.RIz
|
|
public final void addMenuProvider(AHZ ahz) {
|
|
this.b.addMenuProvider(ahz);
|
|
}
|
|
|
|
@Override // o.RIz
|
|
public final void removeMenuProvider(AHZ ahz) {
|
|
this.b.removeMenuProvider(ahz);
|
|
}
|
|
|
|
@Override // o.vjh
|
|
public final /* bridge */ /* synthetic */ FragmentActivity e() {
|
|
return this.b;
|
|
}
|
|
}
|
|
|
|
void markFragmentsCreated() {
|
|
do {
|
|
} while (markState(getSupportFragmentManager(), wdQ.IeS.CREATED));
|
|
}
|
|
|
|
private static boolean markState(yRS yrs, wdQ.IeS ieS) {
|
|
boolean z = false;
|
|
for (Fragment fragment : yrs.r()) {
|
|
if (fragment != null) {
|
|
if (fragment.getHost() != null) {
|
|
z |= markState(fragment.getChildFragmentManager(), ieS);
|
|
}
|
|
if (fragment.mViewLifecycleOwner != null && fragment.mViewLifecycleOwner.getLifecycle().a().c(wdQ.IeS.STARTED)) {
|
|
fragment.mViewLifecycleOwner.c(ieS);
|
|
z = true;
|
|
}
|
|
if (fragment.mLifecycleRegistry.a().c(wdQ.IeS.STARTED)) {
|
|
fragment.mLifecycleRegistry.b(ieS);
|
|
z = true;
|
|
}
|
|
}
|
|
}
|
|
return z;
|
|
}
|
|
|
|
@Override // androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, android.app.Activity, android.view.ContextThemeWrapper, android.content.ContextWrapper
|
|
public void attachBaseContext(Context context) {
|
|
super.attachBaseContext(context);
|
|
}
|
|
}
|