488 lines
15 KiB
Smali
488 lines
15 KiB
Smali
.class public Landroidx/fragment/app/FragmentLayoutInflaterFactory;
|
|
.super Ljava/lang/Object;
|
|
.source "FragmentLayoutInflaterFactory.java"
|
|
|
|
# interfaces
|
|
.implements Landroid/view/LayoutInflater$Factory2;
|
|
|
|
|
|
# static fields
|
|
.field public static final TAG:Ljava/lang/String; = "FragmentManager"
|
|
|
|
|
|
# instance fields
|
|
.field public final mFragmentManager:Landroidx/fragment/app/FragmentManager;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroidx/fragment/app/FragmentManager;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Landroidx/fragment/app/FragmentLayoutInflaterFactory;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public onCreateView(Landroid/view/View;Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View;
|
|
.locals 5
|
|
.param p1 # Landroid/view/View;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p4 # Landroid/util/AttributeSet;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
const-class v0, Landroidx/fragment/app/FragmentContainerView;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
new-instance p1, Landroidx/fragment/app/FragmentContainerView;
|
|
|
|
iget-object p2, p0, Landroidx/fragment/app/FragmentLayoutInflaterFactory;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
|
|
|
|
invoke-direct {p1, p3, p4, p2}, Landroidx/fragment/app/FragmentContainerView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Landroidx/fragment/app/FragmentManager;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
const-string v0, "fragment"
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-nez p2, :cond_1
|
|
|
|
return-object v0
|
|
|
|
:cond_1
|
|
const-string p2, "class"
|
|
|
|
invoke-interface {p4, v0, p2}, Landroid/util/AttributeSet;->getAttributeValue(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
sget-object v1, Landroidx/fragment/R$styleable;->Fragment:[I
|
|
|
|
invoke-virtual {p3, p4, v1}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;
|
|
|
|
move-result-object v1
|
|
|
|
if-nez p2, :cond_2
|
|
|
|
sget p2, Landroidx/fragment/R$styleable;->Fragment_android_name:I
|
|
|
|
invoke-virtual {v1, p2}, Landroid/content/res/TypedArray;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
:cond_2
|
|
sget v2, Landroidx/fragment/R$styleable;->Fragment_android_id:I
|
|
|
|
const/4 v3, -0x1
|
|
|
|
invoke-virtual {v1, v2, v3}, Landroid/content/res/TypedArray;->getResourceId(II)I
|
|
|
|
move-result v2
|
|
|
|
sget v4, Landroidx/fragment/R$styleable;->Fragment_android_tag:I
|
|
|
|
invoke-virtual {v1, v4}, Landroid/content/res/TypedArray;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v1}, Landroid/content/res/TypedArray;->recycle()V
|
|
|
|
if-eqz p2, :cond_12
|
|
|
|
invoke-virtual {p3}, Landroid/content/Context;->getClassLoader()Ljava/lang/ClassLoader;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1, p2}, Landroidx/fragment/app/FragmentFactory;->isFragmentClass(Ljava/lang/ClassLoader;Ljava/lang/String;)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_3
|
|
|
|
goto/16 :goto_5
|
|
|
|
:cond_3
|
|
if-eqz p1, :cond_4
|
|
|
|
invoke-virtual {p1}, Landroid/view/View;->getId()I
|
|
|
|
move-result p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
const/4 p1, 0x0
|
|
|
|
:goto_0
|
|
if-ne p1, v3, :cond_6
|
|
|
|
if-ne v2, v3, :cond_6
|
|
|
|
if-eqz v4, :cond_5
|
|
|
|
goto :goto_1
|
|
|
|
:cond_5
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
new-instance p3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-interface {p4}, Landroid/util/AttributeSet;->getPositionDescription()Ljava/lang/String;
|
|
|
|
move-result-object p4
|
|
|
|
invoke-virtual {p3, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p4, ": Must specify unique android:id, android:tag, or have a parent with an id for "
|
|
|
|
invoke-virtual {p3, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p3, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_6
|
|
:goto_1
|
|
if-eq v2, v3, :cond_7
|
|
|
|
iget-object v0, p0, Landroidx/fragment/app/FragmentLayoutInflaterFactory;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
|
|
|
|
invoke-virtual {v0, v2}, Landroidx/fragment/app/FragmentManager;->findFragmentById(I)Landroidx/fragment/app/Fragment;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_7
|
|
if-nez v0, :cond_8
|
|
|
|
if-eqz v4, :cond_8
|
|
|
|
iget-object v0, p0, Landroidx/fragment/app/FragmentLayoutInflaterFactory;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
|
|
|
|
invoke-virtual {v0, v4}, Landroidx/fragment/app/FragmentManager;->findFragmentByTag(Ljava/lang/String;)Landroidx/fragment/app/Fragment;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_8
|
|
if-nez v0, :cond_9
|
|
|
|
if-eq p1, v3, :cond_9
|
|
|
|
iget-object v0, p0, Landroidx/fragment/app/FragmentLayoutInflaterFactory;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
|
|
|
|
invoke-virtual {v0, p1}, Landroidx/fragment/app/FragmentManager;->findFragmentById(I)Landroidx/fragment/app/Fragment;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_9
|
|
const/4 v1, 0x2
|
|
|
|
invoke-static {v1}, Landroidx/fragment/app/FragmentManager;->isLoggingEnabled(I)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_a
|
|
|
|
const-string v1, "onCreateView: id=0x"
|
|
|
|
invoke-static {v1}, Lf/e/b/a/a;->D(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v2}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, " fname="
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, " existing="
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v3, "FragmentManager"
|
|
|
|
invoke-static {v3, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
:cond_a
|
|
const/4 v1, 0x1
|
|
|
|
if-nez v0, :cond_c
|
|
|
|
iget-object v0, p0, Landroidx/fragment/app/FragmentLayoutInflaterFactory;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
|
|
|
|
invoke-virtual {v0}, Landroidx/fragment/app/FragmentManager;->getFragmentFactory()Landroidx/fragment/app/FragmentFactory;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p3}, Landroid/content/Context;->getClassLoader()Ljava/lang/ClassLoader;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-virtual {v0, p3, p2}, Landroidx/fragment/app/FragmentFactory;->instantiate(Ljava/lang/ClassLoader;Ljava/lang/String;)Landroidx/fragment/app/Fragment;
|
|
|
|
move-result-object v0
|
|
|
|
iput-boolean v1, v0, Landroidx/fragment/app/Fragment;->mFromLayout:Z
|
|
|
|
if-eqz v2, :cond_b
|
|
|
|
move p3, v2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_b
|
|
move p3, p1
|
|
|
|
:goto_2
|
|
iput p3, v0, Landroidx/fragment/app/Fragment;->mFragmentId:I
|
|
|
|
iput p1, v0, Landroidx/fragment/app/Fragment;->mContainerId:I
|
|
|
|
iput-object v4, v0, Landroidx/fragment/app/Fragment;->mTag:Ljava/lang/String;
|
|
|
|
iput-boolean v1, v0, Landroidx/fragment/app/Fragment;->mInLayout:Z
|
|
|
|
iget-object p1, p0, Landroidx/fragment/app/FragmentLayoutInflaterFactory;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
|
|
|
|
iput-object p1, v0, Landroidx/fragment/app/Fragment;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
|
|
|
|
iget-object p1, p1, Landroidx/fragment/app/FragmentManager;->mHost:Landroidx/fragment/app/FragmentHostCallback;
|
|
|
|
iput-object p1, v0, Landroidx/fragment/app/Fragment;->mHost:Landroidx/fragment/app/FragmentHostCallback;
|
|
|
|
invoke-virtual {p1}, Landroidx/fragment/app/FragmentHostCallback;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object p3, v0, Landroidx/fragment/app/Fragment;->mSavedFragmentState:Landroid/os/Bundle;
|
|
|
|
invoke-virtual {v0, p1, p4, p3}, Landroidx/fragment/app/Fragment;->onInflate(Landroid/content/Context;Landroid/util/AttributeSet;Landroid/os/Bundle;)V
|
|
|
|
iget-object p1, p0, Landroidx/fragment/app/FragmentLayoutInflaterFactory;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
|
|
|
|
invoke-virtual {p1, v0}, Landroidx/fragment/app/FragmentManager;->addFragment(Landroidx/fragment/app/Fragment;)V
|
|
|
|
iget-object p1, p0, Landroidx/fragment/app/FragmentLayoutInflaterFactory;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
|
|
|
|
invoke-virtual {p1, v0}, Landroidx/fragment/app/FragmentManager;->moveToState(Landroidx/fragment/app/Fragment;)V
|
|
|
|
goto :goto_3
|
|
|
|
:cond_c
|
|
iget-boolean p3, v0, Landroidx/fragment/app/Fragment;->mInLayout:Z
|
|
|
|
if-nez p3, :cond_11
|
|
|
|
iput-boolean v1, v0, Landroidx/fragment/app/Fragment;->mInLayout:Z
|
|
|
|
iget-object p1, p0, Landroidx/fragment/app/FragmentLayoutInflaterFactory;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
|
|
|
|
iget-object p1, p1, Landroidx/fragment/app/FragmentManager;->mHost:Landroidx/fragment/app/FragmentHostCallback;
|
|
|
|
iput-object p1, v0, Landroidx/fragment/app/Fragment;->mHost:Landroidx/fragment/app/FragmentHostCallback;
|
|
|
|
invoke-virtual {p1}, Landroidx/fragment/app/FragmentHostCallback;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object p3, v0, Landroidx/fragment/app/Fragment;->mSavedFragmentState:Landroid/os/Bundle;
|
|
|
|
invoke-virtual {v0, p1, p4, p3}, Landroidx/fragment/app/Fragment;->onInflate(Landroid/content/Context;Landroid/util/AttributeSet;Landroid/os/Bundle;)V
|
|
|
|
:goto_3
|
|
iget-object p1, p0, Landroidx/fragment/app/FragmentLayoutInflaterFactory;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
|
|
|
|
iget p3, p1, Landroidx/fragment/app/FragmentManager;->mCurState:I
|
|
|
|
if-ge p3, v1, :cond_d
|
|
|
|
iget-boolean p3, v0, Landroidx/fragment/app/Fragment;->mFromLayout:Z
|
|
|
|
if-eqz p3, :cond_d
|
|
|
|
invoke-virtual {p1, v0, v1}, Landroidx/fragment/app/FragmentManager;->moveToState(Landroidx/fragment/app/Fragment;I)V
|
|
|
|
goto :goto_4
|
|
|
|
:cond_d
|
|
iget-object p1, p0, Landroidx/fragment/app/FragmentLayoutInflaterFactory;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
|
|
|
|
invoke-virtual {p1, v0}, Landroidx/fragment/app/FragmentManager;->moveToState(Landroidx/fragment/app/Fragment;)V
|
|
|
|
:goto_4
|
|
iget-object p1, v0, Landroidx/fragment/app/Fragment;->mView:Landroid/view/View;
|
|
|
|
if-eqz p1, :cond_10
|
|
|
|
if-eqz v2, :cond_e
|
|
|
|
invoke-virtual {p1, v2}, Landroid/view/View;->setId(I)V
|
|
|
|
:cond_e
|
|
iget-object p1, v0, Landroidx/fragment/app/Fragment;->mView:Landroid/view/View;
|
|
|
|
invoke-virtual {p1}, Landroid/view/View;->getTag()Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
if-nez p1, :cond_f
|
|
|
|
iget-object p1, v0, Landroidx/fragment/app/Fragment;->mView:Landroid/view/View;
|
|
|
|
invoke-virtual {p1, v4}, Landroid/view/View;->setTag(Ljava/lang/Object;)V
|
|
|
|
:cond_f
|
|
iget-object p1, v0, Landroidx/fragment/app/Fragment;->mView:Landroid/view/View;
|
|
|
|
return-object p1
|
|
|
|
:cond_10
|
|
new-instance p1, Ljava/lang/IllegalStateException;
|
|
|
|
const-string p3, "Fragment "
|
|
|
|
const-string p4, " did not create a view."
|
|
|
|
invoke-static {p3, p2, p4}, Lf/e/b/a/a;->q(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_11
|
|
new-instance p3, Ljava/lang/IllegalArgumentException;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-interface {p4}, Landroid/util/AttributeSet;->getPositionDescription()Ljava/lang/String;
|
|
|
|
move-result-object p4
|
|
|
|
invoke-virtual {v0, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p4, ": Duplicate id 0x"
|
|
|
|
invoke-virtual {v0, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-static {v2}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object p4
|
|
|
|
invoke-virtual {v0, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p4, ", tag "
|
|
|
|
invoke-virtual {v0, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p4, ", or parent id 0x"
|
|
|
|
invoke-virtual {v0, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, " with another fragment for "
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p3, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p3
|
|
|
|
:cond_12
|
|
:goto_5
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public onCreateView(Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View;
|
|
.locals 1
|
|
.param p1 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # Landroid/util/AttributeSet;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-virtual {p0, v0, p1, p2, p3}, Landroidx/fragment/app/FragmentLayoutInflaterFactory;->onCreateView(Landroid/view/View;Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|