2020-05-17 12:40:10 +00:00
|
|
|
.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/utilities/rest/RestAPI;Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;)Lrx/Observable;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory;->getSubscriptionsAndInvoicePreview(Lcom/discord/utilities/rest/RestAPI;Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final getSubscriptionsAndInvoicePreview(Lcom/discord/utilities/rest/RestAPI;Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;)Lrx/Observable;
|
|
|
|
.locals 4
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Lcom/discord/utilities/rest/RestAPI;",
|
|
|
|
"Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;",
|
|
|
|
")",
|
|
|
|
"Lrx/Observable<",
|
|
|
|
"Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionAndInvoice;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
instance-of v0, p2, Lcom/discord/stores/StoreSubscriptions$SubscriptionsState$Loaded;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
|
|
|
|
move-object v0, p2
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-static {v0}, Lk0/j/l;->firstOrNull(Ljava/util/List;)Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
new-instance v2, Lcom/discord/restapi/RestAPIParams$InvoicePreviewBody;
|
|
|
|
|
|
|
|
const/4 v3, 0x1
|
|
|
|
|
|
|
|
invoke-direct {v2, v0, v3, v3}, Lcom/discord/restapi/RestAPIParams$InvoicePreviewBody;-><init>(Ljava/lang/String;ZZ)V
|
|
|
|
|
|
|
|
invoke-virtual {p1, v2}, Lcom/discord/utilities/rest/RestAPI;->getInvoicePreview(Lcom/discord/restapi/RestAPIParams$InvoicePreviewBody;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
invoke-static {p1, v0, v3, v1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
new-instance v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory$getSubscriptionsAndInvoicePreview$1;
|
|
|
|
|
|
|
|
invoke-direct {v0, p2}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory$getSubscriptionsAndInvoicePreview$1;-><init>(Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;)V
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-virtual {p1, v0}, Lrx/Observable;->E(Ls0/k/b;)Lrx/Observable;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
new-instance v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory$getSubscriptionsAndInvoicePreview$2;
|
|
|
|
|
|
|
|
invoke-direct {v0, p2}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory$getSubscriptionsAndInvoicePreview$2;-><init>(Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;)V
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-virtual {p1, v0}, Lrx/Observable;->K(Ls0/k/b;)Lrx/Observable;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const-string p2, "restAPI\n .g\u2026ch.Error)\n }"
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-static {p1, p2}, Lk0/o/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-object p1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
new-instance p1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionAndInvoice;
|
|
|
|
|
|
|
|
new-instance v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch$Invoice;
|
|
|
|
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch$Invoice;-><init>(Lcom/discord/models/domain/billing/ModelInvoicePreview;)V
|
|
|
|
|
|
|
|
invoke-direct {p1, p2, v0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionAndInvoice;-><init>(Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch;)V
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
new-instance p2, Ls0/l/e/j;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-direct {p2, p1}, Ls0/l/e/j;-><init>(Ljava/lang/Object;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const-string p1, "Observable.just(\n \u2026ce(null))\n )"
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-static {p2, p1}, Lk0/o/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-object p2
|
|
|
|
|
|
|
|
:cond_1
|
2020-09-02 04:07:20 +00:00
|
|
|
sget-object p1, Ls0/l/a/g;->e:Lrx/Observable;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const-string p2, "Observable.never()"
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-static {p1, p2}, Lk0/o/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
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;Lcom/discord/utilities/rest/RestAPI;)Lrx/Observable;
|
|
|
|
.locals 1
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Lcom/discord/stores/StorePaymentSources;",
|
|
|
|
"Lcom/discord/stores/StoreSubscriptions;",
|
|
|
|
"Lcom/discord/stores/StoreEntitlements;",
|
|
|
|
"Lcom/discord/stores/StorePremiumGuildSubscription;",
|
|
|
|
"Lcom/discord/utilities/rest/RestAPI;",
|
|
|
|
")",
|
|
|
|
"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, p5}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory$observeStores$1;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory;Lcom/discord/utilities/rest/RestAPI;)V
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-virtual {p2, v0}, Lrx/Observable;->U(Ls0/k/b;)Lrx/Observable;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
invoke-virtual {p3}, Lcom/discord/stores/StoreEntitlements;->getEntitlementState()Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
|
|
|
const/4 p5, 0x0
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
invoke-static {p4, p5, v0, p5}, Lcom/discord/stores/StorePremiumGuildSubscription;->getPremiumGuildSubscriptionsState$default(Lcom/discord/stores/StorePremiumGuildSubscription;Ljava/lang/Long;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object p4
|
|
|
|
|
|
|
|
sget-object p5, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory$observeStores$2;->INSTANCE:Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory$observeStores$2;
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-static {p1, p2, p3, p4, p5}, Lrx/Observable;->h(Lrx/Observable;Lrx/Observable;Lrx/Observable;Lrx/Observable;Lrx/functions/Func4;)Lrx/Observable;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const-string p2, "Observable\n .co\u2026 )\n }"
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-static {p1, p2}, Lk0/o/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public create(Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;
|
2020-09-02 04:07:20 +00:00
|
|
|
.locals 12
|
2020-05-17 12:40:10 +00:00
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"<T:",
|
|
|
|
"Landroidx/lifecycle/ViewModel;",
|
|
|
|
">(",
|
|
|
|
"Ljava/lang/Class<",
|
|
|
|
"TT;>;)TT;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
const-string v0, "modelClass"
|
|
|
|
|
|
|
|
invoke-static {p1, v0}, Lk0/o/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
move-result-object v2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
move-result-object v3
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
move-result-object v4
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
move-result-object v5
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
move-result-object v7
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
move-result-object v8
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
move-result-object v9
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
move-result-object v10
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
sget-object v0, Lcom/discord/utilities/rest/RestAPI;->Companion:Lcom/discord/utilities/rest/RestAPI$Companion;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/rest/RestAPI$Companion;->getApi()Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
move-result-object v11
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
move-object v6, p0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-direct/range {v6 .. v11}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory;->observeStores(Lcom/discord/stores/StorePaymentSources;Lcom/discord/stores/StoreSubscriptions;Lcom/discord/stores/StoreEntitlements;Lcom/discord/stores/StorePremiumGuildSubscription;Lcom/discord/utilities/rest/RestAPI;)Lrx/Observable;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
move-result-object v7
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
sget-object v0, Lcom/discord/utilities/rest/RestAPI;->Companion:Lcom/discord/utilities/rest/RestAPI$Companion;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/rest/RestAPI$Companion;->getApi()Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
move-result-object v6
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
move-object v1, p1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-direct/range {v1 .. v7}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;-><init>(Lcom/discord/stores/StorePaymentSources;Lcom/discord/stores/StoreSubscriptions;Lcom/discord/stores/StoreEntitlements;Lcom/discord/stores/StorePremiumGuildSubscription;Lcom/discord/utilities/rest/RestAPI;Lrx/Observable;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|