2020-05-17 12:40:10 +00:00
|
|
|
.class public abstract Lcom/discord/utilities/mg_recycler/CategoricalDragAndDropAdapter;
|
|
|
|
.super Lcom/discord/utilities/mg_recycler/DragAndDropAdapter;
|
|
|
|
.source "CategoricalDragAndDropAdapter.kt"
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
|
|
value = {
|
|
|
|
Lcom/discord/utilities/mg_recycler/CategoricalDragAndDropAdapter$Payload;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"<T::",
|
|
|
|
"Lcom/discord/utilities/mg_recycler/CategoricalDragAndDropAdapter$Payload;",
|
|
|
|
">",
|
|
|
|
"Lcom/discord/utilities/mg_recycler/DragAndDropAdapter<",
|
|
|
|
"TT;>;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public constructor <init>(Landroidx/recyclerview/widget/RecyclerView;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/mg_recycler/DragAndDropAdapter;-><init>(Landroidx/recyclerview/widget/RecyclerView;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public computeChangedPositions()Ljava/util/Map;
|
|
|
|
.locals 8
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"()",
|
|
|
|
"Ljava/util/Map<",
|
|
|
|
"Ljava/lang/String;",
|
|
|
|
"Ljava/lang/Integer;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/mg_recycler/DragAndDropAdapter;->getDataCopy()Ljava/util/List;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-interface {v1}, Ljava/util/List;->isEmpty()Z
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/mg_recycler/DragAndDropAdapter;->getDataCopy()Ljava/util/List;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
invoke-interface {v1, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
check-cast v1, Lcom/discord/utilities/mg_recycler/CategoricalDragAndDropAdapter$Payload;
|
|
|
|
|
|
|
|
invoke-interface {v1}, Lcom/discord/utilities/mg_recycler/CategoricalDragAndDropAdapter$Payload;->getCategory()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/mg_recycler/DragAndDropAdapter;->getDataCopy()Ljava/util/List;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
invoke-interface {v3}, Ljava/util/List;->size()I
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const/4 v4, 0x0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const/4 v5, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
2020-07-08 16:44:49 +00:00
|
|
|
if-ge v4, v3, :cond_4
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/mg_recycler/DragAndDropAdapter;->getDataCopy()Ljava/util/List;
|
|
|
|
|
|
|
|
move-result-object v6
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-interface {v6, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v6
|
|
|
|
|
|
|
|
check-cast v6, Lcom/discord/utilities/mg_recycler/CategoricalDragAndDropAdapter$Payload;
|
|
|
|
|
|
|
|
invoke-interface {v6}, Lcom/discord/utilities/mg_recycler/CategoricalDragAndDropAdapter$Payload;->getCategory()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v7
|
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-static {v7, v1}, Lc0/n/c/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result v7
|
|
|
|
|
|
|
|
xor-int/lit8 v7, v7, 0x1
|
|
|
|
|
|
|
|
if-eqz v7, :cond_1
|
|
|
|
|
|
|
|
invoke-interface {v6}, Lcom/discord/utilities/mg_recycler/CategoricalDragAndDropAdapter$Payload;->getCategory()Ljava/lang/String;
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
move-result-object v1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const/4 v5, 0x0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
invoke-interface {v6}, Lcom/discord/utilities/mg_recycler/MGRecyclerDataPayload;->getKey()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v6
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const-string v7, "item.getKey()"
|
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-static {v6, v7}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-07-08 16:44:49 +00:00
|
|
|
|
2020-05-17 12:40:10 +00:00
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/mg_recycler/DragAndDropAdapter;->getOrigPositions()Ljava/util/Map;
|
|
|
|
|
|
|
|
move-result-object v7
|
|
|
|
|
|
|
|
invoke-interface {v7, v6}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v7
|
|
|
|
|
|
|
|
check-cast v7, Ljava/lang/Integer;
|
|
|
|
|
|
|
|
if-nez v7, :cond_2
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
invoke-virtual {v7}, Ljava/lang/Integer;->intValue()I
|
|
|
|
|
|
|
|
move-result v7
|
|
|
|
|
|
|
|
if-eq v7, v5, :cond_3
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object v7
|
|
|
|
|
|
|
|
invoke-interface {v0, v6, v7}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
add-int/lit8 v5, v5, 0x1
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
add-int/lit8 v4, v4, 0x1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public isValidMove(II)Z
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/mg_recycler/DragAndDropAdapter;->getDataCopy()Ljava/util/List;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Lcom/discord/utilities/mg_recycler/CategoricalDragAndDropAdapter$Payload;
|
|
|
|
|
|
|
|
invoke-interface {v0}, Lcom/discord/utilities/mg_recycler/CategoricalDragAndDropAdapter$Payload;->getCategory()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Math;->min(II)I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Math;->max(II)I
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
new-instance p2, Lkotlin/ranges/IntRange;
|
|
|
|
|
|
|
|
invoke-direct {p2, v1, p1}, Lkotlin/ranges/IntRange;-><init>(II)V
|
|
|
|
|
|
|
|
instance-of p1, p2, Ljava/util/Collection;
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
|
|
|
|
move-object p1, p2
|
|
|
|
|
|
|
|
check-cast p1, Ljava/util/Collection;
|
|
|
|
|
|
|
|
invoke-interface {p1}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-interface {p2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
|
|
|
|
move-result p2
|
|
|
|
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
|
|
|
|
move-object p2, p1
|
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
check-cast p2, Lc0/i/o;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-virtual {p2}, Lc0/i/o;->nextInt()I
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result p2
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/mg_recycler/DragAndDropAdapter;->getDataCopy()Ljava/util/List;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-interface {v2, p2}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
check-cast p2, Lcom/discord/utilities/mg_recycler/CategoricalDragAndDropAdapter$Payload;
|
|
|
|
|
|
|
|
invoke-interface {p2}, Lcom/discord/utilities/mg_recycler/CategoricalDragAndDropAdapter$Payload;->getCategory()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-static {p2, v0}, Lc0/n/c/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result p2
|
|
|
|
|
|
|
|
xor-int/2addr p2, v1
|
|
|
|
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
:goto_0
|
|
|
|
return v1
|
|
|
|
.end method
|