apkfuckery/com.discord/smali/androidx/viewpager2/adapter/FragmentStateAdapter.smali
2020-05-11 21:22:21 +02:00

1599 lines
48 KiB
Smali

.class public abstract Landroidx/viewpager2/adapter/FragmentStateAdapter;
.super Landroidx/recyclerview/widget/RecyclerView$Adapter;
.source "FragmentStateAdapter.java"
# interfaces
.implements Landroidx/viewpager2/adapter/StatefulAdapter;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/viewpager2/adapter/FragmentStateAdapter$DataSetChangeObserver;,
Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer;
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroidx/recyclerview/widget/RecyclerView$Adapter<",
"Landroidx/viewpager2/adapter/FragmentViewHolder;",
">;",
"Landroidx/viewpager2/adapter/StatefulAdapter;"
}
.end annotation
# static fields
.field public static final GRACE_WINDOW_TIME_MS:J = 0x2710L
.field public static final KEY_PREFIX_FRAGMENT:Ljava/lang/String; = "f#"
.field public static final KEY_PREFIX_STATE:Ljava/lang/String; = "s#"
# instance fields
.field public final mFragmentManager:Landroidx/fragment/app/FragmentManager;
.field public mFragmentMaxLifecycleEnforcer:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer;
.field public final mFragments:Landroidx/collection/LongSparseArray;
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroidx/collection/LongSparseArray<",
"Landroidx/fragment/app/Fragment;",
">;"
}
.end annotation
.end field
.field public mHasStaleFragments:Z
.field public mIsInGracePeriod:Z
.field public final mItemIdToViewHolder:Landroidx/collection/LongSparseArray;
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroidx/collection/LongSparseArray<",
"Ljava/lang/Integer;",
">;"
}
.end annotation
.end field
.field public final mLifecycle:Landroidx/lifecycle/Lifecycle;
.field public final mSavedStates:Landroidx/collection/LongSparseArray;
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroidx/collection/LongSparseArray<",
"Landroidx/fragment/app/Fragment$SavedState;",
">;"
}
.end annotation
.end field
# direct methods
.method public constructor <init>(Landroidx/fragment/app/Fragment;)V
.locals 1
.param p1 # Landroidx/fragment/app/Fragment;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
invoke-virtual {p1}, Landroidx/fragment/app/Fragment;->getChildFragmentManager()Landroidx/fragment/app/FragmentManager;
move-result-object v0
invoke-virtual {p1}, Landroidx/fragment/app/Fragment;->getLifecycle()Landroidx/lifecycle/Lifecycle;
move-result-object p1
invoke-direct {p0, v0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter;-><init>(Landroidx/fragment/app/FragmentManager;Landroidx/lifecycle/Lifecycle;)V
return-void
.end method
.method public constructor <init>(Landroidx/fragment/app/FragmentActivity;)V
.locals 1
.param p1 # Landroidx/fragment/app/FragmentActivity;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
invoke-virtual {p1}, Landroidx/fragment/app/FragmentActivity;->getSupportFragmentManager()Landroidx/fragment/app/FragmentManager;
move-result-object v0
invoke-virtual {p1}, Landroidx/activity/ComponentActivity;->getLifecycle()Landroidx/lifecycle/Lifecycle;
move-result-object p1
invoke-direct {p0, v0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter;-><init>(Landroidx/fragment/app/FragmentManager;Landroidx/lifecycle/Lifecycle;)V
return-void
.end method
.method public constructor <init>(Landroidx/fragment/app/FragmentManager;Landroidx/lifecycle/Lifecycle;)V
.locals 1
.param p1 # Landroidx/fragment/app/FragmentManager;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroidx/lifecycle/Lifecycle;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
invoke-direct {p0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;-><init>()V
new-instance v0, Landroidx/collection/LongSparseArray;
invoke-direct {v0}, Landroidx/collection/LongSparseArray;-><init>()V
iput-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
new-instance v0, Landroidx/collection/LongSparseArray;
invoke-direct {v0}, Landroidx/collection/LongSparseArray;-><init>()V
iput-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mSavedStates:Landroidx/collection/LongSparseArray;
new-instance v0, Landroidx/collection/LongSparseArray;
invoke-direct {v0}, Landroidx/collection/LongSparseArray;-><init>()V
iput-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mItemIdToViewHolder:Landroidx/collection/LongSparseArray;
const/4 v0, 0x0
iput-boolean v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mIsInGracePeriod:Z
iput-boolean v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mHasStaleFragments:Z
iput-object p1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
iput-object p2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mLifecycle:Landroidx/lifecycle/Lifecycle;
const/4 p1, 0x1
invoke-super {p0, p1}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->setHasStableIds(Z)V
return-void
.end method
.method public static createKey(Ljava/lang/String;J)Ljava/lang/String;
.locals 0
.param p0 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/NonNull;
.end annotation
invoke-static {p0, p1, p2}, Lf/e/b/a/a;->a(Ljava/lang/String;J)Ljava/lang/String;
move-result-object p0
return-object p0
.end method
.method private ensureFragment(I)V
.locals 3
invoke-virtual {p0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->getItemId(I)J
move-result-wide v0
iget-object v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {v2, v0, v1}, Landroidx/collection/LongSparseArray;->containsKey(J)Z
move-result v2
if-nez v2, :cond_0
invoke-virtual {p0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->createFragment(I)Landroidx/fragment/app/Fragment;
move-result-object p1
iget-object v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mSavedStates:Landroidx/collection/LongSparseArray;
invoke-virtual {v2, v0, v1}, Landroidx/collection/LongSparseArray;->get(J)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroidx/fragment/app/Fragment$SavedState;
invoke-virtual {p1, v2}, Landroidx/fragment/app/Fragment;->setInitialSavedState(Landroidx/fragment/app/Fragment$SavedState;)V
iget-object v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {v2, v0, v1, p1}, Landroidx/collection/LongSparseArray;->put(JLjava/lang/Object;)V
:cond_0
return-void
.end method
.method private isFragmentViewBound(J)Z
.locals 2
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mItemIdToViewHolder:Landroidx/collection/LongSparseArray;
invoke-virtual {v0, p1, p2}, Landroidx/collection/LongSparseArray;->containsKey(J)Z
move-result v0
const/4 v1, 0x1
if-eqz v0, :cond_0
return v1
:cond_0
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {v0, p1, p2}, Landroidx/collection/LongSparseArray;->get(J)Ljava/lang/Object;
move-result-object p1
check-cast p1, Landroidx/fragment/app/Fragment;
const/4 p2, 0x0
if-nez p1, :cond_1
return p2
:cond_1
invoke-virtual {p1}, Landroidx/fragment/app/Fragment;->getView()Landroid/view/View;
move-result-object p1
if-nez p1, :cond_2
return p2
:cond_2
invoke-virtual {p1}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
move-result-object p1
if-eqz p1, :cond_3
const/4 p2, 0x1
:cond_3
return p2
.end method
.method public static isValidKey(Ljava/lang/String;Ljava/lang/String;)Z
.locals 1
.param p0 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
invoke-virtual {p0, p1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_0
invoke-virtual {p0}, Ljava/lang/String;->length()I
move-result p0
invoke-virtual {p1}, Ljava/lang/String;->length()I
move-result p1
if-le p0, p1, :cond_0
const/4 p0, 0x1
goto :goto_0
:cond_0
const/4 p0, 0x0
:goto_0
return p0
.end method
.method private itemForViewHolder(I)Ljava/lang/Long;
.locals 4
const/4 v0, 0x0
const/4 v1, 0x0
:goto_0
iget-object v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mItemIdToViewHolder:Landroidx/collection/LongSparseArray;
invoke-virtual {v2}, Landroidx/collection/LongSparseArray;->size()I
move-result v2
if-ge v1, v2, :cond_2
iget-object v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mItemIdToViewHolder:Landroidx/collection/LongSparseArray;
invoke-virtual {v2, v1}, Landroidx/collection/LongSparseArray;->valueAt(I)Ljava/lang/Object;
move-result-object v2
check-cast v2, Ljava/lang/Integer;
invoke-virtual {v2}, Ljava/lang/Integer;->intValue()I
move-result v2
if-ne v2, p1, :cond_1
if-nez v0, :cond_0
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mItemIdToViewHolder:Landroidx/collection/LongSparseArray;
invoke-virtual {v0, v1}, Landroidx/collection/LongSparseArray;->keyAt(I)J
move-result-wide v2
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v0
goto :goto_1
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string v0, "Design assumption violated: a ViewHolder can only be bound to one item at a time."
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
:cond_1
:goto_1
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_2
return-object v0
.end method
.method public static parseIdFromKey(Ljava/lang/String;Ljava/lang/String;)J
.locals 0
.param p0 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
invoke-virtual {p1}, Ljava/lang/String;->length()I
move-result p1
invoke-virtual {p0, p1}, Ljava/lang/String;->substring(I)Ljava/lang/String;
move-result-object p0
invoke-static {p0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
move-result-wide p0
return-wide p0
.end method
.method private removeFragment(J)V
.locals 3
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {v0, p1, p2}, Landroidx/collection/LongSparseArray;->get(J)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroidx/fragment/app/Fragment;
if-nez v0, :cond_0
return-void
:cond_0
invoke-virtual {v0}, Landroidx/fragment/app/Fragment;->getView()Landroid/view/View;
move-result-object v1
if-eqz v1, :cond_1
invoke-virtual {v0}, Landroidx/fragment/app/Fragment;->getView()Landroid/view/View;
move-result-object v1
invoke-virtual {v1}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
move-result-object v1
if-eqz v1, :cond_1
check-cast v1, Landroid/widget/FrameLayout;
invoke-virtual {v1}, Landroid/widget/FrameLayout;->removeAllViews()V
:cond_1
invoke-virtual {p0, p1, p2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->containsItem(J)Z
move-result v1
if-nez v1, :cond_2
iget-object v1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mSavedStates:Landroidx/collection/LongSparseArray;
invoke-virtual {v1, p1, p2}, Landroidx/collection/LongSparseArray;->remove(J)V
:cond_2
invoke-virtual {v0}, Landroidx/fragment/app/Fragment;->isAdded()Z
move-result v1
if-nez v1, :cond_3
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {v0, p1, p2}, Landroidx/collection/LongSparseArray;->remove(J)V
return-void
:cond_3
invoke-virtual {p0}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->shouldDelayFragmentTransactions()Z
move-result v1
if-eqz v1, :cond_4
const/4 p1, 0x1
iput-boolean p1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mHasStaleFragments:Z
return-void
:cond_4
invoke-virtual {v0}, Landroidx/fragment/app/Fragment;->isAdded()Z
move-result v1
if-eqz v1, :cond_5
invoke-virtual {p0, p1, p2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->containsItem(J)Z
move-result v1
if-eqz v1, :cond_5
iget-object v1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mSavedStates:Landroidx/collection/LongSparseArray;
iget-object v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
invoke-virtual {v2, v0}, Landroidx/fragment/app/FragmentManager;->saveFragmentInstanceState(Landroidx/fragment/app/Fragment;)Landroidx/fragment/app/Fragment$SavedState;
move-result-object v2
invoke-virtual {v1, p1, p2, v2}, Landroidx/collection/LongSparseArray;->put(JLjava/lang/Object;)V
:cond_5
iget-object v1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
invoke-virtual {v1}, Landroidx/fragment/app/FragmentManager;->beginTransaction()Landroidx/fragment/app/FragmentTransaction;
move-result-object v1
invoke-virtual {v1, v0}, Landroidx/fragment/app/FragmentTransaction;->remove(Landroidx/fragment/app/Fragment;)Landroidx/fragment/app/FragmentTransaction;
move-result-object v0
invoke-virtual {v0}, Landroidx/fragment/app/FragmentTransaction;->commitNow()V
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {v0, p1, p2}, Landroidx/collection/LongSparseArray;->remove(J)V
return-void
.end method
.method private scheduleGracePeriodEnd()V
.locals 4
new-instance v0, Landroid/os/Handler;
invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;
move-result-object v1
invoke-direct {v0, v1}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V
new-instance v1, Landroidx/viewpager2/adapter/FragmentStateAdapter$4;
invoke-direct {v1, p0}, Landroidx/viewpager2/adapter/FragmentStateAdapter$4;-><init>(Landroidx/viewpager2/adapter/FragmentStateAdapter;)V
iget-object v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mLifecycle:Landroidx/lifecycle/Lifecycle;
new-instance v3, Landroidx/viewpager2/adapter/FragmentStateAdapter$5;
invoke-direct {v3, p0, v0, v1}, Landroidx/viewpager2/adapter/FragmentStateAdapter$5;-><init>(Landroidx/viewpager2/adapter/FragmentStateAdapter;Landroid/os/Handler;Ljava/lang/Runnable;)V
invoke-virtual {v2, v3}, Landroidx/lifecycle/Lifecycle;->addObserver(Landroidx/lifecycle/LifecycleObserver;)V
const-wide/16 v2, 0x2710
invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
return-void
.end method
.method private scheduleViewAttach(Landroidx/fragment/app/Fragment;Landroid/widget/FrameLayout;)V
.locals 2
.param p2 # Landroid/widget/FrameLayout;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
new-instance v1, Landroidx/viewpager2/adapter/FragmentStateAdapter$3;
invoke-direct {v1, p0, p1, p2}, Landroidx/viewpager2/adapter/FragmentStateAdapter$3;-><init>(Landroidx/viewpager2/adapter/FragmentStateAdapter;Landroidx/fragment/app/Fragment;Landroid/widget/FrameLayout;)V
const/4 p1, 0x0
invoke-virtual {v0, v1, p1}, Landroidx/fragment/app/FragmentManager;->registerFragmentLifecycleCallbacks(Landroidx/fragment/app/FragmentManager$FragmentLifecycleCallbacks;Z)V
return-void
.end method
# virtual methods
.method public addViewToContainer(Landroid/view/View;Landroid/widget/FrameLayout;)V
.locals 2
.param p1 # Landroid/view/View;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroid/widget/FrameLayout;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
invoke-virtual {p2}, Landroid/widget/FrameLayout;->getChildCount()I
move-result v0
const/4 v1, 0x1
if-gt v0, v1, :cond_3
invoke-virtual {p1}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
move-result-object v0
if-ne v0, p2, :cond_0
return-void
:cond_0
invoke-virtual {p2}, Landroid/widget/FrameLayout;->getChildCount()I
move-result v0
if-lez v0, :cond_1
invoke-virtual {p2}, Landroid/widget/FrameLayout;->removeAllViews()V
:cond_1
invoke-virtual {p1}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
move-result-object v0
if-eqz v0, :cond_2
invoke-virtual {p1}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
move-result-object v0
check-cast v0, Landroid/view/ViewGroup;
invoke-virtual {v0, p1}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V
:cond_2
invoke-virtual {p2, p1}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V
return-void
:cond_3
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "Design assumption violated."
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public containsItem(J)Z
.locals 3
const-wide/16 v0, 0x0
cmp-long v2, p1, v0
if-ltz v2, :cond_0
invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->getItemCount()I
move-result v0
int-to-long v0, v0
cmp-long v2, p1, v0
if-gez v2, :cond_0
const/4 p1, 0x1
goto :goto_0
:cond_0
const/4 p1, 0x0
:goto_0
return p1
.end method
.method public abstract createFragment(I)Landroidx/fragment/app/Fragment;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end method
.method public gcFragments()V
.locals 6
iget-boolean v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mHasStaleFragments:Z
if-eqz v0, :cond_5
invoke-virtual {p0}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->shouldDelayFragmentTransactions()Z
move-result v0
if-eqz v0, :cond_0
goto :goto_3
:cond_0
new-instance v0, Landroidx/collection/ArraySet;
invoke-direct {v0}, Landroidx/collection/ArraySet;-><init>()V
const/4 v1, 0x0
const/4 v2, 0x0
:goto_0
iget-object v3, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {v3}, Landroidx/collection/LongSparseArray;->size()I
move-result v3
if-ge v2, v3, :cond_2
iget-object v3, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {v3, v2}, Landroidx/collection/LongSparseArray;->keyAt(I)J
move-result-wide v3
invoke-virtual {p0, v3, v4}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->containsItem(J)Z
move-result v5
if-nez v5, :cond_1
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v5
invoke-interface {v0, v5}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
iget-object v5, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mItemIdToViewHolder:Landroidx/collection/LongSparseArray;
invoke-virtual {v5, v3, v4}, Landroidx/collection/LongSparseArray;->remove(J)V
:cond_1
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_2
iget-boolean v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mIsInGracePeriod:Z
if-nez v2, :cond_4
iput-boolean v1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mHasStaleFragments:Z
:goto_1
iget-object v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {v2}, Landroidx/collection/LongSparseArray;->size()I
move-result v2
if-ge v1, v2, :cond_4
iget-object v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {v2, v1}, Landroidx/collection/LongSparseArray;->keyAt(I)J
move-result-wide v2
invoke-direct {p0, v2, v3}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->isFragmentViewBound(J)Z
move-result v4
if-nez v4, :cond_3
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v2
invoke-interface {v0, v2}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
:cond_3
add-int/lit8 v1, v1, 0x1
goto :goto_1
:cond_4
invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object v0
:goto_2
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_5
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Ljava/lang/Long;
invoke-virtual {v1}, Ljava/lang/Long;->longValue()J
move-result-wide v1
invoke-direct {p0, v1, v2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->removeFragment(J)V
goto :goto_2
:cond_5
:goto_3
return-void
.end method
.method public getItemId(I)J
.locals 2
int-to-long v0, p1
return-wide v0
.end method
.method public onAttachedToRecyclerView(Landroidx/recyclerview/widget/RecyclerView;)V
.locals 1
.param p1 # Landroidx/recyclerview/widget/RecyclerView;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/CallSuper;
.end annotation
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentMaxLifecycleEnforcer:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer;
if-nez v0, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
invoke-static {v0}, Landroidx/core/util/Preconditions;->checkArgument(Z)V
new-instance v0, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer;
invoke-direct {v0, p0}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer;-><init>(Landroidx/viewpager2/adapter/FragmentStateAdapter;)V
iput-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentMaxLifecycleEnforcer:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer;
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentMaxLifecycleEnforcer:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer;
invoke-virtual {v0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer;->register(Landroidx/recyclerview/widget/RecyclerView;)V
return-void
.end method
.method public bridge synthetic onBindViewHolder(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)V
.locals 0
.param p1 # Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
check-cast p1, Landroidx/viewpager2/adapter/FragmentViewHolder;
invoke-virtual {p0, p1, p2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->onBindViewHolder(Landroidx/viewpager2/adapter/FragmentViewHolder;I)V
return-void
.end method
.method public final onBindViewHolder(Landroidx/viewpager2/adapter/FragmentViewHolder;I)V
.locals 7
.param p1 # Landroidx/viewpager2/adapter/FragmentViewHolder;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->getItemId()J
move-result-wide v0
invoke-virtual {p1}, Landroidx/viewpager2/adapter/FragmentViewHolder;->getContainer()Landroid/widget/FrameLayout;
move-result-object v2
invoke-virtual {v2}, Landroid/widget/FrameLayout;->getId()I
move-result v2
invoke-direct {p0, v2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->itemForViewHolder(I)Ljava/lang/Long;
move-result-object v3
if-eqz v3, :cond_0
invoke-virtual {v3}, Ljava/lang/Long;->longValue()J
move-result-wide v4
cmp-long v6, v4, v0
if-eqz v6, :cond_0
invoke-virtual {v3}, Ljava/lang/Long;->longValue()J
move-result-wide v4
invoke-direct {p0, v4, v5}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->removeFragment(J)V
iget-object v4, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mItemIdToViewHolder:Landroidx/collection/LongSparseArray;
invoke-virtual {v3}, Ljava/lang/Long;->longValue()J
move-result-wide v5
invoke-virtual {v4, v5, v6}, Landroidx/collection/LongSparseArray;->remove(J)V
:cond_0
iget-object v3, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mItemIdToViewHolder:Landroidx/collection/LongSparseArray;
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
invoke-virtual {v3, v0, v1, v2}, Landroidx/collection/LongSparseArray;->put(JLjava/lang/Object;)V
invoke-direct {p0, p2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->ensureFragment(I)V
invoke-virtual {p1}, Landroidx/viewpager2/adapter/FragmentViewHolder;->getContainer()Landroid/widget/FrameLayout;
move-result-object p2
invoke-static {p2}, Landroidx/core/view/ViewCompat;->isAttachedToWindow(Landroid/view/View;)Z
move-result v0
if-eqz v0, :cond_2
invoke-virtual {p2}, Landroid/widget/FrameLayout;->getParent()Landroid/view/ViewParent;
move-result-object v0
if-nez v0, :cond_1
new-instance v0, Landroidx/viewpager2/adapter/FragmentStateAdapter$1;
invoke-direct {v0, p0, p2, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter$1;-><init>(Landroidx/viewpager2/adapter/FragmentStateAdapter;Landroid/widget/FrameLayout;Landroidx/viewpager2/adapter/FragmentViewHolder;)V
invoke-virtual {p2, v0}, Landroid/widget/FrameLayout;->addOnLayoutChangeListener(Landroid/view/View$OnLayoutChangeListener;)V
goto :goto_0
:cond_1
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "Design assumption violated."
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
:cond_2
:goto_0
invoke-virtual {p0}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->gcFragments()V
return-void
.end method
.method public bridge synthetic onCreateViewHolder(Landroid/view/ViewGroup;I)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
.locals 0
.param p1 # Landroid/view/ViewGroup;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/NonNull;
.end annotation
invoke-virtual {p0, p1, p2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->onCreateViewHolder(Landroid/view/ViewGroup;I)Landroidx/viewpager2/adapter/FragmentViewHolder;
move-result-object p1
return-object p1
.end method
.method public final onCreateViewHolder(Landroid/view/ViewGroup;I)Landroidx/viewpager2/adapter/FragmentViewHolder;
.locals 0
.param p1 # Landroid/view/ViewGroup;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/NonNull;
.end annotation
invoke-static {p1}, Landroidx/viewpager2/adapter/FragmentViewHolder;->create(Landroid/view/ViewGroup;)Landroidx/viewpager2/adapter/FragmentViewHolder;
move-result-object p1
return-object p1
.end method
.method public onDetachedFromRecyclerView(Landroidx/recyclerview/widget/RecyclerView;)V
.locals 1
.param p1 # Landroidx/recyclerview/widget/RecyclerView;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/CallSuper;
.end annotation
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentMaxLifecycleEnforcer:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer;
invoke-virtual {v0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer;->unregister(Landroidx/recyclerview/widget/RecyclerView;)V
const/4 p1, 0x0
iput-object p1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentMaxLifecycleEnforcer:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer;
return-void
.end method
.method public bridge synthetic onFailedToRecycleView(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;)Z
.locals 0
.param p1 # Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
check-cast p1, Landroidx/viewpager2/adapter/FragmentViewHolder;
invoke-virtual {p0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->onFailedToRecycleView(Landroidx/viewpager2/adapter/FragmentViewHolder;)Z
move-result p1
return p1
.end method
.method public final onFailedToRecycleView(Landroidx/viewpager2/adapter/FragmentViewHolder;)Z
.locals 0
.param p1 # Landroidx/viewpager2/adapter/FragmentViewHolder;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
const/4 p1, 0x1
return p1
.end method
.method public bridge synthetic onViewAttachedToWindow(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;)V
.locals 0
.param p1 # Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
check-cast p1, Landroidx/viewpager2/adapter/FragmentViewHolder;
invoke-virtual {p0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->onViewAttachedToWindow(Landroidx/viewpager2/adapter/FragmentViewHolder;)V
return-void
.end method
.method public final onViewAttachedToWindow(Landroidx/viewpager2/adapter/FragmentViewHolder;)V
.locals 0
.param p1 # Landroidx/viewpager2/adapter/FragmentViewHolder;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
invoke-virtual {p0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->placeFragmentInViewHolder(Landroidx/viewpager2/adapter/FragmentViewHolder;)V
invoke-virtual {p0}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->gcFragments()V
return-void
.end method
.method public bridge synthetic onViewRecycled(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;)V
.locals 0
.param p1 # Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
check-cast p1, Landroidx/viewpager2/adapter/FragmentViewHolder;
invoke-virtual {p0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->onViewRecycled(Landroidx/viewpager2/adapter/FragmentViewHolder;)V
return-void
.end method
.method public final onViewRecycled(Landroidx/viewpager2/adapter/FragmentViewHolder;)V
.locals 3
.param p1 # Landroidx/viewpager2/adapter/FragmentViewHolder;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
invoke-virtual {p1}, Landroidx/viewpager2/adapter/FragmentViewHolder;->getContainer()Landroid/widget/FrameLayout;
move-result-object p1
invoke-virtual {p1}, Landroid/widget/FrameLayout;->getId()I
move-result p1
invoke-direct {p0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->itemForViewHolder(I)Ljava/lang/Long;
move-result-object p1
if-eqz p1, :cond_0
invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
move-result-wide v0
invoke-direct {p0, v0, v1}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->removeFragment(J)V
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mItemIdToViewHolder:Landroidx/collection/LongSparseArray;
invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
move-result-wide v1
invoke-virtual {v0, v1, v2}, Landroidx/collection/LongSparseArray;->remove(J)V
:cond_0
return-void
.end method
.method public placeFragmentInViewHolder(Landroidx/viewpager2/adapter/FragmentViewHolder;)V
.locals 5
.param p1 # Landroidx/viewpager2/adapter/FragmentViewHolder;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->getItemId()J
move-result-wide v1
invoke-virtual {v0, v1, v2}, Landroidx/collection/LongSparseArray;->get(J)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroidx/fragment/app/Fragment;
const-string v1, "Design assumption violated."
if-eqz v0, :cond_8
invoke-virtual {p1}, Landroidx/viewpager2/adapter/FragmentViewHolder;->getContainer()Landroid/widget/FrameLayout;
move-result-object v2
invoke-virtual {v0}, Landroidx/fragment/app/Fragment;->getView()Landroid/view/View;
move-result-object v3
invoke-virtual {v0}, Landroidx/fragment/app/Fragment;->isAdded()Z
move-result v4
if-nez v4, :cond_1
if-nez v3, :cond_0
goto :goto_0
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
invoke-direct {p1, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
:cond_1
:goto_0
invoke-virtual {v0}, Landroidx/fragment/app/Fragment;->isAdded()Z
move-result v1
if-eqz v1, :cond_2
if-nez v3, :cond_2
invoke-direct {p0, v0, v2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->scheduleViewAttach(Landroidx/fragment/app/Fragment;Landroid/widget/FrameLayout;)V
return-void
:cond_2
invoke-virtual {v0}, Landroidx/fragment/app/Fragment;->isAdded()Z
move-result v1
if-eqz v1, :cond_4
invoke-virtual {v3}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
move-result-object v1
if-eqz v1, :cond_4
invoke-virtual {v3}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
move-result-object p1
if-eq p1, v2, :cond_3
invoke-virtual {p0, v3, v2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->addViewToContainer(Landroid/view/View;Landroid/widget/FrameLayout;)V
:cond_3
return-void
:cond_4
invoke-virtual {v0}, Landroidx/fragment/app/Fragment;->isAdded()Z
move-result v1
if-eqz v1, :cond_5
invoke-virtual {p0, v3, v2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->addViewToContainer(Landroid/view/View;Landroid/widget/FrameLayout;)V
return-void
:cond_5
invoke-virtual {p0}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->shouldDelayFragmentTransactions()Z
move-result v1
if-nez v1, :cond_6
invoke-direct {p0, v0, v2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->scheduleViewAttach(Landroidx/fragment/app/Fragment;Landroid/widget/FrameLayout;)V
iget-object v1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
invoke-virtual {v1}, Landroidx/fragment/app/FragmentManager;->beginTransaction()Landroidx/fragment/app/FragmentTransaction;
move-result-object v1
const-string v2, "f"
invoke-static {v2}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->getItemId()J
move-result-wide v3
invoke-virtual {v2, v3, v4}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-virtual {v1, v0, p1}, Landroidx/fragment/app/FragmentTransaction;->add(Landroidx/fragment/app/Fragment;Ljava/lang/String;)Landroidx/fragment/app/FragmentTransaction;
move-result-object p1
sget-object v1, Landroidx/lifecycle/Lifecycle$State;->STARTED:Landroidx/lifecycle/Lifecycle$State;
invoke-virtual {p1, v0, v1}, Landroidx/fragment/app/FragmentTransaction;->setMaxLifecycle(Landroidx/fragment/app/Fragment;Landroidx/lifecycle/Lifecycle$State;)Landroidx/fragment/app/FragmentTransaction;
move-result-object p1
invoke-virtual {p1}, Landroidx/fragment/app/FragmentTransaction;->commitNow()V
iget-object p1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentMaxLifecycleEnforcer:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer;
const/4 v0, 0x0
invoke-virtual {p1, v0}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer;->updateFragmentMaxLifecycle(Z)V
goto :goto_1
:cond_6
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
invoke-virtual {v0}, Landroidx/fragment/app/FragmentManager;->isDestroyed()Z
move-result v0
if-eqz v0, :cond_7
return-void
:cond_7
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mLifecycle:Landroidx/lifecycle/Lifecycle;
new-instance v1, Landroidx/viewpager2/adapter/FragmentStateAdapter$2;
invoke-direct {v1, p0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter$2;-><init>(Landroidx/viewpager2/adapter/FragmentStateAdapter;Landroidx/viewpager2/adapter/FragmentViewHolder;)V
invoke-virtual {v0, v1}, Landroidx/lifecycle/Lifecycle;->addObserver(Landroidx/lifecycle/LifecycleObserver;)V
:goto_1
return-void
:cond_8
new-instance p1, Ljava/lang/IllegalStateException;
invoke-direct {p1, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public final restoreState(Landroid/os/Parcelable;)V
.locals 5
.param p1 # Landroid/os/Parcelable;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mSavedStates:Landroidx/collection/LongSparseArray;
invoke-virtual {v0}, Landroidx/collection/LongSparseArray;->isEmpty()Z
move-result v0
if-eqz v0, :cond_6
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {v0}, Landroidx/collection/LongSparseArray;->isEmpty()Z
move-result v0
if-eqz v0, :cond_6
check-cast p1, Landroid/os/Bundle;
invoke-virtual {p1}, Landroid/os/Bundle;->getClassLoader()Ljava/lang/ClassLoader;
move-result-object v0
if-nez v0, :cond_0
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;
move-result-object v0
invoke-virtual {p1, v0}, Landroid/os/Bundle;->setClassLoader(Ljava/lang/ClassLoader;)V
:cond_0
invoke-virtual {p1}, Landroid/os/Bundle;->keySet()Ljava/util/Set;
move-result-object v0
invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object v0
:cond_1
:goto_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_4
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Ljava/lang/String;
const-string v2, "f#"
invoke-static {v1, v2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->isValidKey(Ljava/lang/String;Ljava/lang/String;)Z
move-result v3
if-eqz v3, :cond_2
invoke-static {v1, v2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->parseIdFromKey(Ljava/lang/String;Ljava/lang/String;)J
move-result-wide v2
iget-object v4, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
invoke-virtual {v4, p1, v1}, Landroidx/fragment/app/FragmentManager;->getFragment(Landroid/os/Bundle;Ljava/lang/String;)Landroidx/fragment/app/Fragment;
move-result-object v1
iget-object v4, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {v4, v2, v3, v1}, Landroidx/collection/LongSparseArray;->put(JLjava/lang/Object;)V
goto :goto_0
:cond_2
const-string v2, "s#"
invoke-static {v1, v2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->isValidKey(Ljava/lang/String;Ljava/lang/String;)Z
move-result v3
if-eqz v3, :cond_3
invoke-static {v1, v2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->parseIdFromKey(Ljava/lang/String;Ljava/lang/String;)J
move-result-wide v2
invoke-virtual {p1, v1}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;
move-result-object v1
check-cast v1, Landroidx/fragment/app/Fragment$SavedState;
invoke-virtual {p0, v2, v3}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->containsItem(J)Z
move-result v4
if-eqz v4, :cond_1
iget-object v4, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mSavedStates:Landroidx/collection/LongSparseArray;
invoke-virtual {v4, v2, v3, v1}, Landroidx/collection/LongSparseArray;->put(JLjava/lang/Object;)V
goto :goto_0
:cond_3
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "Unexpected key in savedState: "
invoke-static {v0, v1}, Lf/e/b/a/a;->a(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
:cond_4
iget-object p1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {p1}, Landroidx/collection/LongSparseArray;->isEmpty()Z
move-result p1
if-nez p1, :cond_5
const/4 p1, 0x1
iput-boolean p1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mHasStaleFragments:Z
iput-boolean p1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mIsInGracePeriod:Z
invoke-virtual {p0}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->gcFragments()V
invoke-direct {p0}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->scheduleGracePeriodEnd()V
:cond_5
return-void
:cond_6
new-instance p1, Ljava/lang/IllegalStateException;
const-string v0, "Expected the adapter to be \'fresh\' while restoring state."
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public final saveState()Landroid/os/Parcelable;
.locals 7
.annotation build Landroidx/annotation/NonNull;
.end annotation
new-instance v0, Landroid/os/Bundle;
iget-object v1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {v1}, Landroidx/collection/LongSparseArray;->size()I
move-result v1
iget-object v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mSavedStates:Landroidx/collection/LongSparseArray;
invoke-virtual {v2}, Landroidx/collection/LongSparseArray;->size()I
move-result v2
add-int/2addr v2, v1
invoke-direct {v0, v2}, Landroid/os/Bundle;-><init>(I)V
const/4 v1, 0x0
const/4 v2, 0x0
:goto_0
iget-object v3, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {v3}, Landroidx/collection/LongSparseArray;->size()I
move-result v3
if-ge v2, v3, :cond_1
iget-object v3, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {v3, v2}, Landroidx/collection/LongSparseArray;->keyAt(I)J
move-result-wide v3
iget-object v5, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray;
invoke-virtual {v5, v3, v4}, Landroidx/collection/LongSparseArray;->get(J)Ljava/lang/Object;
move-result-object v5
check-cast v5, Landroidx/fragment/app/Fragment;
if-eqz v5, :cond_0
invoke-virtual {v5}, Landroidx/fragment/app/Fragment;->isAdded()Z
move-result v6
if-eqz v6, :cond_0
const-string v6, "f#"
invoke-static {v6, v3, v4}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->createKey(Ljava/lang/String;J)Ljava/lang/String;
move-result-object v3
iget-object v4, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
invoke-virtual {v4, v0, v3, v5}, Landroidx/fragment/app/FragmentManager;->putFragment(Landroid/os/Bundle;Ljava/lang/String;Landroidx/fragment/app/Fragment;)V
:cond_0
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_1
:goto_1
iget-object v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mSavedStates:Landroidx/collection/LongSparseArray;
invoke-virtual {v2}, Landroidx/collection/LongSparseArray;->size()I
move-result v2
if-ge v1, v2, :cond_3
iget-object v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mSavedStates:Landroidx/collection/LongSparseArray;
invoke-virtual {v2, v1}, Landroidx/collection/LongSparseArray;->keyAt(I)J
move-result-wide v2
invoke-virtual {p0, v2, v3}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->containsItem(J)Z
move-result v4
if-eqz v4, :cond_2
const-string v4, "s#"
invoke-static {v4, v2, v3}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->createKey(Ljava/lang/String;J)Ljava/lang/String;
move-result-object v4
iget-object v5, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mSavedStates:Landroidx/collection/LongSparseArray;
invoke-virtual {v5, v2, v3}, Landroidx/collection/LongSparseArray;->get(J)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroid/os/Parcelable;
invoke-virtual {v0, v4, v2}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V
:cond_2
add-int/lit8 v1, v1, 0x1
goto :goto_1
:cond_3
return-object v0
.end method
.method public final setHasStableIds(Z)V
.locals 1
new-instance p1, Ljava/lang/UnsupportedOperationException;
const-string v0, "Stable Ids are required for the adapter to function properly, and the adapter takes care of setting the flag."
invoke-direct {p1, v0}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public shouldDelayFragmentTransactions()Z
.locals 1
iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentManager:Landroidx/fragment/app/FragmentManager;
invoke-virtual {v0}, Landroidx/fragment/app/FragmentManager;->isStateSaved()Z
move-result v0
return v0
.end method