294 lines
11 KiB
Smali
294 lines
11 KiB
Smali
.class public final Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory;
|
|
.super Ljava/lang/Object;
|
|
.source "SettingsPremiumViewModel.kt"
|
|
|
|
# interfaces
|
|
.implements Landroidx/lifecycle/ViewModelProvider$Factory;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "Factory"
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$getSubscriptionsAndInvoicePreview(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory;Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;)Lrx/Observable;
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory;->getSubscriptionsAndInvoicePreview(Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;)Lrx/Observable;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private final getSubscriptionsAndInvoicePreview(Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;)Lrx/Observable;
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;",
|
|
")",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionAndInvoice;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
instance-of v0, p1, Lcom/discord/stores/StoreSubscriptions$SubscriptionsState$Loaded;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
move-object v0, p1
|
|
|
|
check-cast v0, Lcom/discord/stores/StoreSubscriptions$SubscriptionsState$Loaded;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreSubscriptions$SubscriptionsState$Loaded;->getSubscriptions()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lt/q/l;->firstOrNull(Ljava/util/List;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/discord/models/domain/ModelSubscription;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelSubscription;->getId()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
sget-object v2, Lcom/discord/utilities/rest/RestAPI;->Companion:Lcom/discord/utilities/rest/RestAPI$Companion;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/utilities/rest/RestAPI$Companion;->getApi()Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
move-result-object v2
|
|
|
|
new-instance v3, Lcom/discord/restapi/RestAPIParams$InvoicePreviewBody;
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x1
|
|
|
|
invoke-direct {v3, v0, v5, v4}, Lcom/discord/restapi/RestAPIParams$InvoicePreviewBody;-><init>(Ljava/lang/String;ZZ)V
|
|
|
|
invoke-virtual {v2, v3}, Lcom/discord/utilities/rest/RestAPI;->getInvoicePreview(Lcom/discord/restapi/RestAPIParams$InvoicePreviewBody;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0, v4, v5, v1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory$getSubscriptionsAndInvoicePreview$1;
|
|
|
|
invoke-direct {v1, p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory$getSubscriptionsAndInvoicePreview$1;-><init>(Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;)V
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->f(Lb0/l/i;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory$getSubscriptionsAndInvoicePreview$2;
|
|
|
|
invoke-direct {v1, p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory$getSubscriptionsAndInvoicePreview$2;-><init>(Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;)V
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->g(Lb0/l/i;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "RestAPI\n .a\u2026ch.Error)\n }"
|
|
|
|
invoke-static {p1, v0}, Lt/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
new-instance v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionAndInvoice;
|
|
|
|
new-instance v2, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch$Invoice;
|
|
|
|
invoke-direct {v2, v1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch$Invoice;-><init>(Lcom/discord/models/domain/billing/ModelInvoicePreview;)V
|
|
|
|
invoke-direct {v0, p1, v2}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionAndInvoice;-><init>(Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch;)V
|
|
|
|
new-instance p1, Lb0/m/e/j;
|
|
|
|
invoke-direct {p1, v0}, Lb0/m/e/j;-><init>(Ljava/lang/Object;)V
|
|
|
|
const-string v0, "Observable.just(\n \u2026ce(null))\n )"
|
|
|
|
invoke-static {p1, v0}, Lt/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_1
|
|
sget-object p1, Lb0/m/a/g;->e:Lrx/Observable;
|
|
|
|
const-string v0, "Observable.never()"
|
|
|
|
invoke-static {p1, v0}, Lt/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private final observeStores(Lcom/discord/stores/StorePaymentSources;Lcom/discord/stores/StoreSubscriptions;Lcom/discord/stores/StoreEntitlements;Lcom/discord/stores/StorePremiumGuildSubscription;)Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lcom/discord/stores/StorePaymentSources;",
|
|
"Lcom/discord/stores/StoreSubscriptions;",
|
|
"Lcom/discord/stores/StoreEntitlements;",
|
|
"Lcom/discord/stores/StorePremiumGuildSubscription;",
|
|
")",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p1}, Lcom/discord/stores/StorePaymentSources;->getPaymentSources()Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p2}, Lcom/discord/stores/StoreSubscriptions;->getSubscriptions()Lrx/Observable;
|
|
|
|
move-result-object p2
|
|
|
|
new-instance v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory$observeStores$1;
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory$observeStores$1;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory;)V
|
|
|
|
invoke-virtual {p2, v0}, Lrx/Observable;->k(Lb0/l/i;)Lrx/Observable;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p3}, Lcom/discord/stores/StoreEntitlements;->getEntitlementState()Lrx/Observable;
|
|
|
|
move-result-object p3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-static {p4, v0, v1, v0}, Lcom/discord/stores/StorePremiumGuildSubscription;->getPremiumGuildSubscriptionsState$default(Lcom/discord/stores/StorePremiumGuildSubscription;Ljava/lang/Long;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object p4
|
|
|
|
sget-object v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory$observeStores$2;->INSTANCE:Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory$observeStores$2;
|
|
|
|
invoke-static {p1, p2, p3, p4, v0}, Lrx/Observable;->a(Lrx/Observable;Lrx/Observable;Lrx/Observable;Lrx/Observable;Lrx/functions/Func4;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "Observable\n .co\u2026 )\n }"
|
|
|
|
invoke-static {p1, p2}, Lt/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public create(Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;
|
|
.locals 8
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Landroidx/lifecycle/ViewModel;",
|
|
">(",
|
|
"Ljava/lang/Class<",
|
|
"TT;>;)TT;"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
new-instance p1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getPaymentSources()Lcom/discord/stores/StorePaymentSources;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getSubscriptions()Lcom/discord/stores/StoreSubscriptions;
|
|
|
|
move-result-object v2
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getEntitlements()Lcom/discord/stores/StoreEntitlements;
|
|
|
|
move-result-object v3
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getPremiumGuildSubscriptions()Lcom/discord/stores/StorePremiumGuildSubscription;
|
|
|
|
move-result-object v4
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getPaymentSources()Lcom/discord/stores/StorePaymentSources;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v5, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v5}, Lcom/discord/stores/StoreStream$Companion;->getSubscriptions()Lcom/discord/stores/StoreSubscriptions;
|
|
|
|
move-result-object v5
|
|
|
|
sget-object v6, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v6}, Lcom/discord/stores/StoreStream$Companion;->getEntitlements()Lcom/discord/stores/StoreEntitlements;
|
|
|
|
move-result-object v6
|
|
|
|
sget-object v7, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v7}, Lcom/discord/stores/StoreStream$Companion;->getPremiumGuildSubscriptions()Lcom/discord/stores/StorePremiumGuildSubscription;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-direct {p0, v0, v5, v6, v7}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory;->observeStores(Lcom/discord/stores/StorePaymentSources;Lcom/discord/stores/StoreSubscriptions;Lcom/discord/stores/StoreEntitlements;Lcom/discord/stores/StorePremiumGuildSubscription;)Lrx/Observable;
|
|
|
|
move-result-object v5
|
|
|
|
move-object v0, p1
|
|
|
|
invoke-direct/range {v0 .. v5}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;-><init>(Lcom/discord/stores/StorePaymentSources;Lcom/discord/stores/StoreSubscriptions;Lcom/discord/stores/StoreEntitlements;Lcom/discord/stores/StorePremiumGuildSubscription;Lrx/Observable;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
const-string p1, "modelClass"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|