477 lines
17 KiB
Smali
477 lines
17 KiB
Smali
.class public final Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;
|
|
.super Ljava/lang/Object;
|
|
.source "WidgetUserSheetViewModelFactory.kt"
|
|
|
|
# interfaces
|
|
.implements Landroidx/lifecycle/ViewModelProvider$Factory;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory$BootstrapData;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final channelId:Ljava/lang/Long;
|
|
|
|
.field public final friendToken:Ljava/lang/String;
|
|
|
|
.field public final isVoiceContext:Z
|
|
|
|
.field public final streamPreviewClickBehavior:Lcom/discord/widgets/user/usersheet/WidgetUserSheet$StreamPreviewClickBehavior;
|
|
|
|
.field public final userId:J
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(JLjava/lang/Long;ZLcom/discord/widgets/user/usersheet/WidgetUserSheet$StreamPreviewClickBehavior;Ljava/lang/String;)V
|
|
.locals 0
|
|
|
|
if-eqz p5, :cond_0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-wide p1, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->userId:J
|
|
|
|
iput-object p3, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->channelId:Ljava/lang/Long;
|
|
|
|
iput-boolean p4, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->isVoiceContext:Z
|
|
|
|
iput-object p5, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->streamPreviewClickBehavior:Lcom/discord/widgets/user/usersheet/WidgetUserSheet$StreamPreviewClickBehavior;
|
|
|
|
iput-object p6, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->friendToken:Ljava/lang/String;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "streamPreviewClickBehavior"
|
|
|
|
invoke-static {p1}, Lj0/o/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private final observeStoreState(Lcom/discord/stores/StoreUser;Lcom/discord/stores/StoreChannels;Lcom/discord/stores/StoreVoiceChannelSelected;Lcom/discord/stores/StoreUserProfile;Lcom/discord/stores/StoreUserRelationships;Lcom/discord/stores/StoreVoiceStates;Lcom/discord/stores/StoreGuilds;Lcom/discord/stores/StoreMediaSettings;Lcom/discord/stores/StoreUserPresence;Lcom/discord/stores/StorePermissions;Lcom/discord/stores/StoreUserNotes;Lcom/discord/utilities/streams/StreamContextService;Lrx/Scheduler;)Lrx/Observable;
|
|
.locals 13
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lcom/discord/stores/StoreUser;",
|
|
"Lcom/discord/stores/StoreChannels;",
|
|
"Lcom/discord/stores/StoreVoiceChannelSelected;",
|
|
"Lcom/discord/stores/StoreUserProfile;",
|
|
"Lcom/discord/stores/StoreUserRelationships;",
|
|
"Lcom/discord/stores/StoreVoiceStates;",
|
|
"Lcom/discord/stores/StoreGuilds;",
|
|
"Lcom/discord/stores/StoreMediaSettings;",
|
|
"Lcom/discord/stores/StoreUserPresence;",
|
|
"Lcom/discord/stores/StorePermissions;",
|
|
"Lcom/discord/stores/StoreUserNotes;",
|
|
"Lcom/discord/utilities/streams/StreamContextService;",
|
|
"Lrx/Scheduler;",
|
|
")",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
move-object v0, p0
|
|
|
|
iget-wide v1, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->userId:J
|
|
|
|
move-object v3, p1
|
|
|
|
invoke-virtual {p1, v1, v2}, Lcom/discord/stores/StoreUser;->observeUser(J)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/stores/StoreUser;->observeMe()Lrx/Observable;
|
|
|
|
move-result-object v2
|
|
|
|
iget-object v3, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->channelId:Ljava/lang/Long;
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
invoke-virtual {v3}, Ljava/lang/Number;->longValue()J
|
|
|
|
move-result-wide v3
|
|
|
|
move-object v5, p2
|
|
|
|
invoke-virtual {p2, v3, v4}, Lcom/discord/stores/StoreChannels;->get(J)Lrx/Observable;
|
|
|
|
move-result-object v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v3, 0x0
|
|
|
|
new-instance v4, Lr0/l/e/j;
|
|
|
|
invoke-direct {v4, v3}, Lr0/l/e/j;-><init>(Ljava/lang/Object;)V
|
|
|
|
move-object v3, v4
|
|
|
|
:goto_0
|
|
invoke-virtual/range {p3 .. p3}, Lcom/discord/stores/StoreVoiceChannelSelected;->get()Lrx/Observable;
|
|
|
|
move-result-object v4
|
|
|
|
sget-object v5, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory$observeStoreState$2;->INSTANCE:Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory$observeStoreState$2;
|
|
|
|
if-eqz v5, :cond_1
|
|
|
|
new-instance v6, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory$sam$rx_functions_Func4$0;
|
|
|
|
invoke-direct {v6, v5}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory$sam$rx_functions_Func4$0;-><init>(Lkotlin/jvm/functions/Function4;)V
|
|
|
|
move-object v5, v6
|
|
|
|
:cond_1
|
|
check-cast v5, Lrx/functions/Func4;
|
|
|
|
invoke-static {v1, v2, v3, v4, v5}, Lrx/Observable;->h(Lrx/Observable;Lrx/Observable;Lrx/Observable;Lrx/Observable;Lrx/functions/Func4;)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
new-instance v12, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory$observeStoreState$3;
|
|
|
|
move-object v2, v12
|
|
|
|
move-object/from16 v3, p7
|
|
|
|
move-object/from16 v4, p6
|
|
|
|
move-object/from16 v5, p9
|
|
|
|
move-object/from16 v6, p10
|
|
|
|
move-object/from16 v7, p12
|
|
|
|
move-object/from16 v8, p8
|
|
|
|
move-object/from16 v9, p4
|
|
|
|
move-object/from16 v10, p5
|
|
|
|
move-object/from16 v11, p11
|
|
|
|
invoke-direct/range {v2 .. v11}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory$observeStoreState$3;-><init>(Lcom/discord/stores/StoreGuilds;Lcom/discord/stores/StoreVoiceStates;Lcom/discord/stores/StoreUserPresence;Lcom/discord/stores/StorePermissions;Lcom/discord/utilities/streams/StreamContextService;Lcom/discord/stores/StoreMediaSettings;Lcom/discord/stores/StoreUserProfile;Lcom/discord/stores/StoreUserRelationships;Lcom/discord/stores/StoreUserNotes;)V
|
|
|
|
invoke-virtual {v1, v12}, Lrx/Observable;->T(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
new-instance v2, Lcom/discord/utilities/rx/LeadingEdgeThrottle;
|
|
|
|
const-wide/16 v3, 0xfa
|
|
|
|
sget-object v5, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
move-object/from16 v6, p13
|
|
|
|
invoke-direct {v2, v3, v4, v5, v6}, Lcom/discord/utilities/rx/LeadingEdgeThrottle;-><init>(JLjava/util/concurrent/TimeUnit;Lrx/Scheduler;)V
|
|
|
|
new-instance v3, Lr0/l/a/u;
|
|
|
|
iget-object v1, v1, Lrx/Observable;->d:Lrx/Observable$a;
|
|
|
|
invoke-direct {v3, v1, v2}, Lr0/l/a/u;-><init>(Lrx/Observable$a;Lrx/Observable$b;)V
|
|
|
|
invoke-static {v3}, Lrx/Observable;->c0(Lrx/Observable$a;)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "Observable\n .co\u2026, storeStateRxScheduler))"
|
|
|
|
invoke-static {v1, v2}, Lj0/o/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationLatest(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lrx/Observable;->q()Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
return-object v1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public create(Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;
|
|
.locals 36
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Landroidx/lifecycle/ViewModel;",
|
|
">(",
|
|
"Ljava/lang/Class<",
|
|
"TT;>;)TT;"
|
|
}
|
|
.end annotation
|
|
|
|
move-object/from16 v14, p0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
new-instance v15, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;
|
|
|
|
iget-wide v12, v14, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->userId:J
|
|
|
|
iget-object v11, v14, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->channelId:Ljava/lang/Long;
|
|
|
|
iget-object v10, v14, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->friendToken:Ljava/lang/String;
|
|
|
|
iget-boolean v9, v14, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->isVoiceContext:Z
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getMediaSettings()Lcom/discord/stores/StoreMediaSettings;
|
|
|
|
move-result-object v16
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getChannels()Lcom/discord/stores/StoreChannels;
|
|
|
|
move-result-object v17
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getApplicationStreaming()Lcom/discord/stores/StoreApplicationStreaming;
|
|
|
|
move-result-object v18
|
|
|
|
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;
|
|
|
|
move-result-object v19
|
|
|
|
sget-object v0, Lcom/discord/utilities/rest/RestAPI;->Companion:Lcom/discord/utilities/rest/RestAPI$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/rest/RestAPI$Companion;->getApiSerializeNulls()Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
move-result-object v20
|
|
|
|
iget-object v8, v14, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->streamPreviewClickBehavior:Lcom/discord/widgets/user/usersheet/WidgetUserSheet$StreamPreviewClickBehavior;
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getUsers()Lcom/discord/stores/StoreUser;
|
|
|
|
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;->getChannels()Lcom/discord/stores/StoreChannels;
|
|
|
|
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;->getVoiceChannelSelected()Lcom/discord/stores/StoreVoiceChannelSelected;
|
|
|
|
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;->getUserProfile()Lcom/discord/stores/StoreUserProfile;
|
|
|
|
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;->getUserRelationships()Lcom/discord/stores/StoreUserRelationships;
|
|
|
|
move-result-object v5
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getVoiceStates()Lcom/discord/stores/StoreVoiceStates;
|
|
|
|
move-result-object v6
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getGuilds()Lcom/discord/stores/StoreGuilds;
|
|
|
|
move-result-object v7
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getMediaSettings()Lcom/discord/stores/StoreMediaSettings;
|
|
|
|
move-result-object v21
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getPresences()Lcom/discord/stores/StoreUserPresence;
|
|
|
|
move-result-object v22
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getPermissions()Lcom/discord/stores/StorePermissions;
|
|
|
|
move-result-object v23
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getUsersNotes()Lcom/discord/stores/StoreUserNotes;
|
|
|
|
move-result-object v24
|
|
|
|
new-instance v35, Lcom/discord/utilities/streams/StreamContextService;
|
|
|
|
const/16 v26, 0x0
|
|
|
|
const/16 v27, 0x0
|
|
|
|
const/16 v28, 0x0
|
|
|
|
const/16 v29, 0x0
|
|
|
|
const/16 v30, 0x0
|
|
|
|
const/16 v31, 0x0
|
|
|
|
const/16 v32, 0x0
|
|
|
|
const/16 v33, 0x7f
|
|
|
|
const/16 v34, 0x0
|
|
|
|
move-object/from16 v25, v35
|
|
|
|
invoke-direct/range {v25 .. v34}, Lcom/discord/utilities/streams/StreamContextService;-><init>(Lcom/discord/stores/StoreApplicationStreaming;Lcom/discord/stores/StoreGuilds;Lcom/discord/stores/StorePermissions;Lcom/discord/stores/StoreUser;Lcom/discord/stores/StoreVoiceStates;Lcom/discord/stores/StoreChannels;Lcom/discord/stores/StoreApplicationStreamPreviews;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
invoke-static {}, Lr0/p/a;->a()Lrx/Scheduler;
|
|
|
|
move-result-object v0
|
|
|
|
move-object/from16 v25, v8
|
|
|
|
const-string v8, "Schedulers.computation()"
|
|
|
|
invoke-static {v0, v8}, Lj0/o/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
move-object/from16 v26, v0
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
move-object/from16 v8, v21
|
|
|
|
move/from16 v21, v9
|
|
|
|
move-object/from16 v9, v22
|
|
|
|
move-object/from16 v22, v10
|
|
|
|
move-object/from16 v10, v23
|
|
|
|
move-object/from16 v23, v11
|
|
|
|
move-object/from16 v11, v24
|
|
|
|
move-wide/from16 v27, v12
|
|
|
|
move-object/from16 v12, v35
|
|
|
|
move-object/from16 v13, v26
|
|
|
|
invoke-direct/range {v0 .. v13}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->observeStoreState(Lcom/discord/stores/StoreUser;Lcom/discord/stores/StoreChannels;Lcom/discord/stores/StoreVoiceChannelSelected;Lcom/discord/stores/StoreUserProfile;Lcom/discord/stores/StoreUserRelationships;Lcom/discord/stores/StoreVoiceStates;Lcom/discord/stores/StoreGuilds;Lcom/discord/stores/StoreMediaSettings;Lcom/discord/stores/StoreUserPresence;Lcom/discord/stores/StorePermissions;Lcom/discord/stores/StoreUserNotes;Lcom/discord/utilities/streams/StreamContextService;Lrx/Scheduler;)Lrx/Observable;
|
|
|
|
move-result-object v12
|
|
|
|
const-string v0, "observeStoreState(\n \u2026s.computation()\n )"
|
|
|
|
invoke-static {v12, v0}, Lj0/o/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
move-object v0, v15
|
|
|
|
move-wide/from16 v1, v27
|
|
|
|
move-object/from16 v3, v23
|
|
|
|
move-object/from16 v4, v22
|
|
|
|
move/from16 v5, v21
|
|
|
|
move-object/from16 v6, v16
|
|
|
|
move-object/from16 v7, v17
|
|
|
|
move-object/from16 v8, v18
|
|
|
|
move-object/from16 v9, v19
|
|
|
|
move-object/from16 v10, v20
|
|
|
|
move-object/from16 v11, v25
|
|
|
|
invoke-direct/range {v0 .. v12}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;-><init>(JLjava/lang/Long;Ljava/lang/String;ZLcom/discord/stores/StoreMediaSettings;Lcom/discord/stores/StoreChannels;Lcom/discord/stores/StoreApplicationStreaming;Lcom/discord/utilities/rest/RestAPI;Lcom/discord/utilities/rest/RestAPI;Lcom/discord/widgets/user/usersheet/WidgetUserSheet$StreamPreviewClickBehavior;Lrx/Observable;)V
|
|
|
|
return-object v15
|
|
|
|
:cond_0
|
|
const-string v0, "modelClass"
|
|
|
|
invoke-static {v0}, Lj0/o/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final getChannelId()Ljava/lang/Long;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->channelId:Ljava/lang/Long;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getFriendToken()Ljava/lang/String;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->friendToken:Ljava/lang/String;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getStreamPreviewClickBehavior()Lcom/discord/widgets/user/usersheet/WidgetUserSheet$StreamPreviewClickBehavior;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->streamPreviewClickBehavior:Lcom/discord/widgets/user/usersheet/WidgetUserSheet$StreamPreviewClickBehavior;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getUserId()J
|
|
.locals 2
|
|
|
|
iget-wide v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->userId:J
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public final isVoiceContext()Z
|
|
.locals 1
|
|
|
|
iget-boolean v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModelFactory;->isVoiceContext:Z
|
|
|
|
return v0
|
|
.end method
|