.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$FragmentEventDispatcher;, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer;, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentTransactionCallback;, Landroidx/viewpager2/adapter/FragmentStateAdapter$ExperimentalFragmentStateAdapterApi;, Landroidx/viewpager2/adapter/FragmentStateAdapter$DataSetChangeObserver; } .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 private static final GRACE_WINDOW_TIME_MS:J = 0x2710L .field private static final KEY_PREFIX_FRAGMENT:Ljava/lang/String; = "f#" .field private static final KEY_PREFIX_STATE:Ljava/lang/String; = "s#" # instance fields .field mFragmentEventDispatcher:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher; .field final mFragmentManager:Landroidx/fragment/app/FragmentManager; .field private mFragmentMaxLifecycleEnforcer:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer; .field final mFragments:Landroidx/collection/LongSparseArray; .annotation system Ldalvik/annotation/Signature; value = { "Landroidx/collection/LongSparseArray<", "Landroidx/fragment/app/Fragment;", ">;" } .end annotation .end field .field private mHasStaleFragments:Z .field mIsInGracePeriod:Z .field private final mItemIdToViewHolder:Landroidx/collection/LongSparseArray; .annotation system Ldalvik/annotation/Signature; value = { "Landroidx/collection/LongSparseArray<", "Ljava/lang/Integer;", ">;" } .end annotation .end field .field final mLifecycle:Landroidx/lifecycle/Lifecycle; .field private 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 (Landroidx/fragment/app/Fragment;)V .locals 1 .line 122 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;->(Landroidx/fragment/app/FragmentManager;Landroidx/lifecycle/Lifecycle;)V return-void .end method .method public constructor (Landroidx/fragment/app/FragmentActivity;)V .locals 1 .line 112 invoke-virtual {p1}, Landroidx/fragment/app/FragmentActivity;->getSupportFragmentManager()Landroidx/fragment/app/FragmentManager; move-result-object v0 invoke-virtual {p1}, Landroidx/fragment/app/FragmentActivity;->getLifecycle()Landroidx/lifecycle/Lifecycle; move-result-object p1 invoke-direct {p0, v0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->(Landroidx/fragment/app/FragmentManager;Landroidx/lifecycle/Lifecycle;)V return-void .end method .method public constructor (Landroidx/fragment/app/FragmentManager;Landroidx/lifecycle/Lifecycle;)V .locals 1 .line 133 invoke-direct {p0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->()V .line 89 new-instance v0, Landroidx/collection/LongSparseArray; invoke-direct {v0}, Landroidx/collection/LongSparseArray;->()V iput-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray; .line 91 new-instance v0, Landroidx/collection/LongSparseArray; invoke-direct {v0}, Landroidx/collection/LongSparseArray;->()V iput-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mSavedStates:Landroidx/collection/LongSparseArray; .line 92 new-instance v0, Landroidx/collection/LongSparseArray; invoke-direct {v0}, Landroidx/collection/LongSparseArray;->()V iput-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mItemIdToViewHolder:Landroidx/collection/LongSparseArray; .line 96 new-instance v0, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher; invoke-direct {v0}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher;->()V iput-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentEventDispatcher:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher; 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 .line 136 invoke-super {p0, p1}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->setHasStableIds(Z)V return-void .end method .method private static createKey(Ljava/lang/String;J)Ljava/lang/String; .locals 1 .line 617 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 return-object p0 .end method .method private ensureFragment(I)V .locals 3 .line 263 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; .line 264 invoke-virtual {v2, v0, v1}, Landroidx/collection/LongSparseArray;->containsKey(J)Z move-result v2 if-nez v2, :cond_0 .line 266 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; .line 267 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 p0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray; .line 268 invoke-virtual {p0, 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; .line 231 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 p0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray; .line 235 invoke-virtual {p0, p1, p2}, Landroidx/collection/LongSparseArray;->get(J)Ljava/lang/Object; move-result-object p0 check-cast p0, Landroidx/fragment/app/Fragment; const/4 p1, 0x0 if-nez p0, :cond_1 return p1 .line 240 :cond_1 invoke-virtual {p0}, Landroidx/fragment/app/Fragment;->getView()Landroid/view/View; move-result-object p0 if-nez p0, :cond_2 return p1 .line 245 :cond_2 invoke-virtual {p0}, Landroid/view/View;->getParent()Landroid/view/ViewParent; move-result-object p0 if-eqz p0, :cond_3 goto :goto_0 :cond_3 move v1, p1 :goto_0 return v1 .end method .method private static isValidKey(Ljava/lang/String;Ljava/lang/String;)Z .locals 1 .line 622 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; .line 250 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; .line 251 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; .line 256 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 .line 253 :cond_0 new-instance p0, Ljava/lang/IllegalStateException; const-string p1, "Design assumption violated: a ViewHolder can only be bound to one item at a time." invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p0 :cond_1 :goto_1 add-int/lit8 v1, v1, 0x1 goto :goto_0 :cond_2 return-object v0 .end method .method private static parseIdFromKey(Ljava/lang/String;Ljava/lang/String;)J .locals 0 .line 627 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 4 iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray; .line 439 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 .line 445 :cond_0 invoke-virtual {v0}, Landroidx/fragment/app/Fragment;->getView()Landroid/view/View; move-result-object v1 if-eqz v1, :cond_1 .line 446 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 .line 448 check-cast v1, Landroid/widget/FrameLayout; invoke-virtual {v1}, Landroid/widget/FrameLayout;->removeAllViews()V .line 452 :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; .line 453 invoke-virtual {v1, p1, p2}, Landroidx/collection/LongSparseArray;->remove(J)V .line 456 :cond_2 invoke-virtual {v0}, Landroidx/fragment/app/Fragment;->isAdded()Z move-result v1 if-nez v1, :cond_3 iget-object p0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray; .line 457 invoke-virtual {p0, p1, p2}, Landroidx/collection/LongSparseArray;->remove(J)V return-void .line 461 :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 .line 466 :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;->mFragmentEventDispatcher:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher; .line 468 invoke-virtual {v1, v0}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher;->dispatchPreSavedInstanceState(Landroidx/fragment/app/Fragment;)Ljava/util/List; move-result-object v1 iget-object v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentManager:Landroidx/fragment/app/FragmentManager; .line 469 invoke-virtual {v2, v0}, Landroidx/fragment/app/FragmentManager;->saveFragmentInstanceState(Landroidx/fragment/app/Fragment;)Landroidx/fragment/app/Fragment$SavedState; move-result-object v2 iget-object v3, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentEventDispatcher:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher; .line 470 invoke-virtual {v3, v1}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher;->dispatchPostEvents(Ljava/util/List;)V iget-object v1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mSavedStates:Landroidx/collection/LongSparseArray; .line 472 invoke-virtual {v1, p1, p2, v2}, Landroidx/collection/LongSparseArray;->put(JLjava/lang/Object;)V :cond_5 iget-object v1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentEventDispatcher:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher; .line 475 invoke-virtual {v1, v0}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher;->dispatchPreRemoved(Landroidx/fragment/app/Fragment;)Ljava/util/List; move-result-object v1 :try_start_0 iget-object v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentManager:Landroidx/fragment/app/FragmentManager; .line 477 invoke-virtual {v2}, Landroidx/fragment/app/FragmentManager;->beginTransaction()Landroidx/fragment/app/FragmentTransaction; move-result-object v2 invoke-virtual {v2, 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; .line 478 invoke-virtual {v0, p1, p2}, Landroidx/collection/LongSparseArray;->remove(J)V :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 iget-object p0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentEventDispatcher:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher; .line 480 invoke-virtual {p0, v1}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher;->dispatchPostEvents(Ljava/util/List;)V return-void :catchall_0 move-exception p1 iget-object p0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentEventDispatcher:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher; invoke-virtual {p0, v1}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher;->dispatchPostEvents(Ljava/util/List;)V .line 481 throw p1 .end method .method private scheduleGracePeriodEnd()V .locals 4 .line 592 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;->(Landroid/os/Looper;)V .line 593 new-instance v1, Landroidx/viewpager2/adapter/FragmentStateAdapter$3; invoke-direct {v1, p0}, Landroidx/viewpager2/adapter/FragmentStateAdapter$3;->(Landroidx/viewpager2/adapter/FragmentStateAdapter;)V iget-object v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mLifecycle:Landroidx/lifecycle/Lifecycle; .line 601 new-instance v3, Landroidx/viewpager2/adapter/FragmentStateAdapter$4; invoke-direct {v3, p0, v0, v1}, Landroidx/viewpager2/adapter/FragmentStateAdapter$4;->(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 .line 612 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 iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentManager:Landroidx/fragment/app/FragmentManager; .line 373 new-instance v1, Landroidx/viewpager2/adapter/FragmentStateAdapter$2; invoke-direct {v1, p0, p1, p2}, Landroidx/viewpager2/adapter/FragmentStateAdapter$2;->(Landroidx/viewpager2/adapter/FragmentStateAdapter;Landroidx/fragment/app/Fragment;Landroid/widget/FrameLayout;)V const/4 p0, 0x0 invoke-virtual {v0, v1, p0}, Landroidx/fragment/app/FragmentManager;->registerFragmentLifecycleCallbacks(Landroidx/fragment/app/FragmentManager$FragmentLifecycleCallbacks;Z)V return-void .end method # virtual methods .method addViewToContainer(Landroid/view/View;Landroid/widget/FrameLayout;)V .locals 1 .line 391 invoke-virtual {p2}, Landroid/widget/FrameLayout;->getChildCount()I move-result p0 const/4 v0, 0x1 if-gt p0, v0, :cond_3 .line 395 invoke-virtual {p1}, Landroid/view/View;->getParent()Landroid/view/ViewParent; move-result-object p0 if-ne p0, p2, :cond_0 return-void .line 399 :cond_0 invoke-virtual {p2}, Landroid/widget/FrameLayout;->getChildCount()I move-result p0 if-lez p0, :cond_1 .line 400 invoke-virtual {p2}, Landroid/widget/FrameLayout;->removeAllViews()V .line 403 :cond_1 invoke-virtual {p1}, Landroid/view/View;->getParent()Landroid/view/ViewParent; move-result-object p0 if-eqz p0, :cond_2 .line 404 invoke-virtual {p1}, Landroid/view/View;->getParent()Landroid/view/ViewParent; move-result-object p0 check-cast p0, Landroid/view/ViewGroup; invoke-virtual {p0, p1}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V .line 407 :cond_2 invoke-virtual {p2, p1}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V return-void .line 392 :cond_3 new-instance p0, Ljava/lang/IllegalStateException; const-string p1, "Design assumption violated." invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p0 .end method .method public containsItem(J)Z .locals 2 const-wide/16 v0, 0x0 cmp-long v0, p1, v0 if-ltz v0, :cond_0 .line 512 invoke-virtual {p0}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->getItemCount()I move-result p0 int-to-long v0, p0 cmp-long p0, p1, v0 if-gez p0, :cond_0 const/4 p0, 0x1 goto :goto_0 :cond_0 const/4 p0, 0x0 :goto_0 return p0 .end method .method public abstract createFragment(I)Landroidx/fragment/app/Fragment; .end method .method gcFragments()V .locals 6 iget-boolean v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mHasStaleFragments:Z if-eqz v0, :cond_5 .line 199 invoke-virtual {p0}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->shouldDelayFragmentTransactions()Z move-result v0 if-eqz v0, :cond_0 goto :goto_3 .line 204 :cond_0 new-instance v0, Landroidx/collection/ArraySet; invoke-direct {v0}, Landroidx/collection/ArraySet;->()V const/4 v1, 0x0 move v2, v1 :goto_0 iget-object v3, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray; .line 205 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; .line 206 invoke-virtual {v3, v2}, Landroidx/collection/LongSparseArray;->keyAt(I)J move-result-wide v3 .line 207 invoke-virtual {p0, v3, v4}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->containsItem(J)Z move-result v5 if-nez v5, :cond_1 .line 208 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; .line 209 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; .line 217 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; .line 218 invoke-virtual {v2, v1}, Landroidx/collection/LongSparseArray;->keyAt(I)J move-result-wide v2 .line 219 invoke-direct {p0, v2, v3}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->isFragmentViewBound(J)Z move-result v4 if-nez v4, :cond_3 .line 220 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 .line 225 :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; .line 226 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 0 int-to-long p0, p1 return-wide p0 .end method .method public onAttachedToRecyclerView(Landroidx/recyclerview/widget/RecyclerView;)V .locals 1 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 .line 142 :goto_0 invoke-static {v0}, Landroidx/core/util/Preconditions;->checkArgument(Z)V .line 143 new-instance v0, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer; invoke-direct {v0, p0}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer;->(Landroidx/viewpager2/adapter/FragmentStateAdapter;)V iput-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentMaxLifecycleEnforcer:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer; .line 144 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 .line 74 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 .line 176 invoke-virtual {p1}, Landroidx/viewpager2/adapter/FragmentViewHolder;->getItemId()J move-result-wide v0 .line 177 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 .line 178 invoke-direct {p0, v2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->itemForViewHolder(I)Ljava/lang/Long; move-result-object v3 if-eqz v3, :cond_0 .line 179 invoke-virtual {v3}, Ljava/lang/Long;->longValue()J move-result-wide v4 cmp-long v4, v4, v0 if-eqz v4, :cond_0 .line 180 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; .line 181 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; .line 184 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 .line 185 invoke-direct {p0, p2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->ensureFragment(I)V .line 189 invoke-virtual {p1}, Landroidx/viewpager2/adapter/FragmentViewHolder;->getContainer()Landroid/widget/FrameLayout; move-result-object p2 .line 190 invoke-static {p2}, Landroidx/core/view/ViewCompat;->isAttachedToWindow(Landroid/view/View;)Z move-result p2 if-eqz p2, :cond_1 .line 191 invoke-virtual {p0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->placeFragmentInViewHolder(Landroidx/viewpager2/adapter/FragmentViewHolder;)V .line 194 :cond_1 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 .line 74 invoke-virtual {p0, p1, p2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->onCreateViewHolder(Landroid/view/ViewGroup;I)Landroidx/viewpager2/adapter/FragmentViewHolder; move-result-object p0 return-object p0 .end method .method public final onCreateViewHolder(Landroid/view/ViewGroup;I)Landroidx/viewpager2/adapter/FragmentViewHolder; .locals 0 .line 171 invoke-static {p1}, Landroidx/viewpager2/adapter/FragmentViewHolder;->create(Landroid/view/ViewGroup;)Landroidx/viewpager2/adapter/FragmentViewHolder; move-result-object p0 return-object p0 .end method .method public onDetachedFromRecyclerView(Landroidx/recyclerview/widget/RecyclerView;)V .locals 1 iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentMaxLifecycleEnforcer:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer; .line 150 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 .line 74 check-cast p1, Landroidx/viewpager2/adapter/FragmentViewHolder; invoke-virtual {p0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->onFailedToRecycleView(Landroidx/viewpager2/adapter/FragmentViewHolder;)Z move-result p0 return p0 .end method .method public final onFailedToRecycleView(Landroidx/viewpager2/adapter/FragmentViewHolder;)Z .locals 0 const/4 p0, 0x1 return p0 .end method .method public bridge synthetic onViewAttachedToWindow(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;)V .locals 0 .line 74 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 .line 274 invoke-virtual {p0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->placeFragmentInViewHolder(Landroidx/viewpager2/adapter/FragmentViewHolder;)V .line 275 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 .line 74 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 2 .line 412 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 .line 413 invoke-direct {p0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->itemForViewHolder(I)Ljava/lang/Long; move-result-object p1 if-eqz p1, :cond_0 .line 415 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 p0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mItemIdToViewHolder:Landroidx/collection/LongSparseArray; .line 416 invoke-virtual {p1}, Ljava/lang/Long;->longValue()J move-result-wide v0 invoke-virtual {p0, v0, v1}, Landroidx/collection/LongSparseArray;->remove(J)V :cond_0 return-void .end method .method placeFragmentInViewHolder(Landroidx/viewpager2/adapter/FragmentViewHolder;)V .locals 8 const-string v0, "f" iget-object v1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray; .line 283 invoke-virtual {p1}, Landroidx/viewpager2/adapter/FragmentViewHolder;->getItemId()J move-result-wide v2 invoke-virtual {v1, v2, v3}, Landroidx/collection/LongSparseArray;->get(J)Ljava/lang/Object; move-result-object v1 check-cast v1, Landroidx/fragment/app/Fragment; const-string v2, "Design assumption violated." if-eqz v1, :cond_8 .line 287 invoke-virtual {p1}, Landroidx/viewpager2/adapter/FragmentViewHolder;->getContainer()Landroid/widget/FrameLayout; move-result-object v3 .line 288 invoke-virtual {v1}, Landroidx/fragment/app/Fragment;->getView()Landroid/view/View; move-result-object v4 .line 309 invoke-virtual {v1}, Landroidx/fragment/app/Fragment;->isAdded()Z move-result v5 if-nez v5, :cond_1 if-nez v4, :cond_0 goto :goto_0 .line 310 :cond_0 new-instance p0, Ljava/lang/IllegalStateException; invoke-direct {p0, v2}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p0 .line 314 :cond_1 :goto_0 invoke-virtual {v1}, Landroidx/fragment/app/Fragment;->isAdded()Z move-result v2 if-eqz v2, :cond_2 if-nez v4, :cond_2 .line 315 invoke-direct {p0, v1, v3}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->scheduleViewAttach(Landroidx/fragment/app/Fragment;Landroid/widget/FrameLayout;)V return-void .line 320 :cond_2 invoke-virtual {v1}, Landroidx/fragment/app/Fragment;->isAdded()Z move-result v2 if-eqz v2, :cond_4 invoke-virtual {v4}, Landroid/view/View;->getParent()Landroid/view/ViewParent; move-result-object v2 if-eqz v2, :cond_4 .line 321 invoke-virtual {v4}, Landroid/view/View;->getParent()Landroid/view/ViewParent; move-result-object p1 if-eq p1, v3, :cond_3 .line 322 invoke-virtual {p0, v4, v3}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->addViewToContainer(Landroid/view/View;Landroid/widget/FrameLayout;)V :cond_3 return-void .line 328 :cond_4 invoke-virtual {v1}, Landroidx/fragment/app/Fragment;->isAdded()Z move-result v2 if-eqz v2, :cond_5 .line 329 invoke-virtual {p0, v4, v3}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->addViewToContainer(Landroid/view/View;Landroid/widget/FrameLayout;)V return-void .line 334 :cond_5 invoke-virtual {p0}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->shouldDelayFragmentTransactions()Z move-result v2 if-nez v2, :cond_6 .line 335 invoke-direct {p0, v1, v3}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->scheduleViewAttach(Landroidx/fragment/app/Fragment;Landroid/widget/FrameLayout;)V iget-object v2, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentEventDispatcher:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher; .line 337 invoke-virtual {v2, v1}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher;->dispatchPreAdded(Landroidx/fragment/app/Fragment;)Ljava/util/List; move-result-object v2 const/4 v3, 0x0 .line 339 :try_start_0 invoke-virtual {v1, v3}, Landroidx/fragment/app/Fragment;->setMenuVisibility(Z)V iget-object v4, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentManager:Landroidx/fragment/app/FragmentManager; .line 340 invoke-virtual {v4}, Landroidx/fragment/app/FragmentManager;->beginTransaction()Landroidx/fragment/app/FragmentTransaction; move-result-object v4 new-instance v5, Ljava/lang/StringBuilder; invoke-direct {v5, v0}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V .line 341 invoke-virtual {p1}, Landroidx/viewpager2/adapter/FragmentViewHolder;->getItemId()J move-result-wide v6 invoke-virtual {v5, v6, v7}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder; move-result-object p1 invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p1 invoke-virtual {v4, v1, p1}, Landroidx/fragment/app/FragmentTransaction;->add(Landroidx/fragment/app/Fragment;Ljava/lang/String;)Landroidx/fragment/app/FragmentTransaction; move-result-object p1 sget-object v0, Landroidx/lifecycle/Lifecycle$State;->STARTED:Landroidx/lifecycle/Lifecycle$State; .line 342 invoke-virtual {p1, v1, v0}, Landroidx/fragment/app/FragmentTransaction;->setMaxLifecycle(Landroidx/fragment/app/Fragment;Landroidx/lifecycle/Lifecycle$State;)Landroidx/fragment/app/FragmentTransaction; move-result-object p1 .line 343 invoke-virtual {p1}, Landroidx/fragment/app/FragmentTransaction;->commitNow()V iget-object p1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentMaxLifecycleEnforcer:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer; .line 344 invoke-virtual {p1, v3}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentMaxLifecycleEnforcer;->updateFragmentMaxLifecycle(Z)V :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 iget-object p0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentEventDispatcher:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher; .line 346 invoke-virtual {p0, v2}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher;->dispatchPostEvents(Ljava/util/List;)V goto :goto_1 :catchall_0 move-exception p1 iget-object p0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentEventDispatcher:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher; invoke-virtual {p0, v2}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher;->dispatchPostEvents(Ljava/util/List;)V .line 347 throw p1 :cond_6 iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentManager:Landroidx/fragment/app/FragmentManager; .line 349 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; .line 352 new-instance v1, Landroidx/viewpager2/adapter/FragmentStateAdapter$1; invoke-direct {v1, p0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter$1;->(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 .line 285 :cond_8 new-instance p0, Ljava/lang/IllegalStateException; invoke-direct {p0, v2}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p0 .end method .method public registerFragmentTransactionCallback(Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentTransactionCallback;)V .locals 0 iget-object p0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentEventDispatcher:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher; .line 931 invoke-virtual {p0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher;->registerCallback(Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentTransactionCallback;)V return-void .end method .method public final restoreState(Landroid/os/Parcelable;)V .locals 5 iget-object v0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mSavedStates:Landroidx/collection/LongSparseArray; .line 552 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 .line 557 check-cast p1, Landroid/os/Bundle; .line 558 invoke-virtual {p1}, Landroid/os/Bundle;->getClassLoader()Ljava/lang/ClassLoader; move-result-object v0 if-nez v0, :cond_0 .line 560 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 .line 563 :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#" .line 564 invoke-static {v1, v2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->isValidKey(Ljava/lang/String;Ljava/lang/String;)Z move-result v3 if-eqz v3, :cond_2 .line 565 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; .line 566 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; .line 567 invoke-virtual {v4, v2, v3, v1}, Landroidx/collection/LongSparseArray;->put(JLjava/lang/Object;)V goto :goto_0 :cond_2 const-string v2, "s#" .line 571 invoke-static {v1, v2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->isValidKey(Ljava/lang/String;Ljava/lang/String;)Z move-result v3 if-eqz v3, :cond_3 .line 572 invoke-static {v1, v2}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->parseIdFromKey(Ljava/lang/String;Ljava/lang/String;)J move-result-wide v2 .line 573 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; .line 574 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; .line 575 invoke-virtual {v4, v2, v3, v1}, Landroidx/collection/LongSparseArray;->put(JLjava/lang/Object;)V goto :goto_0 .line 580 :cond_3 new-instance p0, Ljava/lang/IllegalArgumentException; new-instance p1, Ljava/lang/StringBuilder; const-string v0, "Unexpected key in savedState: " invoke-direct {p1, v0}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {p1, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p1 invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V throw p0 :cond_4 iget-object p1, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray; .line 583 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 .line 586 invoke-virtual {p0}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->gcFragments()V .line 587 invoke-direct {p0}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->scheduleGracePeriodEnd()V :cond_5 return-void .line 553 :cond_6 new-instance p0, Ljava/lang/IllegalStateException; const-string p1, "Expected the adapter to be \'fresh\' while restoring state." invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p0 .end method .method public final saveState()Landroid/os/Parcelable; .locals 7 .line 525 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 v1, v2 invoke-direct {v0, v1}, Landroid/os/Bundle;->(I)V const/4 v1, 0x0 move v2, v1 :goto_0 iget-object v3, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragments:Landroidx/collection/LongSparseArray; .line 528 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; .line 529 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; .line 530 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 .line 531 invoke-virtual {v5}, Landroidx/fragment/app/Fragment;->isAdded()Z move-result v6 if-eqz v6, :cond_0 const-string v6, "f#" .line 532 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; .line 533 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; .line 538 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; .line 539 invoke-virtual {v2, v1}, Landroidx/collection/LongSparseArray;->keyAt(I)J move-result-wide v2 .line 540 invoke-virtual {p0, v2, v3}, Landroidx/viewpager2/adapter/FragmentStateAdapter;->containsItem(J)Z move-result v4 if-eqz v4, :cond_2 const-string v4, "s#" .line 541 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; .line 542 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 0 .line 517 new-instance p0, Ljava/lang/UnsupportedOperationException; const-string p1, "Stable Ids are required for the adapter to function properly, and the adapter takes care of setting the flag." invoke-direct {p0, p1}, Ljava/lang/UnsupportedOperationException;->(Ljava/lang/String;)V throw p0 .end method .method shouldDelayFragmentTransactions()Z .locals 0 iget-object p0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentManager:Landroidx/fragment/app/FragmentManager; .line 486 invoke-virtual {p0}, Landroidx/fragment/app/FragmentManager;->isStateSaved()Z move-result p0 return p0 .end method .method public unregisterFragmentTransactionCallback(Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentTransactionCallback;)V .locals 0 iget-object p0, p0, Landroidx/viewpager2/adapter/FragmentStateAdapter;->mFragmentEventDispatcher:Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher; .line 942 invoke-virtual {p0, p1}, Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentEventDispatcher;->unregisterCallback(Landroidx/viewpager2/adapter/FragmentStateAdapter$FragmentTransactionCallback;)V return-void .end method