231 lines
7.5 KiB
Smali
231 lines
7.5 KiB
Smali
.class public final Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel;
|
|
.super Lf/a/b/q0;
|
|
.source "WidgetHomeCallIndicatorViewModel.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$ViewState;,
|
|
Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$StoreState;,
|
|
Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$Factory;
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lf/a/b/q0<",
|
|
"Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$ViewState;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lrx/Observable;)V
|
|
.locals 11
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$StoreState;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
sget-object v1, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$ViewState$Inactive;->INSTANCE:Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$ViewState$Inactive;
|
|
|
|
invoke-direct {p0, v1}, Lf/a/b/q0;-><init>(Ljava/lang/Object;)V
|
|
|
|
invoke-virtual {p1}, Lrx/Observable;->q()Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v1, "storeStateObservable\n \u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {p1, v1}, Lk0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationLatest(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v1, 0x2
|
|
|
|
invoke-static {p1, p0, v0, v1, v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v2
|
|
|
|
const-class v3, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel;
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
new-instance v8, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$1;
|
|
|
|
invoke-direct {v8, p0}, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$1;-><init>(Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel;)V
|
|
|
|
const/16 v9, 0x1e
|
|
|
|
const/4 v10, 0x0
|
|
|
|
invoke-static/range {v2 .. v10}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "storeStateObservable"
|
|
|
|
invoke-static {p1}, Lk0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$handleStoreState(Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel;Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$StoreState;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel;->handleStoreState(Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$StoreState;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final handleStoreState(Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$StoreState;)V
|
|
.locals 9
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
.end annotation
|
|
|
|
instance-of v0, p1, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$StoreState$Unselected;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
sget-object p1, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$ViewState$Inactive;->INSTANCE:Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$ViewState$Inactive;
|
|
|
|
invoke-virtual {p0, p1}, Lf/a/b/q0;->updateViewState(Ljava/lang/Object;)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_0
|
|
instance-of v0, p1, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$StoreState$Selected;
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
check-cast p1, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$StoreState$Selected;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$StoreState$Selected;->getParticipants()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/util/Map;->size()I
|
|
|
|
move-result v6
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$StoreState$Selected;->getParticipants()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/util/Map;->values()Ljava/util/Collection;
|
|
|
|
move-result-object v0
|
|
|
|
instance-of v1, v0, Ljava/util/Collection;
|
|
|
|
const/4 v2, 0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-interface {v0}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
:cond_1
|
|
const/4 v7, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_3
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/discord/stores/StoreVoiceParticipants$VoiceUser;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreVoiceParticipants$VoiceUser;->getVoiceState()Lcom/discord/models/domain/ModelVoice$State;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelVoice$State;->isSelfVideo()Z
|
|
|
|
move-result v1
|
|
|
|
if-ne v1, v2, :cond_4
|
|
|
|
const/4 v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v1, :cond_3
|
|
|
|
const/4 v7, 0x1
|
|
|
|
:goto_1
|
|
new-instance v0, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$ViewState$Active;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$StoreState$Selected;->getSelectedVoiceChannel()Lcom/discord/models/domain/ModelChannel;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$StoreState$Selected;->getConnectionState()Lcom/discord/rtcconnection/RtcConnection$State;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$StoreState$Selected;->getConnectionQuality()Lcom/discord/rtcconnection/RtcConnection$Quality;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$StoreState$Selected;->getGuild()Lcom/discord/models/domain/ModelGuild;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$StoreState$Selected;->getStreamContext()Lcom/discord/utilities/streams/StreamContext;
|
|
|
|
move-result-object v8
|
|
|
|
move-object v1, v0
|
|
|
|
invoke-direct/range {v1 .. v8}, Lcom/discord/widgets/voice/call/WidgetHomeCallIndicatorViewModel$ViewState$Active;-><init>(Lcom/discord/models/domain/ModelChannel;Lcom/discord/rtcconnection/RtcConnection$State;Lcom/discord/rtcconnection/RtcConnection$Quality;Lcom/discord/models/domain/ModelGuild;IZLcom/discord/utilities/streams/StreamContext;)V
|
|
|
|
invoke-virtual {p0, v0}, Lf/a/b/q0;->updateViewState(Ljava/lang/Object;)V
|
|
|
|
:cond_5
|
|
:goto_2
|
|
return-void
|
|
.end method
|