924 lines
32 KiB
Smali
924 lines
32 KiB
Smali
.class public final Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;
|
|
.super Lcom/discord/widgets/chat/list/WidgetChatListItem;
|
|
.source "WidgetChatListAdapterItemAttachment.kt"
|
|
|
|
# interfaces
|
|
.implements Lcom/discord/widgets/chat/list/FragmentLifecycleListener;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Model;,
|
|
Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Companion;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final synthetic $$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
.field public static final Companion:Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Companion;
|
|
|
|
|
|
# instance fields
|
|
.field public final card$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
.field public final fileDescription$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
.field public final fileDownload$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
.field public final fileIcon$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
.field public final fileName$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
.field public final inlineMedia$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
.field public final maxAttachmentImageWidth:I
|
|
|
|
.field public final spoilerView$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
.field public subscription:Lrx/Subscription;
|
|
|
|
.field public final userSettings:Lcom/discord/stores/StoreUserSettings;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 5
|
|
|
|
const-class v0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;
|
|
|
|
const/4 v1, 0x7
|
|
|
|
new-array v1, v1, [Lkotlin/reflect/KProperty;
|
|
|
|
const-string v2, "inlineMedia"
|
|
|
|
const-string v3, "getInlineMedia()Lcom/discord/widgets/chat/list/InlineMediaView;"
|
|
|
|
const/4 v4, 0x0
|
|
|
|
invoke-static {v0, v2, v3, v4}, Lf/e/c/a/a;->M(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)Lb0/n/c/s;
|
|
|
|
move-result-object v2
|
|
|
|
aput-object v2, v1, v4
|
|
|
|
const-string v2, "card"
|
|
|
|
const-string v3, "getCard()Landroid/view/View;"
|
|
|
|
invoke-static {v0, v2, v3, v4}, Lf/e/c/a/a;->M(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)Lb0/n/c/s;
|
|
|
|
move-result-object v2
|
|
|
|
const/4 v3, 0x1
|
|
|
|
aput-object v2, v1, v3
|
|
|
|
const-string v2, "fileIcon"
|
|
|
|
const-string v3, "getFileIcon()Landroid/widget/ImageView;"
|
|
|
|
invoke-static {v0, v2, v3, v4}, Lf/e/c/a/a;->M(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)Lb0/n/c/s;
|
|
|
|
move-result-object v2
|
|
|
|
const/4 v3, 0x2
|
|
|
|
aput-object v2, v1, v3
|
|
|
|
const-string v2, "fileName"
|
|
|
|
const-string v3, "getFileName()Landroid/widget/TextView;"
|
|
|
|
invoke-static {v0, v2, v3, v4}, Lf/e/c/a/a;->M(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)Lb0/n/c/s;
|
|
|
|
move-result-object v2
|
|
|
|
const/4 v3, 0x3
|
|
|
|
aput-object v2, v1, v3
|
|
|
|
const-string v2, "fileDescription"
|
|
|
|
const-string v3, "getFileDescription()Landroid/widget/TextView;"
|
|
|
|
invoke-static {v0, v2, v3, v4}, Lf/e/c/a/a;->M(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)Lb0/n/c/s;
|
|
|
|
move-result-object v2
|
|
|
|
const/4 v3, 0x4
|
|
|
|
aput-object v2, v1, v3
|
|
|
|
const-string v2, "fileDownload"
|
|
|
|
const-string v3, "getFileDownload()Landroid/widget/ImageView;"
|
|
|
|
invoke-static {v0, v2, v3, v4}, Lf/e/c/a/a;->M(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)Lb0/n/c/s;
|
|
|
|
move-result-object v2
|
|
|
|
const/4 v3, 0x5
|
|
|
|
aput-object v2, v1, v3
|
|
|
|
const-string v2, "spoilerView"
|
|
|
|
const-string v3, "getSpoilerView()Landroid/widget/FrameLayout;"
|
|
|
|
invoke-static {v0, v2, v3, v4}, Lf/e/c/a/a;->M(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)Lb0/n/c/s;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v2, 0x6
|
|
|
|
aput-object v0, v1, v2
|
|
|
|
sput-object v1, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
new-instance v0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Companion;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sput-object v0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->Companion:Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Companion;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Lcom/discord/widgets/chat/list/WidgetChatListAdapter;)V
|
|
.locals 2
|
|
|
|
const-string v0, "adapter"
|
|
|
|
invoke-static {p1, v0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const v0, 0x7f0d01a5
|
|
|
|
invoke-direct {p0, v0, p1}, Lcom/discord/widgets/chat/list/WidgetChatListItem;-><init>(ILcom/discord/widgets/chat/list/WidgetChatListAdapter;)V
|
|
|
|
const p1, 0x7f0a023e
|
|
|
|
invoke-static {p0, p1}, Lb0/j/a;->j(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->inlineMedia$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
const p1, 0x7f0a023a
|
|
|
|
invoke-static {p0, p1}, Lb0/j/a;->j(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->card$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
const p1, 0x7f0a023d
|
|
|
|
invoke-static {p0, p1}, Lb0/j/a;->j(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->fileIcon$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
const p1, 0x7f0a023f
|
|
|
|
invoke-static {p0, p1}, Lb0/j/a;->j(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->fileName$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
const p1, 0x7f0a023b
|
|
|
|
invoke-static {p0, p1}, Lb0/j/a;->j(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->fileDescription$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
const p1, 0x7f0a023c
|
|
|
|
invoke-static {p0, p1}, Lb0/j/a;->j(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->fileDownload$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
const p1, 0x7f0a0240
|
|
|
|
invoke-static {p0, p1}, Lb0/j/a;->j(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->spoilerView$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getFileName()Landroid/widget/TextView;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object v0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$1;->INSTANCE:Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$1;
|
|
|
|
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V
|
|
|
|
sget-object p1, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/stores/StoreStream$Companion;->getUserSettings()Lcom/discord/stores/StoreUserSettings;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->userSettings:Lcom/discord/stores/StoreUserSettings;
|
|
|
|
sget-object p1, Lcom/discord/utilities/embed/EmbedResourceUtils;->INSTANCE:Lcom/discord/utilities/embed/EmbedResourceUtils;
|
|
|
|
iget-object v0, p0, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;
|
|
|
|
const-string v1, "itemView"
|
|
|
|
invoke-static {v0, v1}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Landroid/view/View;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "itemView.context"
|
|
|
|
invoke-static {v0, v1}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1, v0}, Lcom/discord/utilities/embed/EmbedResourceUtils;->computeMaximumImageWidthPx(Landroid/content/Context;)I
|
|
|
|
move-result p1
|
|
|
|
iput p1, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->maxAttachmentImageWidth:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$getAdapter$p(Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;)Lcom/discord/widgets/chat/list/WidgetChatListAdapter;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder;->adapter:Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;
|
|
|
|
check-cast p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapter;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getFileDownload$p(Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;)Landroid/widget/ImageView;
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getFileDownload()Landroid/widget/ImageView;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private final configureFileData(Lcom/discord/models/domain/ModelMessageAttachment;Lcom/discord/utilities/textprocessing/MessageRenderContext;)V
|
|
.locals 3
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getFileName()Landroid/widget/TextView;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageAttachment;->getFilename()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getFileDescription()Landroid/widget/TextView;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p2}, Lcom/discord/utilities/textprocessing/MessageRenderContext;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageAttachment;->getSize()Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "data.size"
|
|
|
|
invoke-static {v1, v2}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-static {p2, v1, v2}, Landroid/text/format/Formatter;->formatFileSize(Landroid/content/Context;J)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {v0, p2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getFileIcon()Landroid/widget/ImageView;
|
|
|
|
move-result-object p2
|
|
|
|
sget-object v0, Lcom/discord/utilities/embed/EmbedResourceUtils;->INSTANCE:Lcom/discord/utilities/embed/EmbedResourceUtils;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageAttachment;->getFilename()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lcom/discord/utilities/embed/EmbedResourceUtils;->getFileDrawable(Ljava/lang/String;)I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p2, v0}, Landroid/widget/ImageView;->setImageResource(I)V
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getFileDownload()Landroid/widget/ImageView;
|
|
|
|
move-result-object p2
|
|
|
|
const/4 v0, 0x1
|
|
|
|
invoke-virtual {p2, v0}, Landroid/widget/ImageView;->setEnabled(Z)V
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getFileDownload()Landroid/widget/ImageView;
|
|
|
|
move-result-object p2
|
|
|
|
const/high16 v0, 0x3f800000 # 1.0f
|
|
|
|
invoke-virtual {p2, v0}, Landroid/widget/ImageView;->setAlpha(F)V
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getFileDownload()Landroid/widget/ImageView;
|
|
|
|
move-result-object p2
|
|
|
|
new-instance v0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$configureFileData$1;
|
|
|
|
invoke-direct {v0, p0, p1}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$configureFileData$1;-><init>(Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;Lcom/discord/models/domain/ModelMessageAttachment;)V
|
|
|
|
invoke-virtual {p2, v0}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final configureUI(Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Model;)V
|
|
.locals 21
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
move-object/from16 v1, p1
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Model;->getAttachmentEntry()Lcom/discord/widgets/chat/list/entries/AttachmentEntry;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2}, Lcom/discord/widgets/chat/list/entries/AttachmentEntry;->getAttachment()Lcom/discord/models/domain/ModelMessageAttachment;
|
|
|
|
move-result-object v3
|
|
|
|
iget-object v4, v0, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;
|
|
|
|
const-string v5, "itemView"
|
|
|
|
const-string v6, "itemView.context"
|
|
|
|
invoke-static {v4, v5, v6}, Lf/e/c/a/a;->a0(Landroid/view/View;Ljava/lang/String;Ljava/lang/String;)Landroid/content/Context;
|
|
|
|
move-result-object v4
|
|
|
|
iget-object v5, v0, Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder;->adapter:Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;
|
|
|
|
check-cast v5, Lcom/discord/widgets/chat/list/WidgetChatListAdapter;
|
|
|
|
invoke-virtual {v5}, Lcom/discord/widgets/chat/list/WidgetChatListAdapter;->getEventHandler()Lcom/discord/widgets/chat/list/WidgetChatListAdapter$EventHandler;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v1, v4, v5}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Model;->createRenderContext(Landroid/content/Context;Lcom/discord/widgets/chat/list/WidgetChatListAdapter$EventHandler;)Lcom/discord/utilities/textprocessing/MessageRenderContext;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Model;->isSpoilerHidden()Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_0
|
|
|
|
invoke-direct/range {p0 .. p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getSpoilerView()Landroid/widget/FrameLayout;
|
|
|
|
move-result-object v6
|
|
|
|
const-wide/16 v7, 0x32
|
|
|
|
const/4 v9, 0x0
|
|
|
|
sget-object v10, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$configureUI$1;->INSTANCE:Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$configureUI$1;
|
|
|
|
const/4 v11, 0x0
|
|
|
|
const/16 v12, 0xa
|
|
|
|
const/4 v13, 0x0
|
|
|
|
invoke-static/range {v6 .. v13}, Lcom/discord/utilities/view/extensions/ViewExtensions;->fadeIn$default(Landroid/view/View;JLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-direct/range {p0 .. p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getSpoilerView()Landroid/widget/FrameLayout;
|
|
|
|
move-result-object v14
|
|
|
|
const-wide/16 v15, 0xc8
|
|
|
|
sget-object v17, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$configureUI$2;->INSTANCE:Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$configureUI$2;
|
|
|
|
const/16 v18, 0x0
|
|
|
|
const/16 v19, 0x4
|
|
|
|
const/16 v20, 0x0
|
|
|
|
invoke-static/range {v14 .. v20}, Lcom/discord/utilities/view/extensions/ViewExtensions;->fadeOut$default(Landroid/view/View;JLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
|
|
|
|
:goto_0
|
|
invoke-direct/range {p0 .. p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getSpoilerView()Landroid/widget/FrameLayout;
|
|
|
|
move-result-object v5
|
|
|
|
new-instance v6, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$configureUI$3;
|
|
|
|
invoke-direct {v6, v0, v1, v2}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$configureUI$3;-><init>(Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Model;Lcom/discord/widgets/chat/list/entries/AttachmentEntry;)V
|
|
|
|
invoke-virtual {v5, v6}, Landroid/widget/FrameLayout;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
invoke-direct {v0, v3}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->resetViews(Lcom/discord/models/domain/ModelMessageAttachment;)V
|
|
|
|
sget-object v1, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->Companion:Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Companion;
|
|
|
|
invoke-static {v1, v3}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Companion;->access$isInlinedAttachment$p(Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Companion;Lcom/discord/models/domain/ModelMessageAttachment;)Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
const/4 v5, 0x0
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
iget-object v1, v0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->userSettings:Lcom/discord/stores/StoreUserSettings;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreUserSettings;->getShowAttachmentMediaInline()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
const/4 v1, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const/4 v1, 0x0
|
|
|
|
:goto_1
|
|
if-eqz v1, :cond_5
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelMessageAttachment;->getWidth()I
|
|
|
|
move-result v1
|
|
|
|
if-gtz v1, :cond_3
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelMessageAttachment;->getHeight()I
|
|
|
|
move-result v1
|
|
|
|
if-lez v1, :cond_2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
const/4 v2, 0x0
|
|
|
|
:cond_3
|
|
:goto_2
|
|
if-eqz v2, :cond_4
|
|
|
|
sget-object v6, Lcom/discord/utilities/embed/EmbedResourceUtils;->INSTANCE:Lcom/discord/utilities/embed/EmbedResourceUtils;
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelMessageAttachment;->getWidth()I
|
|
|
|
move-result v7
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelMessageAttachment;->getHeight()I
|
|
|
|
move-result v8
|
|
|
|
iget v9, v0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->maxAttachmentImageWidth:I
|
|
|
|
sget-object v1, Lcom/discord/utilities/embed/EmbedResourceUtils;->INSTANCE:Lcom/discord/utilities/embed/EmbedResourceUtils;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/embed/EmbedResourceUtils;->getMAX_IMAGE_VIEW_HEIGHT_PX()I
|
|
|
|
move-result v10
|
|
|
|
invoke-direct/range {p0 .. p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getInlineMedia()Lcom/discord/widgets/chat/list/InlineMediaView;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Landroid/widget/FrameLayout;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v11
|
|
|
|
const-string v1, "inlineMedia.resources"
|
|
|
|
invoke-static {v11, v1}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 v12, 0x0
|
|
|
|
const/16 v13, 0x20
|
|
|
|
const/4 v14, 0x0
|
|
|
|
invoke-static/range {v6 .. v14}, Lcom/discord/utilities/embed/EmbedResourceUtils;->calculateScaledSize$default(Lcom/discord/utilities/embed/EmbedResourceUtils;IIIILandroid/content/res/Resources;IILjava/lang/Object;)Lkotlin/Pair;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, v1, Lkotlin/Pair;->first:Ljava/lang/Object;
|
|
|
|
check-cast v2, Ljava/lang/Number;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/Number;->intValue()I
|
|
|
|
move-result v2
|
|
|
|
iget-object v1, v1, Lkotlin/Pair;->second:Ljava/lang/Object;
|
|
|
|
check-cast v1, Ljava/lang/Number;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Number;->intValue()I
|
|
|
|
move-result v1
|
|
|
|
invoke-direct/range {p0 .. p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getInlineMedia()Lcom/discord/widgets/chat/list/InlineMediaView;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v5, v3, v2, v1}, Lcom/discord/widgets/chat/list/InlineMediaView;->updateUIWithAttachment(Lcom/discord/models/domain/ModelMessageAttachment;Ljava/lang/Integer;Ljava/lang/Integer;)V
|
|
|
|
goto :goto_3
|
|
|
|
:cond_4
|
|
invoke-direct/range {p0 .. p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getCard()Landroid/view/View;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1, v5}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
invoke-direct/range {p0 .. p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getInlineMedia()Lcom/discord/widgets/chat/list/InlineMediaView;
|
|
|
|
move-result-object v1
|
|
|
|
const/16 v2, 0x8
|
|
|
|
invoke-virtual {v1, v2}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
:cond_5
|
|
:goto_3
|
|
invoke-direct {v0, v3, v4}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->configureFileData(Lcom/discord/models/domain/ModelMessageAttachment;Lcom/discord/utilities/textprocessing/MessageRenderContext;)V
|
|
|
|
invoke-direct/range {p0 .. p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getInlineMedia()Lcom/discord/widgets/chat/list/InlineMediaView;
|
|
|
|
move-result-object v1
|
|
|
|
new-instance v2, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$configureUI$4;
|
|
|
|
invoke-direct {v2, v3}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$configureUI$4;-><init>(Lcom/discord/models/domain/ModelMessageAttachment;)V
|
|
|
|
invoke-virtual {v1, v2}, Landroid/widget/FrameLayout;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
invoke-direct/range {p0 .. p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getCard()Landroid/view/View;
|
|
|
|
move-result-object v1
|
|
|
|
new-instance v2, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$configureUI$5;
|
|
|
|
invoke-direct {v2, v3}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$configureUI$5;-><init>(Lcom/discord/models/domain/ModelMessageAttachment;)V
|
|
|
|
invoke-virtual {v1, v2}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final getCard()Landroid/view/View;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->card$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
sget-object v1, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x1
|
|
|
|
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, Landroid/view/View;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final getFileDescription()Landroid/widget/TextView;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->fileDescription$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
sget-object v1, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x4
|
|
|
|
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, Landroid/widget/TextView;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final getFileDownload()Landroid/widget/ImageView;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->fileDownload$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
sget-object v1, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x5
|
|
|
|
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, Landroid/widget/ImageView;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final getFileIcon()Landroid/widget/ImageView;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->fileIcon$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
sget-object v1, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x2
|
|
|
|
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, Landroid/widget/ImageView;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final getFileName()Landroid/widget/TextView;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->fileName$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
sget-object v1, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x3
|
|
|
|
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, Landroid/widget/TextView;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final getInlineMedia()Lcom/discord/widgets/chat/list/InlineMediaView;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->inlineMedia$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
sget-object v1, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->$$delegatedProperties:[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, Lcom/discord/widgets/chat/list/InlineMediaView;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final getSpoilerView()Landroid/widget/FrameLayout;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->spoilerView$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
sget-object v1, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x6
|
|
|
|
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, Landroid/widget/FrameLayout;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final resetViews(Lcom/discord/models/domain/ModelMessageAttachment;)V
|
|
.locals 11
|
|
|
|
sget-object v0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->Companion:Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Companion;
|
|
|
|
invoke-static {v0, p1}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Companion;->access$isInlinedAttachment$p(Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Companion;Lcom/discord/models/domain/ModelMessageAttachment;)Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->userSettings:Lcom/discord/stores/StoreUserSettings;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreUserSettings;->getShowAttachmentMediaInline()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getCard()Landroid/view/View;
|
|
|
|
move-result-object v2
|
|
|
|
xor-int/lit8 v3, v0, 0x1
|
|
|
|
const/16 v4, 0x8
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const/16 v3, 0x8
|
|
|
|
:goto_1
|
|
invoke-virtual {v2, v3}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getInlineMedia()Lcom/discord/widgets/chat/list/InlineMediaView;
|
|
|
|
move-result-object v5
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x6
|
|
|
|
const/4 v10, 0x0
|
|
|
|
move-object v6, p1
|
|
|
|
invoke-static/range {v5 .. v10}, Lcom/discord/widgets/chat/list/InlineMediaView;->updateUIWithAttachment$default(Lcom/discord/widgets/chat/list/InlineMediaView;Lcom/discord/models/domain/ModelMessageAttachment;Ljava/lang/Integer;Ljava/lang/Integer;ILjava/lang/Object;)V
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getInlineMedia()Lcom/discord/widgets/chat/list/InlineMediaView;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
const/16 v1, 0x8
|
|
|
|
:goto_2
|
|
invoke-virtual {p1, v1}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getSubscription()Lrx/Subscription;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->subscription:Lrx/Subscription;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public onConfigure(ILcom/discord/widgets/chat/list/entries/ChatListEntry;)V
|
|
.locals 10
|
|
|
|
const-string v0, "data"
|
|
|
|
invoke-static {p2, v0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-super {p0, p1, p2}, Lcom/discord/widgets/chat/list/WidgetChatListItem;->onConfigure(ILcom/discord/widgets/chat/list/entries/ChatListEntry;)V
|
|
|
|
move-object v2, p2
|
|
|
|
check-cast v2, Lcom/discord/widgets/chat/list/entries/AttachmentEntry;
|
|
|
|
new-instance p1, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Model;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const-wide/16 v6, 0x0
|
|
|
|
const/16 v8, 0x1e
|
|
|
|
const/4 v9, 0x0
|
|
|
|
move-object v1, p1
|
|
|
|
invoke-direct/range {v1 .. v9}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Model;-><init>(Lcom/discord/widgets/chat/list/entries/AttachmentEntry;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;JILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->configureUI(Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment$Model;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public bridge synthetic onConfigure(ILjava/lang/Object;)V
|
|
.locals 0
|
|
|
|
check-cast p2, Lcom/discord/widgets/chat/list/entries/ChatListEntry;
|
|
|
|
invoke-virtual {p0, p1, p2}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->onConfigure(ILcom/discord/widgets/chat/list/entries/ChatListEntry;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onPause()V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getInlineMedia()Lcom/discord/widgets/chat/list/InlineMediaView;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/widgets/chat/list/InlineMediaView;->onPause()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onResume()V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemAttachment;->getInlineMedia()Lcom/discord/widgets/chat/list/InlineMediaView;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/widgets/chat/list/InlineMediaView;->onResume()V
|
|
|
|
return-void
|
|
.end method
|