511 lines
14 KiB
Smali
511 lines
14 KiB
Smali
.class public final Lcom/discord/views/FailedUploadList;
|
|
.super Landroid/widget/LinearLayout;
|
|
.source "FailedUploadList.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/views/FailedUploadList$a;,
|
|
Lcom/discord/views/FailedUploadList$b;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final synthetic e:[Lkotlin/reflect/KProperty;
|
|
|
|
|
|
# instance fields
|
|
.field public final d:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 5
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [Lkotlin/reflect/KProperty;
|
|
|
|
const-class v1, Lcom/discord/views/FailedUploadList;
|
|
|
|
const-string v2, "failedUploadViews"
|
|
|
|
const-string v3, "getFailedUploadViews()Ljava/util/List;"
|
|
|
|
const/4 v4, 0x0
|
|
|
|
invoke-static {v1, v2, v3, v4}, Lf/e/c/a/a;->L(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)Lc0/n/c/s;
|
|
|
|
move-result-object v1
|
|
|
|
aput-object v1, v0, v4
|
|
|
|
sput-object v0, Lcom/discord/views/FailedUploadList;->e:[Lkotlin/reflect/KProperty;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
const/4 p1, 0x3
|
|
|
|
new-array p1, p1, [I
|
|
|
|
fill-array-data p1, :array_0
|
|
|
|
const-string p2, "$this$bindViews"
|
|
|
|
invoke-static {p0, p2}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string p2, "ids"
|
|
|
|
invoke-static {p1, p2}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
sget-object p2, Le0/d;->d:Le0/d;
|
|
|
|
invoke-static {p1, p2}, Lc0/j/a;->K([ILkotlin/jvm/functions/Function2;)Le0/h;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/views/FailedUploadList;->d:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
invoke-virtual {p0}, Landroid/widget/LinearLayout;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
const p2, 0x7f0d011f
|
|
|
|
invoke-static {p1, p2, p0}, Landroid/widget/LinearLayout;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
|
|
|
|
return-void
|
|
|
|
:array_0
|
|
.array-data 4
|
|
0x7f0a0276
|
|
0x7f0a0277
|
|
0x7f0a0278
|
|
.end array-data
|
|
.end method
|
|
|
|
.method private final getFailedUploadViews()Ljava/util/List;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/views/FailedUploadView;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/views/FailedUploadList;->d:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
sget-object v1, Lcom/discord/views/FailedUploadList;->e:[Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aget-object v1, v1, v2
|
|
|
|
invoke-interface {v0, p0, v1}, Lkotlin/properties/ReadOnlyProperty;->getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/List;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final setUp(Ljava/util/List;)V
|
|
.locals 10
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/models/messages/LocalAttachment;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "localAttachments"
|
|
|
|
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0}, Lcom/discord/views/FailedUploadList;->getFailedUploadViews()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
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/discord/views/FailedUploadView;
|
|
|
|
const/16 v2, 0x8
|
|
|
|
invoke-virtual {v1, v2}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-interface {p1}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
xor-int/2addr v0, v1
|
|
|
|
if-eqz v0, :cond_6
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
const/16 v2, 0xa
|
|
|
|
invoke-static {p1, v2}, Lf/h/a/f/f/n/f;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
|
|
|
move-result v3
|
|
|
|
invoke-direct {v0, v3}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_1
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Lcom/discord/models/messages/LocalAttachment;
|
|
|
|
invoke-static {v3}, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->toAttachment(Lcom/discord/models/messages/LocalAttachment;)Lcom/lytefast/flexinput/model/Attachment;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v0, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result p1
|
|
|
|
const/4 v3, 0x3
|
|
|
|
const-string v4, "context.contentResolver"
|
|
|
|
const-string v5, "context"
|
|
|
|
if-gt p1, v3, :cond_3
|
|
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
invoke-static {v0, v2}, Lf/h/a/f/f/n/f;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
|
|
|
move-result v2
|
|
|
|
invoke-direct {p1, v2}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_2
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/lytefast/flexinput/model/Attachment;
|
|
|
|
new-instance v3, Lcom/discord/views/FailedUploadList$a;
|
|
|
|
invoke-virtual {v2}, Lcom/lytefast/flexinput/model/Attachment;->getDisplayName()Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-virtual {v2}, Lcom/lytefast/flexinput/model/Attachment;->getUri()Landroid/net/Uri;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-virtual {p0}, Landroid/widget/LinearLayout;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v8
|
|
|
|
invoke-static {v8, v5}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
|
|
|
|
move-result-object v8
|
|
|
|
invoke-static {v8, v4}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v7, v8}, Lcom/discord/utilities/rest/SendUtilsKt;->computeFileSizeBytes(Landroid/net/Uri;Landroid/content/ContentResolver;)J
|
|
|
|
move-result-wide v7
|
|
|
|
invoke-virtual {p0}, Landroid/widget/LinearLayout;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v9
|
|
|
|
invoke-static {v9, v5}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v9}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
|
|
|
|
move-result-object v9
|
|
|
|
invoke-static {v2, v9}, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->getMimeType(Lcom/lytefast/flexinput/model/Attachment;Landroid/content/ContentResolver;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-direct {v3, v6, v7, v8, v2}, Lcom/discord/views/FailedUploadList$a;-><init>(Ljava/lang/String;JLjava/lang/String;)V
|
|
|
|
invoke-virtual {p1, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
new-instance v0, Lcom/discord/views/FailedUploadList$b$a;
|
|
|
|
invoke-direct {v0, p1}, Lcom/discord/views/FailedUploadList$b$a;-><init>(Ljava/util/List;)V
|
|
|
|
goto :goto_4
|
|
|
|
:cond_3
|
|
const-wide/16 v2, 0x0
|
|
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
: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
|
|
|
|
check-cast v6, Lcom/lytefast/flexinput/model/Attachment;
|
|
|
|
invoke-virtual {v6}, Lcom/lytefast/flexinput/model/Attachment;->getUri()Landroid/net/Uri;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-virtual {p0}, Landroid/widget/LinearLayout;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-static {v7, v5}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v7}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-static {v7, v4}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v6, v7}, Lcom/discord/utilities/rest/SendUtilsKt;->computeFileSizeBytes(Landroid/net/Uri;Landroid/content/ContentResolver;)J
|
|
|
|
move-result-wide v6
|
|
|
|
add-long/2addr v2, v6
|
|
|
|
goto :goto_3
|
|
|
|
:cond_4
|
|
new-instance p1, Lcom/discord/views/FailedUploadList$b$b;
|
|
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v0
|
|
|
|
invoke-direct {p1, v0, v2, v3}, Lcom/discord/views/FailedUploadList$b$b;-><init>(IJ)V
|
|
|
|
move-object v0, p1
|
|
|
|
:goto_4
|
|
nop
|
|
|
|
instance-of p1, v0, Lcom/discord/views/FailedUploadList$b$a;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
check-cast v0, Lcom/discord/views/FailedUploadList$b$a;
|
|
|
|
iget-object p1, v0, Lcom/discord/views/FailedUploadList$b$a;->a:Ljava/util/List;
|
|
|
|
invoke-interface {p1}, Ljava/util/Collection;->size()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_5
|
|
if-ge v1, v0, :cond_6
|
|
|
|
invoke-interface {p1, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Lcom/discord/views/FailedUploadList$a;
|
|
|
|
invoke-direct {p0}, Lcom/discord/views/FailedUploadList;->getFailedUploadViews()Ljava/util/List;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-interface {v4, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Lcom/discord/views/FailedUploadView;
|
|
|
|
invoke-virtual {v4, v2}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
iget-object v6, v3, Lcom/discord/views/FailedUploadList$a;->a:Ljava/lang/String;
|
|
|
|
invoke-virtual {v4}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-static {v7, v5}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iget-object v8, v3, Lcom/discord/views/FailedUploadList$a;->c:Ljava/lang/String;
|
|
|
|
invoke-static {v7, v8}, Lcom/discord/utilities/file/FileUtilsKt;->getIconForFiletype(Landroid/content/Context;Ljava/lang/String;)I
|
|
|
|
move-result v7
|
|
|
|
iget-wide v8, v3, Lcom/discord/views/FailedUploadList$a;->b:J
|
|
|
|
invoke-static {v8, v9}, Lcom/discord/utilities/file/FileUtilsKt;->getSizeSubtitle(J)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v4, v6, v7, v3}, Lcom/discord/views/FailedUploadView;->a(Ljava/lang/String;ILjava/lang/String;)V
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_5
|
|
|
|
:cond_5
|
|
instance-of p1, v0, Lcom/discord/views/FailedUploadList$b$b;
|
|
|
|
if-eqz p1, :cond_6
|
|
|
|
check-cast v0, Lcom/discord/views/FailedUploadList$b$b;
|
|
|
|
iget p1, v0, Lcom/discord/views/FailedUploadList$b$b;->a:I
|
|
|
|
iget-wide v3, v0, Lcom/discord/views/FailedUploadList$b$b;->b:J
|
|
|
|
invoke-direct {p0}, Lcom/discord/views/FailedUploadList;->getFailedUploadViews()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lc0/i/f;->first(Ljava/util/List;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/view/View;
|
|
|
|
invoke-virtual {v0, v2}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
invoke-direct {p0}, Lcom/discord/views/FailedUploadList;->getFailedUploadViews()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lc0/i/f;->first(Ljava/util/List;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/discord/views/FailedUploadView;
|
|
|
|
invoke-virtual {v0}, Landroid/view/ViewGroup;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v6
|
|
|
|
const-string v7, "resources"
|
|
|
|
invoke-static {v6, v7}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-static {v7, v5}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v8
|
|
|
|
aput-object v8, v1, v2
|
|
|
|
const v8, 0x7f10010a
|
|
|
|
invoke-static {v6, v7, v8, p1, v1}, Lcom/discord/utilities/resources/StringResourceUtilsKt;->getQuantityString(Landroid/content/res/Resources;Landroid/content/Context;II[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1, v5}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const v5, 0x7f040314
|
|
|
|
const/4 v6, 0x2
|
|
|
|
const/4 v7, 0x0
|
|
|
|
invoke-static {v1, v5, v2, v6, v7}, Lcom/discord/utilities/drawable/DrawableCompat;->getThemedDrawableRes$default(Landroid/content/Context;IIILjava/lang/Object;)I
|
|
|
|
move-result v1
|
|
|
|
invoke-static {v3, v4}, Lcom/discord/utilities/file/FileUtilsKt;->getSizeSubtitle(J)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v0, p1, v1, v2}, Lcom/discord/views/FailedUploadView;->a(Ljava/lang/String;ILjava/lang/String;)V
|
|
|
|
:cond_6
|
|
return-void
|
|
.end method
|