2019-07-24 11:27:29 +00:00
|
|
|
.class public Landroidx/lifecycle/ViewModelProviders;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "ViewModelProviders.java"
|
|
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public static checkActivity(Landroidx/fragment/app/Fragment;)Landroid/app/Activity;
|
2019-07-24 11:27:29 +00:00
|
|
|
.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
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public static checkApplication(Landroid/app/Activity;)Landroid/app/Application;
|
2019-07-24 11:27:29 +00:00
|
|
|
.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
|
2019-12-06 03:29:40 +00:00
|
|
|
.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
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
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
|
2019-12-06 03:29:40 +00:00
|
|
|
.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
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
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
|
2019-12-06 03:29:40 +00:00
|
|
|
.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
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
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
|
2019-12-06 03:29:40 +00:00
|
|
|
.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
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
invoke-virtual {p0}, Landroidx/activity/ComponentActivity;->getViewModelStore()Landroidx/lifecycle/ViewModelStore;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
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
|