apkfuckery/com.discord/smali_classes2/com/lytefast/flexinput/utils/SelectionCoordinator.smali

354 lines
9.2 KiB
Smali

.class public Lcom/lytefast/flexinput/utils/SelectionCoordinator;
.super Ljava/lang/Object;
.source "SelectionCoordinator.kt"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/lytefast/flexinput/utils/SelectionCoordinator$RestorationException;,
Lcom/lytefast/flexinput/utils/SelectionCoordinator$a;,
Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<I:",
"Ljava/lang/Object;",
"T::TI;>",
"Ljava/lang/Object;"
}
.end annotation
# instance fields
.field public a:Landroidx/recyclerview/widget/RecyclerView$Adapter;
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroidx/recyclerview/widget/RecyclerView$Adapter<",
"*>;"
}
.end annotation
.end field
.field public final b:Landroidx/collection/ArrayMap;
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroidx/collection/ArrayMap<",
"TT;",
"Ljava/lang/Integer;",
">;"
}
.end annotation
.end field
.field public c:Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener<",
"-TI;>;"
}
.end annotation
.end field
# direct methods
.method public constructor <init>()V
.locals 2
const/4 v0, 0x0
const/4 v1, 0x3
invoke-direct {p0, v0, v0, v1}, Lcom/lytefast/flexinput/utils/SelectionCoordinator;-><init>(Landroidx/collection/ArrayMap;Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;I)V
return-void
.end method
.method public constructor <init>(Landroidx/collection/ArrayMap;Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;I)V
.locals 1
and-int/lit8 p1, p3, 0x1
const/4 p2, 0x0
if-eqz p1, :cond_0
new-instance p1, Landroidx/collection/ArrayMap;
const/4 v0, 0x4
invoke-direct {p1, v0}, Landroidx/collection/ArrayMap;-><init>(I)V
goto :goto_0
:cond_0
move-object p1, p2
:goto_0
and-int/lit8 p3, p3, 0x2
if-eqz p3, :cond_1
new-instance p3, Lf/b/a/e/c;
invoke-direct {p3}, Lf/b/a/e/c;-><init>()V
goto :goto_1
:cond_1
move-object p3, p2
:goto_1
if-eqz p1, :cond_3
if-eqz p3, :cond_2
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->b:Landroidx/collection/ArrayMap;
iput-object p3, p0, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->c:Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;
return-void
:cond_2
const-string p1, "itemSelectionListener"
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
throw p2
:cond_3
const-string p1, "selectedItemPositionMap"
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
throw p2
.end method
# virtual methods
.method public final a(Ljava/lang/Object;I)Z
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(TT;I)Z"
}
.end annotation
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->b:Landroidx/collection/ArrayMap;
invoke-virtual {v0, p1}, Landroidx/collection/SimpleArrayMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/Integer;
if-eqz v0, :cond_1
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
move-result v0
if-eq p2, v0, :cond_0
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->b:Landroidx/collection/ArrayMap;
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p2
invoke-interface {v0, p1, p2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
:cond_0
const/4 p1, 0x1
return p1
:cond_1
const/4 p1, 0x0
return p1
.end method
.method public final b(Ljava/util/ArrayList;)V
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/ArrayList<",
"+TI;>;)V"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/lytefast/flexinput/utils/SelectionCoordinator$RestorationException;
}
.end annotation
const/4 v0, 0x0
if-eqz p1, :cond_4
iget-object v1, p0, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->a:Landroidx/recyclerview/widget/RecyclerView$Adapter;
if-nez v1, :cond_3
invoke-virtual {p1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
move-result-object p1
:cond_0
:goto_0
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_2
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
instance-of v2, v1, Ljava/lang/Object;
if-nez v2, :cond_1
move-object v1, v0
:cond_1
if-eqz v1, :cond_0
iget-object v2, p0, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->b:Landroidx/collection/ArrayMap;
const/4 v3, -0x1
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v3
invoke-virtual {v2, v1, v3}, Landroidx/collection/SimpleArrayMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
goto :goto_0
:cond_2
return-void
:cond_3
new-instance p1, Lcom/lytefast/flexinput/utils/SelectionCoordinator$RestorationException;
const-string v0, "cannot restoreSelections after adapter set: prevents mismatches"
invoke-direct {p1, v0}, Lcom/lytefast/flexinput/utils/SelectionCoordinator$RestorationException;-><init>(Ljava/lang/String;)V
throw p1
:cond_4
const-string p1, "selectedItems"
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
throw v0
.end method
.method public final c(Ljava/lang/Object;I)V
.locals 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(TT;I)V"
}
.end annotation
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->b:Landroidx/collection/ArrayMap;
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
invoke-virtual {v0, p1, v1}, Landroidx/collection/SimpleArrayMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->a:Landroidx/recyclerview/widget/RecyclerView$Adapter;
if-eqz v0, :cond_0
new-instance v1, Lcom/lytefast/flexinput/utils/SelectionCoordinator$a;
const/4 v2, 0x1
invoke-direct {v1, p1, v2}, Lcom/lytefast/flexinput/utils/SelectionCoordinator$a;-><init>(Ljava/lang/Object;Z)V
invoke-virtual {v0, p2, v1}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->notifyItemChanged(ILjava/lang/Object;)V
:cond_0
iget-object p2, p0, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->c:Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;
invoke-interface {p2, p1}, Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;->onItemSelected(Ljava/lang/Object;)V
return-void
.end method
.method public final d(Ljava/lang/Object;)Z
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(TI;)Z"
}
.end annotation
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->b:Landroidx/collection/ArrayMap;
if-eqz v0, :cond_2
invoke-static {v0}, Lj0/n/c/u;->asMutableMap(Ljava/lang/Object;)Ljava/util/Map;
move-result-object v0
invoke-interface {v0, p1}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/Integer;
const/4 v1, 0x0
if-eqz v0, :cond_1
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
move-result v0
iget-object v2, p0, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->a:Landroidx/recyclerview/widget/RecyclerView$Adapter;
if-eqz v2, :cond_0
new-instance v3, Lcom/lytefast/flexinput/utils/SelectionCoordinator$a;
invoke-direct {v3, p1, v1}, Lcom/lytefast/flexinput/utils/SelectionCoordinator$a;-><init>(Ljava/lang/Object;Z)V
invoke-virtual {v2, v0, v3}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->notifyItemChanged(ILjava/lang/Object;)V
:cond_0
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->c:Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;
invoke-interface {v0, p1}, Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;->onItemUnselected(Ljava/lang/Object;)V
const/4 p1, 0x1
return p1
:cond_1
return v1
:cond_2
new-instance p1, Lkotlin/TypeCastException;
const-string v0, "null cannot be cast to non-null type kotlin.collections.MutableMap<K, V>"
invoke-direct {p1, v0}, Lkotlin/TypeCastException;-><init>(Ljava/lang/String;)V
throw p1
.end method