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

1011 lines
30 KiB
Smali

.class public Lcom/lytefast/flexinput/utils/SelectionAggregator;
.super Ljava/lang/Object;
.source "SelectionAggregator.kt"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/lytefast/flexinput/utils/SelectionAggregator$Companion;
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Lcom/lytefast/flexinput/model/Attachment<",
"+",
"Ljava/lang/Object;",
">;>",
"Ljava/lang/Object;"
}
.end annotation
# static fields
.field public static final Companion:Lcom/lytefast/flexinput/utils/SelectionAggregator$Companion;
.field public static final TAG:Ljava/lang/String;
# instance fields
.field public final adapter:Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter<",
"TT;>;"
}
.end annotation
.end field
.field public final attachments:Ljava/util/ArrayList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayList<",
"TT;>;"
}
.end annotation
.end field
.field public final childSelectionCoordinators:Ljava/util/ArrayList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayList<",
"Lcom/lytefast/flexinput/utils/SelectionCoordinator<",
"TT;*>;>;"
}
.end annotation
.end field
.field public itemSelectionListeners:Ljava/util/ArrayList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayList<",
"Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener<",
"TT;>;>;"
}
.end annotation
.end field
# direct methods
.method public static constructor <clinit>()V
.locals 2
new-instance v0, Lcom/lytefast/flexinput/utils/SelectionAggregator$Companion;
const/4 v1, 0x0
invoke-direct {v0, v1}, Lcom/lytefast/flexinput/utils/SelectionAggregator$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
sput-object v0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->Companion:Lcom/lytefast/flexinput/utils/SelectionAggregator$Companion;
const-class v0, Lcom/lytefast/flexinput/utils/SelectionAggregator;
invoke-virtual {v0}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Lk0/n/c/i;->checkNotNull(Ljava/lang/Object;)V
const-string v1, "SelectionAggregator::class.java.canonicalName!!"
invoke-static {v0, v1}, Lk0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
sput-object v0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->TAG:Ljava/lang/String;
return-void
.end method
.method public constructor <init>(Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;)V
.locals 7
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter<",
"TT;>;)V"
}
.end annotation
const/4 v2, 0x0
const/4 v3, 0x0
const/4 v4, 0x0
const/16 v5, 0xe
const/4 v6, 0x0
move-object v0, p0
move-object v1, p1
invoke-direct/range {v0 .. v6}, Lcom/lytefast/flexinput/utils/SelectionAggregator;-><init>(Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
return-void
.end method
.method public constructor <init>(Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;Ljava/util/ArrayList;)V
.locals 7
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter<",
"TT;>;",
"Ljava/util/ArrayList<",
"TT;>;)V"
}
.end annotation
const/4 v3, 0x0
const/4 v4, 0x0
const/16 v5, 0xc
const/4 v6, 0x0
move-object v0, p0
move-object v1, p1
move-object v2, p2
invoke-direct/range {v0 .. v6}, Lcom/lytefast/flexinput/utils/SelectionAggregator;-><init>(Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
return-void
.end method
.method public constructor <init>(Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;Ljava/util/ArrayList;Ljava/util/ArrayList;)V
.locals 7
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter<",
"TT;>;",
"Ljava/util/ArrayList<",
"TT;>;",
"Ljava/util/ArrayList<",
"Lcom/lytefast/flexinput/utils/SelectionCoordinator<",
"TT;*>;>;)V"
}
.end annotation
const/4 v4, 0x0
const/16 v5, 0x8
const/4 v6, 0x0
move-object v0, p0
move-object v1, p1
move-object v2, p2
move-object v3, p3
invoke-direct/range {v0 .. v6}, Lcom/lytefast/flexinput/utils/SelectionAggregator;-><init>(Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
return-void
.end method
.method public constructor <init>(Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;)V
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter<",
"TT;>;",
"Ljava/util/ArrayList<",
"TT;>;",
"Ljava/util/ArrayList<",
"Lcom/lytefast/flexinput/utils/SelectionCoordinator<",
"TT;*>;>;",
"Ljava/util/ArrayList<",
"Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener<",
"TT;>;>;)V"
}
.end annotation
const-string v0, "adapter"
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "attachments"
invoke-static {p2, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "childSelectionCoordinators"
invoke-static {p3, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "itemSelectionListeners"
invoke-static {p4, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->adapter:Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;
iput-object p2, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->attachments:Ljava/util/ArrayList;
iput-object p3, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->childSelectionCoordinators:Ljava/util/ArrayList;
iput-object p4, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->itemSelectionListeners:Ljava/util/ArrayList;
return-void
.end method
.method public synthetic constructor <init>(Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
.locals 1
and-int/lit8 p6, p5, 0x2
if-eqz p6, :cond_0
new-instance p2, Ljava/util/ArrayList;
invoke-direct {p2}, Ljava/util/ArrayList;-><init>()V
:cond_0
and-int/lit8 p6, p5, 0x4
const/4 v0, 0x4
if-eqz p6, :cond_1
new-instance p3, Ljava/util/ArrayList;
invoke-direct {p3, v0}, Ljava/util/ArrayList;-><init>(I)V
:cond_1
and-int/lit8 p5, p5, 0x8
if-eqz p5, :cond_2
new-instance p4, Ljava/util/ArrayList;
invoke-direct {p4, v0}, Ljava/util/ArrayList;-><init>(I)V
:cond_2
invoke-direct {p0, p1, p2, p3, p4}, Lcom/lytefast/flexinput/utils/SelectionAggregator;-><init>(Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;)V
return-void
.end method
.method public static final synthetic access$addItem(Lcom/lytefast/flexinput/utils/SelectionAggregator;Lcom/lytefast/flexinput/model/Attachment;)V
.locals 0
invoke-direct {p0, p1}, Lcom/lytefast/flexinput/utils/SelectionAggregator;->addItem(Lcom/lytefast/flexinput/model/Attachment;)V
return-void
.end method
.method public static final synthetic access$getTAG$cp()Ljava/lang/String;
.locals 1
sget-object v0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->TAG:Ljava/lang/String;
return-object v0
.end method
.method public static final synthetic access$removeItem(Lcom/lytefast/flexinput/utils/SelectionAggregator;Lcom/lytefast/flexinput/model/Attachment;)Z
.locals 0
invoke-direct {p0, p1}, Lcom/lytefast/flexinput/utils/SelectionAggregator;->removeItem(Lcom/lytefast/flexinput/model/Attachment;)Z
move-result p0
return p0
.end method
.method private final addItem(Lcom/lytefast/flexinput/model/Attachment;)V
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(TT;)V"
}
.end annotation
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->attachments:Ljava/util/ArrayList;
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_0
return-void
:cond_0
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->attachments:Ljava/util/ArrayList;
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->attachments:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
move-result v0
add-int/lit8 v0, v0, -0x1
iget-object v1, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->adapter:Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;
invoke-virtual {v1, v0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->notifyItemInserted(I)V
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->itemSelectionListeners:Ljava/util/ArrayList;
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object v0
:goto_0
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/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;
invoke-interface {v1, p1}, Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;->onItemSelected(Ljava/lang/Object;)V
goto :goto_0
:cond_1
return-void
.end method
.method private final removeItem(Lcom/lytefast/flexinput/model/Attachment;)Z
.locals 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(TT;)Z"
}
.end annotation
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->attachments:Ljava/util/ArrayList;
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->indexOf(Ljava/lang/Object;)I
move-result v0
iget-object v1, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->attachments:Ljava/util/ArrayList;
invoke-virtual {v1, p1}, Ljava/util/ArrayList;->remove(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
iget-object v2, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->adapter:Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;
invoke-virtual {v2, v0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->notifyItemRemoved(I)V
:cond_0
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->itemSelectionListeners:Ljava/util/ArrayList;
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object v0
:goto_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_1
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;
invoke-interface {v2, p1}, Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;->onItemUnselected(Ljava/lang/Object;)V
goto :goto_0
:cond_1
return v1
.end method
# virtual methods
.method public final addItemSelectionListener(Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;)Lcom/lytefast/flexinput/utils/SelectionAggregator;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener<",
"-TT;>;)",
"Lcom/lytefast/flexinput/utils/SelectionAggregator<",
"TT;>;"
}
.end annotation
const-string v0, "itemSelectionListener"
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->itemSelectionListeners:Ljava/util/ArrayList;
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z
move-result v0
if-nez v0, :cond_0
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->itemSelectionListeners:Ljava/util/ArrayList;
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
:cond_0
return-object p0
.end method
.method public final clear()V
.locals 5
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->attachments:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->childSelectionCoordinators:Ljava/util/ArrayList;
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object v0
:cond_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_2
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/lytefast/flexinput/utils/SelectionCoordinator;
if-eqz v1, :cond_1
new-instance v2, Ljava/util/ArrayList;
iget-object v3, v1, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->b:Landroidx/collection/ArrayMap;
invoke-virtual {v3}, Landroidx/collection/ArrayMap;->values()Ljava/util/Collection;
move-result-object v3
invoke-direct {v2, v3}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
iget-object v3, v1, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->b:Landroidx/collection/ArrayMap;
invoke-virtual {v3}, Landroidx/collection/SimpleArrayMap;->clear()V
iget-object v1, v1, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->a:Landroidx/recyclerview/widget/RecyclerView$Adapter;
if-eqz v1, :cond_0
invoke-virtual {v2}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
move-result-object v2
:goto_0
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_0
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
check-cast v3, Ljava/lang/Integer;
const-string v4, "position"
invoke-static {v3, v4}, Lk0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I
move-result v3
invoke-virtual {v1, v3}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->notifyItemChanged(I)V
goto :goto_0
:cond_1
const/4 v0, 0x0
throw v0
:cond_2
return-void
.end method
.method public final get(I)Lcom/lytefast/flexinput/model/Attachment;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(I)TT;"
}
.end annotation
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->attachments:Ljava/util/ArrayList;
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object p1
const-string v0, "attachments[position]"
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
check-cast p1, Lcom/lytefast/flexinput/model/Attachment;
return-object p1
.end method
.method public final getAdapter()Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter<",
"TT;>;"
}
.end annotation
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->adapter:Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;
return-object v0
.end method
.method public final getAttachments()Ljava/util/ArrayList;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/ArrayList<",
"TT;>;"
}
.end annotation
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->attachments:Ljava/util/ArrayList;
return-object v0
.end method
.method public final getChildSelectionCoordinators()Ljava/util/ArrayList;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/ArrayList<",
"Lcom/lytefast/flexinput/utils/SelectionCoordinator<",
"TT;*>;>;"
}
.end annotation
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->childSelectionCoordinators:Ljava/util/ArrayList;
return-object v0
.end method
.method public final getItemSelectionListeners()Ljava/util/ArrayList;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/ArrayList<",
"Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener<",
"TT;>;>;"
}
.end annotation
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->itemSelectionListeners:Ljava/util/ArrayList;
return-object v0
.end method
.method public final getSize()I
.locals 1
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->attachments:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
move-result v0
return v0
.end method
.method public final initFrom(Lcom/lytefast/flexinput/utils/SelectionAggregator;)Lcom/lytefast/flexinput/utils/SelectionAggregator;
.locals 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/lytefast/flexinput/utils/SelectionAggregator<",
"TT;>;)",
"Lcom/lytefast/flexinput/utils/SelectionAggregator<",
"TT;>;"
}
.end annotation
if-eqz p1, :cond_1
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->attachments:Ljava/util/ArrayList;
iget-object v1, p1, Lcom/lytefast/flexinput/utils/SelectionAggregator;->attachments:Ljava/util/ArrayList;
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z
iget-object v0, p1, Lcom/lytefast/flexinput/utils/SelectionAggregator;->childSelectionCoordinators:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
move-result-object v0
:goto_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_0
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/lytefast/flexinput/utils/SelectionCoordinator;
const-string v2, "coordinator"
invoke-static {v1, v2}, Lk0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {p0, v1}, Lcom/lytefast/flexinput/utils/SelectionAggregator;->registerSelectionCoordinatorInternal(Lcom/lytefast/flexinput/utils/SelectionCoordinator;)V
goto :goto_0
:cond_0
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->itemSelectionListeners:Ljava/util/ArrayList;
iget-object p1, p1, Lcom/lytefast/flexinput/utils/SelectionAggregator;->itemSelectionListeners:Ljava/util/ArrayList;
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z
:cond_1
return-object p0
.end method
.method public final initFrom(Ljava/util/ArrayList;)Lcom/lytefast/flexinput/utils/SelectionAggregator;
.locals 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/ArrayList<",
"-",
"Landroid/os/Parcelable;",
">;)",
"Lcom/lytefast/flexinput/utils/SelectionAggregator<",
"TT;>;"
}
.end annotation
const-string v0, "savedAttachments"
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
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_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, Lcom/lytefast/flexinput/model/Attachment;
if-nez v2, :cond_1
const/4 v1, 0x0
:cond_1
check-cast v1, Lcom/lytefast/flexinput/model/Attachment;
if-eqz v1, :cond_0
invoke-interface {v0, v1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
goto :goto_0
:cond_2
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object p1
:goto_1
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_3
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/lytefast/flexinput/model/Attachment;
invoke-virtual {p0, v0}, Lcom/lytefast/flexinput/utils/SelectionAggregator;->toggleItemInternal(Lcom/lytefast/flexinput/model/Attachment;)Z
goto :goto_1
:cond_3
return-object p0
.end method
.method public final registerSelectionCoordinator(Lcom/lytefast/flexinput/utils/SelectionCoordinator;)V
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/lytefast/flexinput/utils/SelectionCoordinator<",
"TT;*>;)V"
}
.end annotation
const-string v0, "selectionCoordinator"
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {p0, p1}, Lcom/lytefast/flexinput/utils/SelectionAggregator;->registerSelectionCoordinatorInternal(Lcom/lytefast/flexinput/utils/SelectionCoordinator;)V
:try_start_0
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->attachments:Ljava/util/ArrayList;
const-string v1, "selectedItems"
invoke-static {v0, v1}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
iget-object v1, p1, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->a:Landroidx/recyclerview/widget/RecyclerView$Adapter;
if-nez v1, :cond_2
invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
move-result-object v0
:cond_0
:goto_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_3
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
instance-of v2, v1, Ljava/lang/Object;
if-nez v2, :cond_1
const/4 v1, 0x0
:cond_1
if-eqz v1, :cond_0
iget-object v2, p1, 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
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
:try_end_0
.catch Lcom/lytefast/flexinput/utils/SelectionCoordinator$RestorationException; {:try_start_0 .. :try_end_0} :catch_0
:catch_0
move-exception p1
sget-object v0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->TAG:Ljava/lang/String;
const-string v1, "selections could not be synced"
invoke-static {v0, v1, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
:cond_3
return-void
.end method
.method public registerSelectionCoordinatorInternal(Lcom/lytefast/flexinput/utils/SelectionCoordinator;)V
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/lytefast/flexinput/utils/SelectionCoordinator<",
"TT;*>;)V"
}
.end annotation
const-string v0, "selectionCoordinator"
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
new-instance v0, Lcom/lytefast/flexinput/utils/SelectionAggregator$a;
invoke-direct {v0, p0, p1}, Lcom/lytefast/flexinput/utils/SelectionAggregator$a;-><init>(Lcom/lytefast/flexinput/utils/SelectionAggregator;Lcom/lytefast/flexinput/utils/SelectionCoordinator;)V
const-string v1, "<set-?>"
invoke-static {v0, v1}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
iput-object v0, p1, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->c:Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->childSelectionCoordinators:Ljava/util/ArrayList;
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
return-void
.end method
.method public final removeItemSelectionListener(Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener;)V
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener<",
"*>;)V"
}
.end annotation
const-string v0, "itemSelectionListener"
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->itemSelectionListeners:Ljava/util/ArrayList;
if-eqz v0, :cond_0
invoke-static {v0}, Lk0/n/c/v;->asMutableCollection(Ljava/lang/Object;)Ljava/util/Collection;
move-result-object v0
invoke-interface {v0, p1}, Ljava/util/Collection;->remove(Ljava/lang/Object;)Z
return-void
:cond_0
new-instance p1, Ljava/lang/NullPointerException;
const-string v0, "null cannot be cast to non-null type kotlin.collections.MutableCollection<T>"
invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public final setItemSelectionListeners(Ljava/util/ArrayList;)V
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/ArrayList<",
"Lcom/lytefast/flexinput/utils/SelectionCoordinator$ItemSelectionListener<",
"TT;>;>;)V"
}
.end annotation
const-string v0, "<set-?>"
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
iput-object p1, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->itemSelectionListeners:Ljava/util/ArrayList;
return-void
.end method
.method public final toggleItemInternal(Lcom/lytefast/flexinput/model/Attachment;)Z
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(TT;)Z"
}
.end annotation
const-string v0, "item"
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
invoke-direct {p0, p1}, Lcom/lytefast/flexinput/utils/SelectionAggregator;->removeItem(Lcom/lytefast/flexinput/model/Attachment;)Z
move-result v0
if-nez v0, :cond_0
invoke-direct {p0, p1}, Lcom/lytefast/flexinput/utils/SelectionAggregator;->addItem(Lcom/lytefast/flexinput/model/Attachment;)V
:cond_0
return v0
.end method
.method public final unselectItem(Lcom/lytefast/flexinput/model/Attachment;)V
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(TT;)V"
}
.end annotation
const-string v0, "item"
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
iget-object v0, p0, Lcom/lytefast/flexinput/utils/SelectionAggregator;->childSelectionCoordinators:Ljava/util/ArrayList;
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object v0
:goto_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_0
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/lytefast/flexinput/utils/SelectionCoordinator;
invoke-virtual {v1, p1}, Lcom/lytefast/flexinput/utils/SelectionCoordinator;->c(Ljava/lang/Object;)Z
goto :goto_0
:cond_0
invoke-direct {p0, p1}, Lcom/lytefast/flexinput/utils/SelectionAggregator;->removeItem(Lcom/lytefast/flexinput/model/Attachment;)Z
return-void
.end method