1394 lines
42 KiB
Smali
1394 lines
42 KiB
Smali
.class public Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;
|
|
.super Lf/a/b/q0;
|
|
.source "StickerPickerViewModel.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState;,
|
|
Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState;,
|
|
Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Event;,
|
|
Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Factory;,
|
|
Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Companion;
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lf/a/b/q0<",
|
|
"Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final Companion:Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Companion;
|
|
|
|
.field public static final NUM_STICKERS_STORE_PREVIEW:I = 0x5
|
|
|
|
.field public static final RECENT_SELECTED_ID:J = -0x1L
|
|
|
|
.field public static final STORE_SELECTED_ID:J
|
|
|
|
|
|
# instance fields
|
|
.field public final eventSubject:Lrx/subjects/PublishSubject;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/subjects/PublishSubject<",
|
|
"Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Event;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final initialStickerPackId:J
|
|
|
|
.field public final initialStickerPickerScreen:Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;
|
|
|
|
.field public final locale:Ljava/util/Locale;
|
|
|
|
.field public final messageManager:Lcom/discord/widgets/chat/MessageManager;
|
|
|
|
.field public final searchSubject:Lrx/subjects/BehaviorSubject;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/subjects/BehaviorSubject<",
|
|
"Ljava/lang/String;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final selectedPackIdSubject:Lrx/subjects/BehaviorSubject;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/subjects/BehaviorSubject<",
|
|
"Ljava/lang/Long;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final stickersStore:Lcom/discord/stores/StoreStickers;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 2
|
|
|
|
new-instance v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Companion;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sput-object v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->Companion:Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Companion;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Lrx/Observable;Lrx/subjects/BehaviorSubject;Lrx/subjects/BehaviorSubject;Ljava/util/Locale;Lcom/discord/widgets/chat/MessageManager;Lcom/discord/stores/StoreStickers;Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;J)V
|
|
.locals 10
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState;",
|
|
">;",
|
|
"Lrx/subjects/BehaviorSubject<",
|
|
"Ljava/lang/String;",
|
|
">;",
|
|
"Lrx/subjects/BehaviorSubject<",
|
|
"Ljava/lang/Long;",
|
|
">;",
|
|
"Ljava/util/Locale;",
|
|
"Lcom/discord/widgets/chat/MessageManager;",
|
|
"Lcom/discord/stores/StoreStickers;",
|
|
"Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;",
|
|
"J)V"
|
|
}
|
|
.end annotation
|
|
|
|
move-object v0, p0
|
|
|
|
move-object v1, p2
|
|
|
|
move-object v2, p3
|
|
|
|
move-object v3, p4
|
|
|
|
move-object v4, p5
|
|
|
|
move-object/from16 v5, p6
|
|
|
|
move-object/from16 v6, p7
|
|
|
|
const-string v7, "storeStateObservable"
|
|
|
|
move-object v8, p1
|
|
|
|
invoke-static {p1, v7}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v7, "searchSubject"
|
|
|
|
invoke-static {p2, v7}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v7, "selectedPackIdSubject"
|
|
|
|
invoke-static {p3, v7}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v7, "locale"
|
|
|
|
invoke-static {p4, v7}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v7, "messageManager"
|
|
|
|
invoke-static {p5, v7}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v7, "stickersStore"
|
|
|
|
invoke-static {v5, v7}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v7, "initialStickerPickerScreen"
|
|
|
|
invoke-static {v6, v7}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 v7, 0x0
|
|
|
|
invoke-direct {p0, v7}, Lf/a/b/q0;-><init>(Ljava/lang/Object;)V
|
|
|
|
iput-object v1, v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->searchSubject:Lrx/subjects/BehaviorSubject;
|
|
|
|
iput-object v2, v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->selectedPackIdSubject:Lrx/subjects/BehaviorSubject;
|
|
|
|
iput-object v3, v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->locale:Ljava/util/Locale;
|
|
|
|
iput-object v4, v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->messageManager:Lcom/discord/widgets/chat/MessageManager;
|
|
|
|
iput-object v5, v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->stickersStore:Lcom/discord/stores/StoreStickers;
|
|
|
|
iput-object v6, v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->initialStickerPickerScreen:Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;
|
|
|
|
move-wide/from16 v1, p8
|
|
|
|
iput-wide v1, v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->initialStickerPackId:J
|
|
|
|
invoke-static {}, Lrx/subjects/PublishSubject;->h0()Lrx/subjects/PublishSubject;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "PublishSubject.create()"
|
|
|
|
invoke-static {v1, v2}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iput-object v1, v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->fetchStickersData()V
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationLatest(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
const/4 v2, 0x2
|
|
|
|
invoke-static {v1, p0, v7, v2, v7}, 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 v1
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v2
|
|
|
|
new-instance v3, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$1;
|
|
|
|
invoke-direct {v3, p0}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$1;-><init>(Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;)V
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/16 v8, 0x1e
|
|
|
|
const/4 v9, 0x0
|
|
|
|
move-object p1, v1
|
|
|
|
move-object p2, v2
|
|
|
|
move-object p3, v4
|
|
|
|
move-object p4, v5
|
|
|
|
move-object p5, v6
|
|
|
|
move-object/from16 p6, v7
|
|
|
|
move-object/from16 p7, v3
|
|
|
|
move/from16 p8, v8
|
|
|
|
move-object/from16 p9, v9
|
|
|
|
invoke-static/range {p1 .. p9}, 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
|
|
.end method
|
|
|
|
.method public static final synthetic access$handleStoreState(Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->handleStoreState(Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final createCategoryItems(Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;)Ljava/util/List;
|
|
.locals 12
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;",
|
|
")",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/widgets/chat/input/sticker/StickerCategoryItem;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getOwnedStickerPackState()Lcom/discord/stores/StoreStickers$OwnedStickerPackState;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getSelectedPackId()Ljava/lang/Long;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getFrequentlyUsedStickers()Ljava/util/List;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v3}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v3
|
|
|
|
const/4 v4, 0x1
|
|
|
|
const/4 v5, 0x0
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getFrequentlyUsedStickers()Ljava/util/List;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v3}, Ljava/util/List;->size()I
|
|
|
|
move-result v3
|
|
|
|
add-int/2addr v3, v4
|
|
|
|
:goto_0
|
|
add-int/2addr v3, v5
|
|
|
|
new-instance v6, Lcom/discord/widgets/chat/input/sticker/StickerCategoryItem$RecentItem;
|
|
|
|
const-wide/16 v7, -0x1
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
invoke-virtual {v2}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v9
|
|
|
|
cmp-long v11, v9, v7
|
|
|
|
if-nez v11, :cond_2
|
|
|
|
const/4 v7, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
:goto_1
|
|
const/4 v7, 0x0
|
|
|
|
:goto_2
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getFrequentlyUsedStickers()Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {p1}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result p1
|
|
|
|
new-instance v8, Lkotlin/Pair;
|
|
|
|
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v9
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v10
|
|
|
|
invoke-direct {v8, v9, v10}, Lkotlin/Pair;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
|
|
invoke-direct {v6, v7, p1, v8}, Lcom/discord/widgets/chat/input/sticker/StickerCategoryItem$RecentItem;-><init>(ZZLkotlin/Pair;)V
|
|
|
|
invoke-interface {v1, v6}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
instance-of p1, v0, Lcom/discord/stores/StoreStickers$OwnedStickerPackState$Loaded;
|
|
|
|
if-eqz p1, :cond_6
|
|
|
|
check-cast v0, Lcom/discord/stores/StoreStickers$OwnedStickerPackState$Loaded;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStickers$OwnedStickerPackState$Loaded;->getOwnedStickerPacks()Ljava/util/Map;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {p1}, Ljava/util/Map;->values()Ljava/util/Collection;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_3
|
|
:goto_3
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v6
|
|
|
|
if-eqz v6, :cond_4
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v6
|
|
|
|
move-object v7, v6
|
|
|
|
check-cast v7, Lcom/discord/models/sticker/dto/ModelUserStickerPack;
|
|
|
|
invoke-virtual {v7}, Lcom/discord/models/sticker/dto/ModelUserStickerPack;->getHasAccess()Z
|
|
|
|
move-result v7
|
|
|
|
if-eqz v7, :cond_3
|
|
|
|
invoke-interface {v0, v6}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_3
|
|
|
|
:cond_4
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_5
|
|
:goto_4
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v6
|
|
|
|
if-eqz v6, :cond_7
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v6
|
|
|
|
check-cast v6, Lcom/discord/models/sticker/dto/ModelUserStickerPack;
|
|
|
|
invoke-virtual {v6}, Lcom/discord/models/sticker/dto/ModelUserStickerPack;->getStickerPack()Lcom/discord/models/sticker/dto/ModelStickerPack;
|
|
|
|
move-result-object v6
|
|
|
|
if-eqz v6, :cond_5
|
|
|
|
invoke-interface {p1, v6}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_4
|
|
|
|
:cond_6
|
|
sget-object p1, Lb0/i/l;->d:Lb0/i/l;
|
|
|
|
:cond_7
|
|
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_5
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_a
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/discord/models/sticker/dto/ModelStickerPack;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/sticker/dto/ModelStickerPack;->getId()J
|
|
|
|
move-result-wide v6
|
|
|
|
if-nez v2, :cond_8
|
|
|
|
goto :goto_6
|
|
|
|
:cond_8
|
|
invoke-virtual {v2}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v8
|
|
|
|
cmp-long v10, v8, v6
|
|
|
|
if-nez v10, :cond_9
|
|
|
|
const/4 v6, 0x1
|
|
|
|
goto :goto_7
|
|
|
|
:cond_9
|
|
:goto_6
|
|
const/4 v6, 0x0
|
|
|
|
:goto_7
|
|
invoke-virtual {v0}, Lcom/discord/models/sticker/dto/ModelStickerPack;->getStickers()Ljava/util/List;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-interface {v7}, Ljava/util/List;->size()I
|
|
|
|
move-result v7
|
|
|
|
add-int/2addr v7, v4
|
|
|
|
add-int/2addr v7, v3
|
|
|
|
new-instance v8, Lcom/discord/widgets/chat/input/sticker/StickerCategoryItem$PackItem;
|
|
|
|
new-instance v9, Lkotlin/Pair;
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v7}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v10
|
|
|
|
invoke-direct {v9, v3, v10}, Lkotlin/Pair;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
|
|
invoke-direct {v8, v0, v9, v6}, Lcom/discord/widgets/chat/input/sticker/StickerCategoryItem$PackItem;-><init>(Lcom/discord/models/sticker/dto/ModelStickerPack;Lkotlin/Pair;Z)V
|
|
|
|
invoke-interface {v1, v8}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
move v3, v7
|
|
|
|
goto :goto_5
|
|
|
|
:cond_a
|
|
return-object v1
|
|
.end method
|
|
|
|
.method private final fetchStickersData()V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->stickersStore:Lcom/discord/stores/StoreStickers;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStickers;->fetchOwnedStickerPacks()V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->stickersStore:Lcom/discord/stores/StoreStickers;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStickers;->fetchStickerStoreDirectory()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final handleStoreState(Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState;)V
|
|
.locals 5
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
.end annotation
|
|
|
|
instance-of v0, p1, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;
|
|
|
|
if-eqz v0, :cond_6
|
|
|
|
check-cast p1, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getSelectedPackId()Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->initialStickerPickerScreen:Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getSelectedPackId()Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
const-wide/16 v1, 0x0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-virtual {v0}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v3
|
|
|
|
cmp-long v0, v3, v1
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
sget-object v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;->STORE:Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
:goto_0
|
|
sget-object v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;->OWNED_PACKS:Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;
|
|
|
|
:goto_1
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getSelectedPackId()Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
if-nez v1, :cond_3
|
|
|
|
iget-wide v1, p0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->initialStickerPackId:J
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
const/4 v1, 0x0
|
|
|
|
:goto_2
|
|
invoke-virtual {v0}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
const/4 v2, 0x1
|
|
|
|
if-eq v0, v2, :cond_4
|
|
|
|
goto :goto_3
|
|
|
|
:cond_4
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->handleStoreStateForOwnedPage(Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;)V
|
|
|
|
goto :goto_3
|
|
|
|
:cond_5
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->handleStoreStateForStorePage(Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;)V
|
|
|
|
:goto_3
|
|
invoke-direct {p0, v1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->scrollToPackId(Ljava/lang/Long;)V
|
|
|
|
:cond_6
|
|
return-void
|
|
.end method
|
|
|
|
.method private final handleStoreStateForOwnedPage(Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;)V
|
|
.locals 11
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getOwnedStickerPackState()Lcom/discord/stores/StoreStickers$OwnedStickerPackState;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getStickerAnimationSettings()I
|
|
|
|
move-result v1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getSearchInputStringUpper()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
iget-object v3, p0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->locale:Ljava/util/Locale;
|
|
|
|
if-eqz v2, :cond_a
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/String;->toLowerCase(Ljava/util/Locale;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "(this as java.lang.String).toLowerCase(locale)"
|
|
|
|
invoke-static {v2, v3}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getFrequentlyUsedStickers()Ljava/util/List;
|
|
|
|
move-result-object v3
|
|
|
|
new-instance v4, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->createCategoryItems(Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;)Ljava/util/List;
|
|
|
|
move-result-object v5
|
|
|
|
instance-of v6, v0, Lcom/discord/stores/StoreStickers$OwnedStickerPackState$Loaded;
|
|
|
|
if-eqz v6, :cond_0
|
|
|
|
check-cast v0, Lcom/discord/stores/StoreStickers$OwnedStickerPackState$Loaded;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStickers$OwnedStickerPackState$Loaded;->getOwnedStickerPacks()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
sget-object v0, Lb0/i/m;->d:Lb0/i/m;
|
|
|
|
:goto_0
|
|
invoke-interface {v3}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v6
|
|
|
|
const/4 v7, 0x1
|
|
|
|
xor-int/2addr v6, v7
|
|
|
|
if-eqz v6, :cond_2
|
|
|
|
new-instance v6, Lcom/discord/widgets/chat/input/sticker/OwnedHeaderItem;
|
|
|
|
sget-object v8, Lcom/discord/widgets/chat/input/sticker/HeaderType$Recent;->INSTANCE:Lcom/discord/widgets/chat/input/sticker/HeaderType$Recent;
|
|
|
|
invoke-direct {v6, v8}, Lcom/discord/widgets/chat/input/sticker/OwnedHeaderItem;-><init>(Lcom/discord/widgets/chat/input/sticker/HeaderType;)V
|
|
|
|
invoke-interface {v4, v6}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
new-instance v6, Ljava/util/ArrayList;
|
|
|
|
const/16 v8, 0xa
|
|
|
|
invoke-static {v3, v8}, Lf/h/a/f/f/n/f;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
|
|
|
move-result v8
|
|
|
|
invoke-direct {v6, v8}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
invoke-interface {v3}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v3
|
|
|
|
:goto_1
|
|
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v8
|
|
|
|
if-eqz v8, :cond_1
|
|
|
|
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v8
|
|
|
|
check-cast v8, Lcom/discord/models/sticker/dto/ModelSticker;
|
|
|
|
new-instance v9, Lcom/discord/widgets/chat/input/sticker/StickerItem;
|
|
|
|
sget-object v10, Lcom/discord/widgets/chat/input/sticker/StickerItem$Mode;->OWNED:Lcom/discord/widgets/chat/input/sticker/StickerItem$Mode;
|
|
|
|
invoke-direct {v9, v8, v1, v10}, Lcom/discord/widgets/chat/input/sticker/StickerItem;-><init>(Lcom/discord/models/sticker/dto/ModelSticker;ILcom/discord/widgets/chat/input/sticker/StickerItem$Mode;)V
|
|
|
|
invoke-interface {v6, v9}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
invoke-interface {v4, v6}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z
|
|
|
|
:cond_2
|
|
invoke-interface {v0}, Ljava/util/Map;->values()Ljava/util/Collection;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v3}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v3
|
|
|
|
:cond_3
|
|
:goto_2
|
|
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v6
|
|
|
|
if-eqz v6, :cond_5
|
|
|
|
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v6
|
|
|
|
check-cast v6, Lcom/discord/models/sticker/dto/ModelUserStickerPack;
|
|
|
|
invoke-virtual {v6}, Lcom/discord/models/sticker/dto/ModelUserStickerPack;->getStickerPack()Lcom/discord/models/sticker/dto/ModelStickerPack;
|
|
|
|
move-result-object v8
|
|
|
|
if-eqz v8, :cond_3
|
|
|
|
invoke-virtual {v6}, Lcom/discord/models/sticker/dto/ModelUserStickerPack;->getHasAccess()Z
|
|
|
|
move-result v8
|
|
|
|
if-nez v8, :cond_4
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
sget-object v8, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->Companion:Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Companion;
|
|
|
|
invoke-virtual {v6}, Lcom/discord/models/sticker/dto/ModelUserStickerPack;->getStickerPack()Lcom/discord/models/sticker/dto/ModelStickerPack;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-static {v6}, Lb0/n/c/j;->checkNotNull(Ljava/lang/Object;)V
|
|
|
|
iget-object v9, p0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->locale:Ljava/util/Locale;
|
|
|
|
invoke-static {v8, v6, v2, v1, v9}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Companion;->access$buildOwnedStickerListItems(Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Companion;Lcom/discord/models/sticker/dto/ModelStickerPack;Ljava/lang/String;ILjava/util/Locale;)Ljava/util/List;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-interface {v4, v6}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z
|
|
|
|
goto :goto_2
|
|
|
|
:cond_5
|
|
invoke-interface {v0}, Ljava/util/Map;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_6
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_3
|
|
|
|
:cond_6
|
|
const/4 v0, 0x0
|
|
|
|
:goto_3
|
|
if-eqz v0, :cond_7
|
|
|
|
new-instance p1, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$NoOwnedPacks;
|
|
|
|
sget-object v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;->OWNED_PACKS:Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;
|
|
|
|
invoke-direct {p1, v5, v0}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$NoOwnedPacks;-><init>(Ljava/util/List;Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;)V
|
|
|
|
invoke-virtual {p0, p1}, Lf/a/b/q0;->updateViewState(Ljava/lang/Object;)V
|
|
|
|
goto :goto_5
|
|
|
|
:cond_7
|
|
invoke-interface {v4}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_9
|
|
|
|
invoke-interface {v2}, Ljava/lang/CharSequence;->length()I
|
|
|
|
move-result v0
|
|
|
|
if-lez v0, :cond_8
|
|
|
|
goto :goto_4
|
|
|
|
:cond_8
|
|
const/4 v7, 0x0
|
|
|
|
:goto_4
|
|
if-eqz v7, :cond_9
|
|
|
|
new-instance v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$EmptySearchResults;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getSearchInputStringUpper()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object v1, Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;->OWNED_PACKS:Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;
|
|
|
|
invoke-direct {v0, p1, v5, v1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$EmptySearchResults;-><init>(Ljava/lang/String;Ljava/util/List;Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;)V
|
|
|
|
invoke-virtual {p0, v0}, Lf/a/b/q0;->updateViewState(Ljava/lang/Object;)V
|
|
|
|
goto :goto_5
|
|
|
|
:cond_9
|
|
new-instance v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$Stickers;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getSearchInputStringUpper()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object v1, Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;->OWNED_PACKS:Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;
|
|
|
|
invoke-direct {v0, p1, v4, v5, v1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$Stickers;-><init>(Ljava/lang/String;Ljava/util/List;Ljava/util/List;Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;)V
|
|
|
|
invoke-virtual {p0, v0}, Lf/a/b/q0;->updateViewState(Ljava/lang/Object;)V
|
|
|
|
:goto_5
|
|
return-void
|
|
|
|
:cond_a
|
|
new-instance p1, Ljava/lang/NullPointerException;
|
|
|
|
const-string v0, "null cannot be cast to non-null type java.lang.String"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private final handleStoreStateForStorePage(Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;)V
|
|
.locals 18
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getOwnedStickerPackState()Lcom/discord/stores/StoreStickers$OwnedStickerPackState;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getStickerPackStoreDirectory()Ljava/util/List;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getStickerAnimationSettings()I
|
|
|
|
move-result v11
|
|
|
|
invoke-direct/range {p0 .. p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->createCategoryItems(Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;)Ljava/util/List;
|
|
|
|
move-result-object v12
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getSearchInputStringUpper()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
iget-object v4, v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->locale:Ljava/util/Locale;
|
|
|
|
if-eqz v3, :cond_6
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/String;->toLowerCase(Ljava/util/Locale;)Ljava/lang/String;
|
|
|
|
move-result-object v13
|
|
|
|
const-string v3, "(this as java.lang.String).toLowerCase(locale)"
|
|
|
|
invoke-static {v13, v3}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v14, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v14}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
instance-of v3, v1, Lcom/discord/stores/StoreStickers$OwnedStickerPackState$Loaded;
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
check-cast v1, Lcom/discord/stores/StoreStickers$OwnedStickerPackState$Loaded;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreStickers$OwnedStickerPackState$Loaded;->getOwnedStickerPacks()Ljava/util/Map;
|
|
|
|
move-result-object v1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
sget-object v1, Lb0/i/m;->d:Lb0/i/m;
|
|
|
|
:goto_0
|
|
new-instance v3, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {v2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v4
|
|
|
|
:cond_1
|
|
:goto_1
|
|
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_2
|
|
|
|
invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v5
|
|
|
|
move-object v6, v5
|
|
|
|
check-cast v6, Lcom/discord/models/sticker/dto/ModelStickerPack;
|
|
|
|
invoke-virtual {v6}, Lcom/discord/models/sticker/dto/ModelStickerPack;->canBePurchased()Z
|
|
|
|
move-result v6
|
|
|
|
if-eqz v6, :cond_1
|
|
|
|
invoke-interface {v3, v5}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
new-instance v4, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$handleStoreStateForStorePage$$inlined$sortedBy$1;
|
|
|
|
invoke-direct {v4, v1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$handleStoreStateForStorePage$$inlined$sortedBy$1;-><init>(Ljava/util/Map;)V
|
|
|
|
invoke-static {v3, v4}, Lb0/i/f;->sortedWith(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v3}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v15
|
|
|
|
:goto_2
|
|
invoke-interface {v15}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
const/4 v4, 0x1
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
invoke-interface {v15}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
move-object v5, v3
|
|
|
|
check-cast v5, Lcom/discord/models/sticker/dto/ModelStickerPack;
|
|
|
|
sget-object v3, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->Companion:Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Companion;
|
|
|
|
iget-object v7, v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->locale:Ljava/util/Locale;
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getMeUser()Lcom/discord/models/domain/ModelUser;
|
|
|
|
move-result-object v8
|
|
|
|
invoke-static {v2}, Lb0/i/f;->last(Ljava/util/List;)Ljava/lang/Object;
|
|
|
|
move-result-object v6
|
|
|
|
check-cast v6, Lcom/discord/models/sticker/dto/ModelStickerPack;
|
|
|
|
invoke-static {v5, v6}, Lb0/n/c/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v6
|
|
|
|
xor-int/lit8 v9, v6, 0x1
|
|
|
|
invoke-virtual {v5}, Lcom/discord/models/sticker/dto/ModelStickerPack;->getId()J
|
|
|
|
move-result-wide v16
|
|
|
|
invoke-static/range {v16 .. v17}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-interface {v1, v4}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result v10
|
|
|
|
move-object v4, v5
|
|
|
|
move-object v5, v13
|
|
|
|
move v6, v11
|
|
|
|
invoke-static/range {v3 .. v10}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Companion;->access$buildStoreStickerListItems(Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Companion;Lcom/discord/models/sticker/dto/ModelStickerPack;Ljava/lang/String;ILjava/util/Locale;Lcom/discord/models/domain/ModelUser;ZZ)Ljava/util/List;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v14, v3}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
invoke-interface {v14}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
invoke-interface {v13}, Ljava/lang/CharSequence;->length()I
|
|
|
|
move-result v1
|
|
|
|
if-lez v1, :cond_4
|
|
|
|
goto :goto_3
|
|
|
|
:cond_4
|
|
const/4 v4, 0x0
|
|
|
|
:goto_3
|
|
if-eqz v4, :cond_5
|
|
|
|
new-instance v1, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$EmptySearchResults;
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getSearchInputStringUpper()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
sget-object v3, Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;->STORE:Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;
|
|
|
|
invoke-direct {v1, v2, v12, v3}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$EmptySearchResults;-><init>(Ljava/lang/String;Ljava/util/List;Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;)V
|
|
|
|
invoke-virtual {v0, v1}, Lf/a/b/q0;->updateViewState(Ljava/lang/Object;)V
|
|
|
|
goto :goto_4
|
|
|
|
:cond_5
|
|
new-instance v1, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$Stickers;
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$StoreState$Loaded;->getSearchInputStringUpper()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
sget-object v3, Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;->STORE:Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;
|
|
|
|
invoke-direct {v1, v2, v14, v12, v3}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$Stickers;-><init>(Ljava/lang/String;Ljava/util/List;Ljava/util/List;Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;)V
|
|
|
|
invoke-virtual {v0, v1}, Lf/a/b/q0;->updateViewState(Ljava/lang/Object;)V
|
|
|
|
:goto_4
|
|
return-void
|
|
|
|
:cond_6
|
|
new-instance v1, Ljava/lang/NullPointerException;
|
|
|
|
const-string v2, "null cannot be cast to non-null type java.lang.String"
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method private final scrollToPackId(Ljava/lang/Long;)V
|
|
.locals 9
|
|
|
|
invoke-virtual {p0}, Lf/a/b/q0;->getViewState()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
instance-of v1, v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$Stickers;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:cond_0
|
|
check-cast v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$Stickers;
|
|
|
|
if-eqz v0, :cond_6
|
|
|
|
if-eqz p1, :cond_6
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
|
|
|
|
invoke-virtual {v0}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$Stickers;->getStickerPickerScreen()Lcom/discord/widgets/chat/input/sticker/StickerPickerScreen;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-eq v1, v3, :cond_1
|
|
|
|
goto/16 :goto_3
|
|
|
|
:cond_1
|
|
invoke-virtual {v0}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$Stickers;->getStickerItems()Ljava/util/List;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v1}, Ljava/util/Collection;->size()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:goto_0
|
|
if-ge v3, v1, :cond_5
|
|
|
|
invoke-virtual {v0}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$Stickers;->getStickerItems()Ljava/util/List;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-interface {v4, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Lcom/discord/utilities/mg_recycler/MGRecyclerDataPayload;
|
|
|
|
instance-of v5, v4, Lcom/discord/widgets/chat/input/sticker/OwnedHeaderItem;
|
|
|
|
if-eqz v5, :cond_2
|
|
|
|
check-cast v4, Lcom/discord/widgets/chat/input/sticker/OwnedHeaderItem;
|
|
|
|
invoke-virtual {v4}, Lcom/discord/widgets/chat/input/sticker/OwnedHeaderItem;->getHeaderType()Lcom/discord/widgets/chat/input/sticker/HeaderType;
|
|
|
|
move-result-object v5
|
|
|
|
instance-of v5, v5, Lcom/discord/widgets/chat/input/sticker/HeaderType$OwnedPackItem;
|
|
|
|
if-eqz v5, :cond_2
|
|
|
|
invoke-virtual {v4}, Lcom/discord/widgets/chat/input/sticker/OwnedHeaderItem;->getHeaderType()Lcom/discord/widgets/chat/input/sticker/HeaderType;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Lcom/discord/widgets/chat/input/sticker/HeaderType$OwnedPackItem;
|
|
|
|
invoke-virtual {v4}, Lcom/discord/widgets/chat/input/sticker/HeaderType$OwnedPackItem;->getPack()Lcom/discord/models/sticker/dto/ModelStickerPack;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v4}, Lcom/discord/models/sticker/dto/ModelStickerPack;->getId()J
|
|
|
|
move-result-wide v4
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v6
|
|
|
|
cmp-long v8, v4, v6
|
|
|
|
if-nez v8, :cond_2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
invoke-virtual {v0}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$Stickers;->getStickerItems()Ljava/util/List;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v1}, Ljava/util/Collection;->size()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:goto_1
|
|
if-ge v3, v1, :cond_5
|
|
|
|
invoke-virtual {v0}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$Stickers;->getStickerItems()Ljava/util/List;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-interface {v4, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Lcom/discord/utilities/mg_recycler/MGRecyclerDataPayload;
|
|
|
|
instance-of v5, v4, Lcom/discord/widgets/chat/input/sticker/StoreHeaderItem;
|
|
|
|
if-eqz v5, :cond_4
|
|
|
|
check-cast v4, Lcom/discord/widgets/chat/input/sticker/StoreHeaderItem;
|
|
|
|
invoke-virtual {v4}, Lcom/discord/widgets/chat/input/sticker/StoreHeaderItem;->getPack()Lcom/discord/models/sticker/dto/ModelStickerPack;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v4}, Lcom/discord/models/sticker/dto/ModelStickerPack;->getId()J
|
|
|
|
move-result-wide v4
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v6
|
|
|
|
cmp-long v8, v4, v6
|
|
|
|
if-nez v8, :cond_4
|
|
|
|
:goto_2
|
|
move v2, v3
|
|
|
|
goto :goto_3
|
|
|
|
:cond_4
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_5
|
|
:goto_3
|
|
iget-object p1, p0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
new-instance v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Event$ScrollToStickerItemPosition;
|
|
|
|
invoke-direct {v0, v2}, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Event$ScrollToStickerItemPosition;-><init>(I)V
|
|
|
|
iget-object p1, p1, Lrx/subjects/PublishSubject;->e:Lrx/subjects/PublishSubject$b;
|
|
|
|
invoke-virtual {p1, v0}, Lrx/subjects/PublishSubject$b;->onNext(Ljava/lang/Object;)V
|
|
|
|
:cond_6
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final observeEvents()Lrx/Observable;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$Event;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final onStickerSelected(Lcom/discord/models/sticker/dto/ModelSticker;)V
|
|
.locals 12
|
|
|
|
const-string v0, "sticker"
|
|
|
|
invoke-static {p1, v0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0}, Lf/a/b/q0;->getViewState()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState;
|
|
|
|
instance-of v0, v0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel$ViewState$Stickers;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->stickersStore:Lcom/discord/stores/StoreStickers;
|
|
|
|
invoke-virtual {v0, p1}, Lcom/discord/stores/StoreStickers;->onStickerUsed(Lcom/discord/models/sticker/dto/ModelSticker;)V
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->messageManager:Lcom/discord/widgets/chat/MessageManager;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-static {p1}, Lf/h/a/f/f/n/f;->listOf(Ljava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object v6
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/16 v10, 0xef
|
|
|
|
const/4 v11, 0x0
|
|
|
|
invoke-static/range {v1 .. v11}, Lcom/discord/widgets/chat/MessageManager;->sendMessage$default(Lcom/discord/widgets/chat/MessageManager;Ljava/lang/String;Ljava/util/List;Lcom/discord/widgets/chat/MessageManager$AttachmentsRequest;Ljava/lang/Long;Ljava/util/List;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Z
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public final setSearchText(Ljava/lang/String;)V
|
|
.locals 1
|
|
|
|
const-string v0, "searchText"
|
|
|
|
invoke-static {p1, v0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->searchSubject:Lrx/subjects/BehaviorSubject;
|
|
|
|
invoke-virtual {v0, p1}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final setSelectedPackId(J)V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/sticker/StickerPickerViewModel;->selectedPackIdSubject:Lrx/subjects/BehaviorSubject;
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0, p1}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|