301 lines
10 KiB
Smali
301 lines
10 KiB
Smali
.class public final Lcom/discord/widgets/chat/input/WidgetChatInputSend;
|
|
.super Ljava/lang/Object;
|
|
.source "WidgetChatInputSend.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/widgets/chat/input/WidgetChatInputSend$Listener;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final INSTANCE:Lcom/discord/widgets/chat/input/WidgetChatInputSend;
|
|
|
|
.field public static final chatStore:Lcom/discord/stores/StoreChat;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Lcom/discord/widgets/chat/input/WidgetChatInputSend;
|
|
|
|
invoke-direct {v0}, Lcom/discord/widgets/chat/input/WidgetChatInputSend;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/widgets/chat/input/WidgetChatInputSend;->INSTANCE:Lcom/discord/widgets/chat/input/WidgetChatInputSend;
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getChat()Lcom/discord/stores/StoreChat;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/discord/widgets/chat/input/WidgetChatInputSend;->chatStore:Lcom/discord/stores/StoreChat;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.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$clearInput(Lcom/discord/widgets/chat/input/WidgetChatInputSend;Lcom/discord/widgets/chat/input/WidgetChatInputEditText;)Z
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/chat/input/WidgetChatInputSend;->clearInput(Lcom/discord/widgets/chat/input/WidgetChatInputEditText;)Z
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method private final clearInput(Lcom/discord/widgets/chat/input/WidgetChatInputEditText;)Z
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-virtual {p1, v0}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/input/WidgetChatInputEditText;->clearLastTypingEmission()V
|
|
|
|
sget-object p1, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/stores/StoreStream$Companion;->getChat()Lcom/discord/stores/StoreChat;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1, v0}, Lcom/discord/stores/StoreChat;->setEditingMessage(Lcom/discord/stores/StoreChat$EditingMessage;)V
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public static final configureSendListeners(Lcom/discord/widgets/chat/input/WidgetChatInputEditText;Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;Landroid/view/View;Landroid/view/View;Lcom/discord/widgets/chat/input/WidgetChatInputModel;Lcom/discord/widgets/chat/input/WidgetChatInputSend$Listener;)V
|
|
.locals 5
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
if-eqz p2, :cond_4
|
|
|
|
if-eqz p3, :cond_3
|
|
|
|
if-eqz p4, :cond_2
|
|
|
|
if-eqz p5, :cond_1
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
new-instance v1, Ljava/lang/ref/WeakReference;
|
|
|
|
invoke-direct {v1, p5}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V
|
|
|
|
new-instance p5, Lcom/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1;
|
|
|
|
invoke-direct {p5, p0, p4, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1;-><init>(Lcom/discord/widgets/chat/input/WidgetChatInputEditText;Lcom/discord/widgets/chat/input/WidgetChatInputModel;Ljava/lang/ref/WeakReference;)V
|
|
|
|
new-instance v1, Lcom/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$2;
|
|
|
|
invoke-direct {v1, p0}, Lcom/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$2;-><init>(Lcom/discord/widgets/chat/input/WidgetChatInputEditText;)V
|
|
|
|
iget-object v2, p4, Lcom/discord/widgets/chat/input/WidgetChatInputModel;->inputHint:Ljava/lang/String;
|
|
|
|
invoke-virtual {p0, v2}, Lcom/discord/widgets/chat/input/WidgetChatInputEditText;->setSingleLineHint(Ljava/lang/CharSequence;)V
|
|
|
|
iget-wide v2, p4, Lcom/discord/widgets/chat/input/WidgetChatInputModel;->channelId:J
|
|
|
|
const/4 v4, 0x1
|
|
|
|
invoke-virtual {p0, v2, v3, v4}, Lcom/discord/widgets/chat/input/WidgetChatInputEditText;->setChannelId(JZ)V
|
|
|
|
new-instance v2, Lcom/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$3;
|
|
|
|
invoke-direct {v2, p5}, Lcom/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$3;-><init>(Lcom/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1;)V
|
|
|
|
invoke-virtual {p0, v2}, Lcom/discord/widgets/chat/input/WidgetChatInputEditText;->setOnSendListener(Lrx/functions/Action0;)V
|
|
|
|
sget-object v2, Lcom/discord/widgets/chat/input/WidgetChatInputSend;->INSTANCE:Lcom/discord/widgets/chat/input/WidgetChatInputSend;
|
|
|
|
invoke-direct {v2, p0, p4}, Lcom/discord/widgets/chat/input/WidgetChatInputSend;->setText(Lcom/discord/widgets/chat/input/WidgetChatInputEditText;Lcom/discord/widgets/chat/input/WidgetChatInputModel;)V
|
|
|
|
invoke-virtual {p4}, Lcom/discord/widgets/chat/input/WidgetChatInputModel;->isEditing()Z
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x2
|
|
|
|
invoke-static {p2, v2, v3, v4, v0}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setVisibilityBy$default(Landroid/view/View;ZIILjava/lang/Object;)V
|
|
|
|
new-instance p2, Lcom/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$4;
|
|
|
|
invoke-direct {p2, p0}, Lcom/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$4;-><init>(Lcom/discord/widgets/chat/input/WidgetChatInputEditText;)V
|
|
|
|
invoke-virtual {p3, p2}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
iget-boolean p0, p4, Lcom/discord/widgets/chat/input/WidgetChatInputModel;->ableToSendMessage:Z
|
|
|
|
invoke-virtual {p1, p0}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->setEnabled(Z)V
|
|
|
|
new-instance p0, Lcom/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$5;
|
|
|
|
invoke-direct {p0, p4, v1, p5}, Lcom/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$5;-><init>(Lcom/discord/widgets/chat/input/WidgetChatInputModel;Lcom/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$2;Lcom/discord/widgets/chat/input/WidgetChatInputSend$configureSendListeners$1;)V
|
|
|
|
invoke-virtual {p1, p0}, Lcom/discord/widgets/chat/input/WidgetChatInputAttachments;->setInputListener(Lcom/lytefast/flexinput/InputListener;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
|
|
:cond_1
|
|
const-string p0, "listener"
|
|
|
|
invoke-static {p0}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
const-string p0, "model"
|
|
|
|
invoke-static {p0}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_3
|
|
const-string p0, "chatInputEditCancel"
|
|
|
|
invoke-static {p0}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_4
|
|
const-string p0, "chatInputEdit"
|
|
|
|
invoke-static {p0}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_5
|
|
const-string p0, "chatInputWidget"
|
|
|
|
invoke-static {p0}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method private final setText(Lcom/discord/widgets/chat/input/WidgetChatInputEditText;Lcom/discord/widgets/chat/input/WidgetChatInputModel;)V
|
|
.locals 8
|
|
|
|
iget-boolean v0, p2, Lcom/discord/widgets/chat/input/WidgetChatInputModel;->ableToSendMessage:Z
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const-string p2, ""
|
|
|
|
invoke-virtual {p1, p2}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
invoke-virtual {p2}, Lcom/discord/widgets/chat/input/WidgetChatInputModel;->isEditing()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p2, Lcom/discord/widgets/chat/input/WidgetChatInputModel;->editingMessage:Lcom/discord/stores/StoreChat$EditingMessage;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreChat$EditingMessage;->isEdited()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
sget-object v0, Lcom/discord/widgets/chat/input/WidgetChatInputSend;->chatStore:Lcom/discord/stores/StoreChat;
|
|
|
|
iget-object v2, p2, Lcom/discord/widgets/chat/input/WidgetChatInputModel;->editingMessage:Lcom/discord/stores/StoreChat$EditingMessage;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x1
|
|
|
|
const/4 v6, 0x3
|
|
|
|
const/4 v7, 0x0
|
|
|
|
invoke-static/range {v2 .. v7}, Lcom/discord/stores/StoreChat$EditingMessage;->copy$default(Lcom/discord/stores/StoreChat$EditingMessage;Lcom/discord/models/domain/ModelMessage;Ljava/lang/CharSequence;ZILjava/lang/Object;)Lcom/discord/stores/StoreChat$EditingMessage;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v0, v2}, Lcom/discord/stores/StoreChat;->setEditingMessage(Lcom/discord/stores/StoreChat$EditingMessage;)V
|
|
|
|
iget-object p2, p2, Lcom/discord/widgets/chat/input/WidgetChatInputModel;->editingMessage:Lcom/discord/stores/StoreChat$EditingMessage;
|
|
|
|
invoke-virtual {p2}, Lcom/discord/stores/StoreChat$EditingMessage;->getContent()Ljava/lang/CharSequence;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p1, p2, v1, v1}, Lcom/discord/widgets/chat/input/WidgetChatInputEditText;->setText(Ljava/lang/CharSequence;ZZ)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
iget-object v0, p2, Lcom/discord/widgets/chat/input/WidgetChatInputModel;->externalText:Ljava/lang/String;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
invoke-interface {v0}, Ljava/lang/CharSequence;->length()I
|
|
|
|
move-result v0
|
|
|
|
if-lez v0, :cond_2
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_3
|
|
|
|
iget-object p2, p2, Lcom/discord/widgets/chat/input/WidgetChatInputModel;->externalText:Ljava/lang/String;
|
|
|
|
const-string v0, " "
|
|
|
|
invoke-virtual {p1, v0, p2}, Lcom/discord/widgets/chat/input/WidgetChatInputEditText;->appendWithSpacer(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
sget-object v0, Lcom/discord/widgets/chat/input/WidgetChatInputSend;->chatStore:Lcom/discord/stores/StoreChat;
|
|
|
|
iget-wide v3, p2, Lcom/discord/widgets/chat/input/WidgetChatInputModel;->channelId:J
|
|
|
|
invoke-virtual {v0, v3, v4}, Lcom/discord/stores/StoreChat;->getTextChannelInput(J)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p1, p2, v1, v2}, Lcom/discord/widgets/chat/input/WidgetChatInputEditText;->setText(Ljava/lang/CharSequence;ZZ)V
|
|
|
|
:goto_1
|
|
return-void
|
|
.end method
|