444 lines
16 KiB
Smali
444 lines
16 KiB
Smali
.class public final Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;
|
|
.super Ljava/lang/Object;
|
|
.source "WidgetChatInputAttachments.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$PermissionsEmptyListAdapter;,
|
|
Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$DiscordFilesFragment;,
|
|
Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$DiscordPhotosFragment;,
|
|
Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$DiscordCameraFragment;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public flexInputFragment:Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$getFlexInputFragment$p(Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;)Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->flexInputFragment:Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$setAttachmentFromPicker(Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;Landroidx/core/view/inputmethod/InputContentInfoCompat;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->setAttachmentFromPicker(Landroidx/core/view/inputmethod/InputContentInfoCompat;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$setFlexInputFragment$p(Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;Lcom/lytefast/flexinput/fragment/FlexInputFragment;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->flexInputFragment:Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final createPreviewAdapter(Landroid/content/ContentResolver;)Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Lcom/lytefast/flexinput/model/Attachment<",
|
|
"+",
|
|
"Ljava/lang/Object;",
|
|
">;>(",
|
|
"Landroid/content/ContentResolver;",
|
|
")",
|
|
"Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter<",
|
|
"TT;>;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;
|
|
|
|
new-instance v1, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$createPreviewAdapter$1;
|
|
|
|
invoke-direct {v1, p0, p1}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$createPreviewAdapter$1;-><init>(Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;Landroid/content/ContentResolver;)V
|
|
|
|
invoke-direct {v0, p1, v1}, Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;-><init>(Landroid/content/ContentResolver;Lkotlin/jvm/functions/Function1;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final getContentResolver()Landroid/content/ContentResolver;
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
|
|
|
|
move-result-object v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final getContext()Landroid/content/Context;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->flexInputFragment:Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Landroidx/fragment/app/Fragment;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final setAttachmentFromPicker(Landroidx/core/view/inputmethod/InputContentInfoCompat;)V
|
|
.locals 4
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->getContentResolver()Landroid/content/ContentResolver;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
const v2, 0x7f12024c
|
|
|
|
invoke-virtual {v1, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const-string v1, "?"
|
|
|
|
:goto_0
|
|
const-string v2, "context?.getString(R.str\u2026_filename_unknown) ?: \"?\""
|
|
|
|
invoke-static {v1, v2}, Lt/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
sget-object v2, Lcom/lytefast/flexinput/model/Attachment;->Companion:Lcom/lytefast/flexinput/model/Attachment$Companion;
|
|
|
|
const/4 v3, 0x1
|
|
|
|
invoke-virtual {v2, p1, v0, v3, v1}, Lcom/lytefast/flexinput/model/Attachment$Companion;->a(Landroidx/core/view/inputmethod/InputContentInfoCompat;Landroid/content/ContentResolver;ZLjava/lang/String;)Lcom/lytefast/flexinput/model/Attachment;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Lcom/discord/widgets/chat/input/SourcedAttachment;
|
|
|
|
const-string v1, "keyboard"
|
|
|
|
invoke-direct {v0, p1, v1}, Lcom/discord/widgets/chat/input/SourcedAttachment;-><init>(Lcom/lytefast/flexinput/model/Attachment;Ljava/lang/String;)V
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->flexInputFragment:Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-virtual {p1, v0}, Lcom/lytefast/flexinput/fragment/FlexInputFragment;->a(Lcom/lytefast/flexinput/model/Attachment;)V
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final configureFlexInputFragment(Lcom/discord/app/AppFragment;Lcom/discord/widgets/chat/input/WidgetChatInputEditText;)V
|
|
.locals 9
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_7
|
|
|
|
invoke-virtual {p1}, Landroidx/fragment/app/Fragment;->getChildFragmentManager()Landroidx/fragment/app/FragmentManager;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "fragment.childFragmentManager"
|
|
|
|
invoke-static {v1, v2}, Lt/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
new-instance v2, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$configureFlexInputFragment$1;
|
|
|
|
invoke-direct {v2, p0}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$configureFlexInputFragment$1;-><init>(Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;)V
|
|
|
|
invoke-virtual {p2, v2}, Lcom/lytefast/flexinput/widget/FlexEditText;->setInputContentHandler(Lkotlin/jvm/functions/Function1;)V
|
|
|
|
:cond_0
|
|
const v2, 0x7f0a01e1
|
|
|
|
invoke-virtual {v1, v2}, Landroidx/fragment/app/FragmentManager;->findFragmentById(I)Landroidx/fragment/app/Fragment;
|
|
|
|
move-result-object v2
|
|
|
|
instance-of v3, v2, Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
if-nez v3, :cond_1
|
|
|
|
move-object v2, v0
|
|
|
|
:cond_1
|
|
check-cast v2, Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
iput-object v2, p0, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->flexInputFragment:Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
iget-object v2, p0, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->flexInputFragment:Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-eqz v2, :cond_6
|
|
|
|
const/4 v4, 0x3
|
|
|
|
new-array v4, v4, [Le/b/a/b/a$b;
|
|
|
|
new-instance v5, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$configureFlexInputFragment$2$1;
|
|
|
|
const v6, 0x7f0802f8
|
|
|
|
const v7, 0x7f12024e
|
|
|
|
invoke-direct {v5, v6, v7}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$configureFlexInputFragment$2$1;-><init>(II)V
|
|
|
|
aput-object v5, v4, v3
|
|
|
|
const/4 v5, 0x1
|
|
|
|
new-instance v6, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$configureFlexInputFragment$2$2;
|
|
|
|
const v7, 0x7f08029d
|
|
|
|
const v8, 0x7f12024d
|
|
|
|
invoke-direct {v6, v7, v8}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$configureFlexInputFragment$2$2;-><init>(II)V
|
|
|
|
aput-object v6, v4, v5
|
|
|
|
const/4 v5, 0x2
|
|
|
|
new-instance v6, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$configureFlexInputFragment$2$3;
|
|
|
|
const v7, 0x7f0801de
|
|
|
|
const v8, 0x7f12024a
|
|
|
|
invoke-direct {v6, v7, v8}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$configureFlexInputFragment$2$3;-><init>(II)V
|
|
|
|
aput-object v6, v4, v5
|
|
|
|
invoke-virtual {v2, v4}, Lcom/lytefast/flexinput/fragment/FlexInputFragment;->a([Le/b/a/b/a$b;)Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
invoke-virtual {v2, p2}, Lcom/lytefast/flexinput/fragment/FlexInputFragment;->b(Landroidx/appcompat/widget/AppCompatEditText;)Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/app/AppFragment;->getFileManager()Lcom/lytefast/flexinput/managers/FileManager;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v2, v4}, Lcom/lytefast/flexinput/fragment/FlexInputFragment;->a(Lcom/lytefast/flexinput/managers/FileManager;)Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
new-instance v4, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$configureFlexInputFragment$$inlined$apply$lambda$1;
|
|
|
|
invoke-direct {v4, p0, p2, p1, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$configureFlexInputFragment$$inlined$apply$lambda$1;-><init>(Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;Lcom/discord/widgets/chat/input/WidgetChatInputEditText;Lcom/discord/app/AppFragment;Landroidx/fragment/app/FragmentManager;)V
|
|
|
|
invoke-virtual {v2, v4}, Lcom/lytefast/flexinput/fragment/FlexInputFragment;->a(Le/b/a/c/a;)Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->getContentResolver()Landroid/content/ContentResolver;
|
|
|
|
move-result-object v4
|
|
|
|
if-eqz v4, :cond_2
|
|
|
|
invoke-direct {p0, v4}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->createPreviewAdapter(Landroid/content/ContentResolver;)Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v2, v4}, Lcom/lytefast/flexinput/fragment/FlexInputFragment;->a(Lcom/lytefast/flexinput/adapters/AttachmentPreviewAdapter;)Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
:cond_2
|
|
const v4, 0x7f0a02d4
|
|
|
|
invoke-virtual {v1, v4}, Landroidx/fragment/app/FragmentManager;->findFragmentById(I)Landroidx/fragment/app/Fragment;
|
|
|
|
move-result-object v4
|
|
|
|
instance-of v5, v4, Lcom/discord/widgets/chat/input/emoji/WidgetChatInputEmojiPicker;
|
|
|
|
if-nez v5, :cond_3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
move-object v0, v4
|
|
|
|
:goto_0
|
|
check-cast v0, Lcom/discord/widgets/chat/input/emoji/WidgetChatInputEmojiPicker;
|
|
|
|
if-nez v0, :cond_4
|
|
|
|
sget-object v0, Lcom/discord/widgets/chat/input/emoji/WidgetChatInputEmojiPicker$EmojiContextType;->CHAT:Lcom/discord/widgets/chat/input/emoji/WidgetChatInputEmojiPicker$EmojiContextType;
|
|
|
|
invoke-static {v0}, Lcom/discord/widgets/chat/input/emoji/WidgetChatInputEmojiPicker;->createInline(Lcom/discord/widgets/chat/input/emoji/WidgetChatInputEmojiPicker$EmojiContextType;)Lcom/discord/widgets/chat/input/emoji/WidgetChatInputEmojiPicker;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v2, v0}, Lcom/lytefast/flexinput/fragment/FlexInputFragment;->a(Landroidx/fragment/app/Fragment;)Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
:cond_4
|
|
if-eqz v0, :cond_5
|
|
|
|
new-instance v2, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$configureFlexInputFragment$$inlined$apply$lambda$2;
|
|
|
|
invoke-direct {v2, p0, p2, p1, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$configureFlexInputFragment$$inlined$apply$lambda$2;-><init>(Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;Lcom/discord/widgets/chat/input/WidgetChatInputEditText;Lcom/discord/app/AppFragment;Landroidx/fragment/app/FragmentManager;)V
|
|
|
|
invoke-virtual {v0, v2}, Lcom/discord/widgets/chat/input/emoji/WidgetChatInputEmojiPicker;->setListener(Lcom/discord/widgets/chat/input/emoji/WidgetChatInputEmojiPicker$Listener;)V
|
|
|
|
:cond_5
|
|
if-eqz v0, :cond_6
|
|
|
|
new-instance v2, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$configureFlexInputFragment$$inlined$apply$lambda$3;
|
|
|
|
invoke-direct {v2, p0, p2, p1, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$configureFlexInputFragment$$inlined$apply$lambda$3;-><init>(Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;Lcom/discord/widgets/chat/input/WidgetChatInputEditText;Lcom/discord/app/AppFragment;Landroidx/fragment/app/FragmentManager;)V
|
|
|
|
invoke-virtual {v0, v2}, Lcom/discord/widgets/chat/input/emoji/WidgetChatInputEmojiPicker;->setOnBackspacePressedListener(Lcom/discord/widgets/chat/input/emoji/WidgetChatInputEmojiPicker$OnBackspacePressedListener;)V
|
|
|
|
:cond_6
|
|
new-instance p2, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$configureFlexInputFragment$3;
|
|
|
|
invoke-direct {p2, p0}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments$configureFlexInputFragment$3;-><init>(Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;)V
|
|
|
|
invoke-virtual {p1, p2, v3}, Lcom/discord/app/AppFragment;->setOnBackPressed(Lrx/functions/Func0;I)V
|
|
|
|
return-void
|
|
|
|
:cond_7
|
|
const-string p1, "fragment"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final isEnabled()Z
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->flexInputFragment:Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Lcom/lytefast/flexinput/fragment/FlexInputFragment;->f()Z
|
|
|
|
move-result v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public final reset()V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->flexInputFragment:Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final setEmojiTrayHidden()Z
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->flexInputFragment:Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Lcom/lytefast/flexinput/fragment/FlexInputFragment;->e()Z
|
|
|
|
move-result v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public final setEnabled(Z)V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->flexInputFragment:Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0, p1}, Lcom/lytefast/flexinput/fragment/FlexInputFragment;->b(Z)Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public final setInputListener(Lcom/lytefast/flexinput/InputListener;)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->flexInputFragment:Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0, p1}, Lcom/lytefast/flexinput/fragment/FlexInputFragment;->a(Lcom/lytefast/flexinput/InputListener;)Lcom/lytefast/flexinput/fragment/FlexInputFragment;
|
|
|
|
:cond_0
|
|
return-void
|
|
|
|
:cond_1
|
|
const-string p1, "inputListener"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|