apkfuckery/com.discord/smali/androidx/lifecycle/ViewModelProviders.smali

188 lines
5.9 KiB
Smali
Raw Normal View History

2019-02-04 20:08:30 +00:00
.class public Landroidx/lifecycle/ViewModelProviders;
.super Ljava/lang/Object;
2019-02-04 20:29:01 +00:00
.source "ViewModelProviders.java"
2019-02-04 20:08:30 +00:00
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/lifecycle/ViewModelProviders$DefaultFactory;
}
.end annotation
# direct methods
.method public constructor <init>()V
.locals 0
.annotation runtime Ljava/lang/Deprecated;
.end annotation
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method private static checkActivity(Landroidx/fragment/app/Fragment;)Landroid/app/Activity;
.locals 1
invoke-virtual {p0}, Landroidx/fragment/app/Fragment;->getActivity()Landroidx/fragment/app/FragmentActivity;
move-result-object p0
if-eqz p0, :cond_0
return-object p0
:cond_0
new-instance p0, Ljava/lang/IllegalStateException;
const-string v0, "Can\'t create ViewModelProvider for detached fragment"
invoke-direct {p0, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method private static checkApplication(Landroid/app/Activity;)Landroid/app/Application;
.locals 1
invoke-virtual {p0}, Landroid/app/Activity;->getApplication()Landroid/app/Application;
move-result-object p0
if-eqz p0, :cond_0
return-object p0
:cond_0
new-instance p0, Ljava/lang/IllegalStateException;
const-string v0, "Your activity/fragment is not yet attached to Application. You can\'t request ViewModel before onCreate call."
invoke-direct {p0, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method public static of(Landroidx/fragment/app/Fragment;)Landroidx/lifecycle/ViewModelProvider;
.locals 1
.param p0 # Landroidx/fragment/app/Fragment;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/MainThread;
.end annotation
.annotation build Landroidx/annotation/NonNull;
.end annotation
const/4 v0, 0x0
invoke-static {p0, v0}, Landroidx/lifecycle/ViewModelProviders;->of(Landroidx/fragment/app/Fragment;Landroidx/lifecycle/ViewModelProvider$Factory;)Landroidx/lifecycle/ViewModelProvider;
move-result-object p0
return-object p0
.end method
.method public static of(Landroidx/fragment/app/Fragment;Landroidx/lifecycle/ViewModelProvider$Factory;)Landroidx/lifecycle/ViewModelProvider;
.locals 1
.param p0 # Landroidx/fragment/app/Fragment;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Landroidx/lifecycle/ViewModelProvider$Factory;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.annotation build Landroidx/annotation/MainThread;
.end annotation
.annotation build Landroidx/annotation/NonNull;
.end annotation
invoke-static {p0}, Landroidx/lifecycle/ViewModelProviders;->checkActivity(Landroidx/fragment/app/Fragment;)Landroid/app/Activity;
move-result-object v0
invoke-static {v0}, Landroidx/lifecycle/ViewModelProviders;->checkApplication(Landroid/app/Activity;)Landroid/app/Application;
move-result-object v0
if-nez p1, :cond_0
invoke-static {v0}, Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;->getInstance(Landroid/app/Application;)Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;
move-result-object p1
:cond_0
new-instance v0, Landroidx/lifecycle/ViewModelProvider;
invoke-virtual {p0}, Landroidx/fragment/app/Fragment;->getViewModelStore()Landroidx/lifecycle/ViewModelStore;
move-result-object p0
invoke-direct {v0, p0, p1}, Landroidx/lifecycle/ViewModelProvider;-><init>(Landroidx/lifecycle/ViewModelStore;Landroidx/lifecycle/ViewModelProvider$Factory;)V
return-object v0
.end method
.method public static of(Landroidx/fragment/app/FragmentActivity;)Landroidx/lifecycle/ViewModelProvider;
.locals 1
.param p0 # Landroidx/fragment/app/FragmentActivity;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/MainThread;
.end annotation
.annotation build Landroidx/annotation/NonNull;
.end annotation
const/4 v0, 0x0
invoke-static {p0, v0}, Landroidx/lifecycle/ViewModelProviders;->of(Landroidx/fragment/app/FragmentActivity;Landroidx/lifecycle/ViewModelProvider$Factory;)Landroidx/lifecycle/ViewModelProvider;
move-result-object p0
return-object p0
.end method
.method public static of(Landroidx/fragment/app/FragmentActivity;Landroidx/lifecycle/ViewModelProvider$Factory;)Landroidx/lifecycle/ViewModelProvider;
.locals 1
.param p0 # Landroidx/fragment/app/FragmentActivity;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Landroidx/lifecycle/ViewModelProvider$Factory;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.annotation build Landroidx/annotation/MainThread;
.end annotation
.annotation build Landroidx/annotation/NonNull;
.end annotation
invoke-static {p0}, Landroidx/lifecycle/ViewModelProviders;->checkApplication(Landroid/app/Activity;)Landroid/app/Application;
move-result-object v0
if-nez p1, :cond_0
invoke-static {v0}, Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;->getInstance(Landroid/app/Application;)Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;
move-result-object p1
:cond_0
new-instance v0, Landroidx/lifecycle/ViewModelProvider;
invoke-virtual {p0}, Landroidx/fragment/app/FragmentActivity;->getViewModelStore()Landroidx/lifecycle/ViewModelStore;
move-result-object p0
invoke-direct {v0, p0, p1}, Landroidx/lifecycle/ViewModelProvider;-><init>(Landroidx/lifecycle/ViewModelStore;Landroidx/lifecycle/ViewModelProvider$Factory;)V
return-object v0
.end method