apkfuckery/com.discord/smali/androidx/legacy/app/FragmentPagerAdapter.smali
2019-02-04 21:08:30 +01:00

335 lines
9.7 KiB
Smali

.class public abstract Landroidx/legacy/app/FragmentPagerAdapter;
.super Landroidx/viewpager/widget/PagerAdapter;
# annotations
.annotation runtime Ljava/lang/Deprecated;
.end annotation
# static fields
.field private static final DEBUG:Z = false
.field private static final TAG:Ljava/lang/String; = "FragmentPagerAdapter"
# instance fields
.field private mCurTransaction:Landroid/app/FragmentTransaction;
.field private mCurrentPrimaryItem:Landroid/app/Fragment;
.field private final mFragmentManager:Landroid/app/FragmentManager;
# direct methods
.method public constructor <init>(Landroid/app/FragmentManager;)V
.locals 1
.annotation runtime Ljava/lang/Deprecated;
.end annotation
invoke-direct {p0}, Landroidx/viewpager/widget/PagerAdapter;-><init>()V
const/4 v0, 0x0
iput-object v0, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurTransaction:Landroid/app/FragmentTransaction;
iput-object v0, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurrentPrimaryItem:Landroid/app/Fragment;
iput-object p1, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mFragmentManager:Landroid/app/FragmentManager;
return-void
.end method
.method private static makeFragmentName(IJ)Ljava/lang/String;
.locals 2
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "android:switcher:"
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string p0, ":"
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
return-object p0
.end method
# virtual methods
.method public destroyItem(Landroid/view/ViewGroup;ILjava/lang/Object;)V
.locals 0
.annotation runtime Ljava/lang/Deprecated;
.end annotation
iget-object p1, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurTransaction:Landroid/app/FragmentTransaction;
if-nez p1, :cond_0
iget-object p1, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mFragmentManager:Landroid/app/FragmentManager;
invoke-virtual {p1}, Landroid/app/FragmentManager;->beginTransaction()Landroid/app/FragmentTransaction;
move-result-object p1
iput-object p1, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurTransaction:Landroid/app/FragmentTransaction;
:cond_0
iget-object p1, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurTransaction:Landroid/app/FragmentTransaction;
check-cast p3, Landroid/app/Fragment;
invoke-virtual {p1, p3}, Landroid/app/FragmentTransaction;->detach(Landroid/app/Fragment;)Landroid/app/FragmentTransaction;
return-void
.end method
.method public finishUpdate(Landroid/view/ViewGroup;)V
.locals 0
.annotation runtime Ljava/lang/Deprecated;
.end annotation
iget-object p1, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurTransaction:Landroid/app/FragmentTransaction;
if-eqz p1, :cond_0
iget-object p1, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurTransaction:Landroid/app/FragmentTransaction;
invoke-virtual {p1}, Landroid/app/FragmentTransaction;->commitAllowingStateLoss()I
const/4 p1, 0x0
iput-object p1, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurTransaction:Landroid/app/FragmentTransaction;
iget-object p1, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mFragmentManager:Landroid/app/FragmentManager;
invoke-virtual {p1}, Landroid/app/FragmentManager;->executePendingTransactions()Z
:cond_0
return-void
.end method
.method public abstract getItem(I)Landroid/app/Fragment;
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.end method
.method public getItemId(I)J
.locals 2
.annotation runtime Ljava/lang/Deprecated;
.end annotation
int-to-long v0, p1
return-wide v0
.end method
.method public instantiateItem(Landroid/view/ViewGroup;I)Ljava/lang/Object;
.locals 4
.annotation runtime Ljava/lang/Deprecated;
.end annotation
iget-object v0, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurTransaction:Landroid/app/FragmentTransaction;
if-nez v0, :cond_0
iget-object v0, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mFragmentManager:Landroid/app/FragmentManager;
invoke-virtual {v0}, Landroid/app/FragmentManager;->beginTransaction()Landroid/app/FragmentTransaction;
move-result-object v0
iput-object v0, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurTransaction:Landroid/app/FragmentTransaction;
:cond_0
invoke-virtual {p0, p2}, Landroidx/legacy/app/FragmentPagerAdapter;->getItemId(I)J
move-result-wide v0
invoke-virtual {p1}, Landroid/view/ViewGroup;->getId()I
move-result v2
invoke-static {v2, v0, v1}, Landroidx/legacy/app/FragmentPagerAdapter;->makeFragmentName(IJ)Ljava/lang/String;
move-result-object v2
iget-object v3, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mFragmentManager:Landroid/app/FragmentManager;
invoke-virtual {v3, v2}, Landroid/app/FragmentManager;->findFragmentByTag(Ljava/lang/String;)Landroid/app/Fragment;
move-result-object v2
if-eqz v2, :cond_1
iget-object p1, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurTransaction:Landroid/app/FragmentTransaction;
invoke-virtual {p1, v2}, Landroid/app/FragmentTransaction;->attach(Landroid/app/Fragment;)Landroid/app/FragmentTransaction;
goto :goto_0
:cond_1
invoke-virtual {p0, p2}, Landroidx/legacy/app/FragmentPagerAdapter;->getItem(I)Landroid/app/Fragment;
move-result-object v2
iget-object p2, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurTransaction:Landroid/app/FragmentTransaction;
invoke-virtual {p1}, Landroid/view/ViewGroup;->getId()I
move-result v3
invoke-virtual {p1}, Landroid/view/ViewGroup;->getId()I
move-result p1
invoke-static {p1, v0, v1}, Landroidx/legacy/app/FragmentPagerAdapter;->makeFragmentName(IJ)Ljava/lang/String;
move-result-object p1
invoke-virtual {p2, v3, v2, p1}, Landroid/app/FragmentTransaction;->add(ILandroid/app/Fragment;Ljava/lang/String;)Landroid/app/FragmentTransaction;
:goto_0
iget-object p1, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurrentPrimaryItem:Landroid/app/Fragment;
if-eq v2, p1, :cond_2
const/4 p1, 0x0
invoke-virtual {v2, p1}, Landroid/app/Fragment;->setMenuVisibility(Z)V
invoke-static {v2, p1}, Landroidx/legacy/app/FragmentCompat;->setUserVisibleHint(Landroid/app/Fragment;Z)V
:cond_2
return-object v2
.end method
.method public isViewFromObject(Landroid/view/View;Ljava/lang/Object;)Z
.locals 0
.annotation runtime Ljava/lang/Deprecated;
.end annotation
check-cast p2, Landroid/app/Fragment;
invoke-virtual {p2}, Landroid/app/Fragment;->getView()Landroid/view/View;
move-result-object p2
if-ne p2, p1, :cond_0
const/4 p1, 0x1
return p1
:cond_0
const/4 p1, 0x0
return p1
.end method
.method public restoreState(Landroid/os/Parcelable;Ljava/lang/ClassLoader;)V
.locals 0
.annotation runtime Ljava/lang/Deprecated;
.end annotation
return-void
.end method
.method public saveState()Landroid/os/Parcelable;
.locals 1
.annotation runtime Ljava/lang/Deprecated;
.end annotation
const/4 v0, 0x0
return-object v0
.end method
.method public setPrimaryItem(Landroid/view/ViewGroup;ILjava/lang/Object;)V
.locals 0
.annotation runtime Ljava/lang/Deprecated;
.end annotation
check-cast p3, Landroid/app/Fragment;
iget-object p1, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurrentPrimaryItem:Landroid/app/Fragment;
if-eq p3, p1, :cond_2
iget-object p1, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurrentPrimaryItem:Landroid/app/Fragment;
if-eqz p1, :cond_0
iget-object p1, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurrentPrimaryItem:Landroid/app/Fragment;
const/4 p2, 0x0
invoke-virtual {p1, p2}, Landroid/app/Fragment;->setMenuVisibility(Z)V
iget-object p1, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurrentPrimaryItem:Landroid/app/Fragment;
invoke-static {p1, p2}, Landroidx/legacy/app/FragmentCompat;->setUserVisibleHint(Landroid/app/Fragment;Z)V
:cond_0
if-eqz p3, :cond_1
const/4 p1, 0x1
invoke-virtual {p3, p1}, Landroid/app/Fragment;->setMenuVisibility(Z)V
invoke-static {p3, p1}, Landroidx/legacy/app/FragmentCompat;->setUserVisibleHint(Landroid/app/Fragment;Z)V
:cond_1
iput-object p3, p0, Landroidx/legacy/app/FragmentPagerAdapter;->mCurrentPrimaryItem:Landroid/app/Fragment;
:cond_2
return-void
.end method
.method public startUpdate(Landroid/view/ViewGroup;)V
.locals 2
.annotation runtime Ljava/lang/Deprecated;
.end annotation
invoke-virtual {p1}, Landroid/view/ViewGroup;->getId()I
move-result p1
const/4 v0, -0x1
if-eq p1, v0, :cond_0
return-void
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "ViewPager with adapter "
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string v1, " requires a view id"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method