apkfuckery/com.discord/smali/com/discord/utilities/textprocessing/node/ChannelMentionNode.smali

270 lines
7.1 KiB
Smali
Raw Normal View History

2019-07-24 11:27:29 +00:00
.class public final Lcom/discord/utilities/textprocessing/node/ChannelMentionNode;
.super Lcom/discord/simpleast/core/node/Node;
.source "ChannelMentionNode.kt"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/discord/utilities/textprocessing/node/ChannelMentionNode$RenderContext;
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<T::",
"Lcom/discord/utilities/textprocessing/node/ChannelMentionNode$RenderContext;",
">",
"Lcom/discord/simpleast/core/node/Node<",
"TT;>;"
}
.end annotation
# instance fields
2019-12-06 03:29:40 +00:00
.field public final channelId:J
2019-07-24 11:27:29 +00:00
# direct methods
.method public constructor <init>(J)V
.locals 0
invoke-direct {p0}, Lcom/discord/simpleast/core/node/Node;-><init>()V
iput-wide p1, p0, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode;->channelId:J
return-void
.end method
# virtual methods
2019-12-06 03:29:40 +00:00
.method public equals(Ljava/lang/Object;)Z
2019-07-24 11:27:29 +00:00
.locals 4
instance-of v0, p1, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode;
if-eqz v0, :cond_0
check-cast p1, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode;
iget-wide v0, p1, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode;->channelId:J
iget-wide v2, p0, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode;->channelId:J
cmp-long p1, v0, v2
if-nez p1, :cond_0
const/4 p1, 0x1
2019-12-06 03:29:40 +00:00
goto :goto_0
2019-07-24 11:27:29 +00:00
:cond_0
const/4 p1, 0x0
2019-12-06 03:29:40 +00:00
:goto_0
2019-07-24 11:27:29 +00:00
return p1
.end method
.method public final getChannelId()J
.locals 2
iget-wide v0, p0, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode;->channelId:J
return-wide v0
.end method
2019-12-06 03:29:40 +00:00
.method public render(Landroid/text/SpannableStringBuilder;Lcom/discord/utilities/textprocessing/node/ChannelMentionNode$RenderContext;)V
.locals 19
2019-07-24 11:27:29 +00:00
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/text/SpannableStringBuilder;",
"TT;)V"
}
.end annotation
2019-11-15 02:21:15 +00:00
move-object/from16 v0, p0
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-object/from16 v1, p1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/4 v2, 0x0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-eqz v1, :cond_4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-eqz p2, :cond_3
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-interface/range {p2 .. p2}, Lcom/discord/utilities/textprocessing/node/BasicRenderContext;->getContext()Landroid/content/Context;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result-object v4
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual/range {p1 .. p1}, Landroid/text/SpannableStringBuilder;->length()I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v10
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
new-instance v11, Ljava/util/ArrayList;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/4 v3, 0x3
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-direct {v11, v3}, Ljava/util/ArrayList;-><init>(I)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
new-instance v3, Landroid/text/style/StyleSpan;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/4 v5, 0x1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-direct {v3, v5}, Landroid/text/style/StyleSpan;-><init>(I)V
2019-11-10 14:21:47 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {v11, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-interface/range {p2 .. p2}, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode$RenderContext;->getChannelNames()Ljava/util/Map;
2019-07-24 11:27:29 +00:00
2019-11-14 21:08:15 +00:00
move-result-object v3
2019-11-10 14:21:47 +00:00
2019-11-15 02:21:15 +00:00
if-eqz v3, :cond_0
iget-wide v5, v0, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode;->channelId:J
2019-11-10 14:21:47 +00:00
2019-11-15 02:21:15 +00:00
invoke-static {v5, v6}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
2019-11-10 14:21:47 +00:00
2019-12-06 03:29:40 +00:00
move-result-object v2
2019-11-15 02:21:15 +00:00
2019-12-06 03:29:40 +00:00
invoke-interface {v3, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
2019-11-15 02:21:15 +00:00
2019-12-06 03:29:40 +00:00
move-result-object v2
2019-11-15 02:21:15 +00:00
2019-12-06 03:29:40 +00:00
check-cast v2, Ljava/lang/String;
2019-07-24 11:27:29 +00:00
:cond_0
2019-12-06 03:29:40 +00:00
move-object v5, v2
2019-11-15 02:21:15 +00:00
2020-04-17 17:35:24 +00:00
const v2, 0x7f0601b2
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
if-eqz v5, :cond_1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
new-instance v3, Lcom/discord/utilities/spans/ClickableSpan;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {v4, v2}, Lcom/discord/utilities/color/ColorCompat;->getColor(Landroid/content/Context;I)I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result-object v13
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
const/4 v14, 0x0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/4 v15, 0x0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
new-instance v2, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode$render$1;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-direct {v2, v0}, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode$render$1;-><init>(Lcom/discord/utilities/textprocessing/node/ChannelMentionNode;)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/16 v17, 0x4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/16 v18, 0x0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-object v12, v3
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-object/from16 v16, v2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-direct/range {v12 .. v18}, Lcom/discord/utilities/spans/ClickableSpan;-><init>(Ljava/lang/Integer;ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {v11, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
goto :goto_0
2019-07-24 11:27:29 +00:00
:cond_1
2019-12-06 03:29:40 +00:00
new-instance v3, Landroid/text/style/ForegroundColorSpan;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {v4, v2}, Lcom/discord/utilities/color/ColorCompat;->getColor(Landroid/content/Context;I)I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-direct {v3, v2}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {v11, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
:goto_0
new-instance v2, Landroid/text/style/BackgroundColorSpan;
2019-07-24 11:27:29 +00:00
2020-04-17 17:35:24 +00:00
const v3, 0x7f0601b3
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {v4, v3}, Lcom/discord/utilities/color/ColorCompat;->getColor(Landroid/content/Context;I)I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v3
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-direct {v2, v3}, Landroid/text/style/BackgroundColorSpan;-><init>(I)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {v11, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
2019-07-24 11:27:29 +00:00
sget-object v3, Lcom/discord/utilities/channel/ChannelUtils;->INSTANCE:Lcom/discord/utilities/channel/ChannelUtils;
2019-11-15 02:21:15 +00:00
const/4 v6, 0x0
const/4 v7, 0x0
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
const/16 v8, 0x8
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
const/4 v9, 0x0
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-static/range {v3 .. v9}, Lcom/discord/utilities/channel/ChannelUtils;->getDisplayName$default(Lcom/discord/utilities/channel/ChannelUtils;Landroid/content/Context;Ljava/lang/String;IZILjava/lang/Object;)Ljava/lang/String;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result-object v2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {v1, v2}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-interface {v11}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object v2
:goto_1
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v3
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-eqz v3, :cond_2
2019-11-15 02:21:15 +00:00
2019-12-06 03:29:40 +00:00
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
2019-11-15 02:21:15 +00:00
move-result-object v3
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
check-cast v3, Landroid/text/style/CharacterStyle;
invoke-virtual/range {p1 .. p1}, Landroid/text/SpannableStringBuilder;->length()I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result v4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/16 v5, 0x21
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {v1, v3, v10, v4, v5}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
goto :goto_1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
:cond_2
return-void
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
:cond_3
const-string v1, "renderContext"
2019-07-24 11:27:29 +00:00
2020-04-27 20:53:11 +00:00
invoke-static {v1}, Lx/u/b/j;->a(Ljava/lang/String;)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
throw v2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
:cond_4
const-string v1, "builder"
2019-07-24 11:27:29 +00:00
2020-04-27 20:53:11 +00:00
invoke-static {v1}, Lx/u/b/j;->a(Ljava/lang/String;)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
throw v2
2019-07-24 11:27:29 +00:00
.end method
2019-12-06 03:29:40 +00:00
.method public bridge synthetic render(Landroid/text/SpannableStringBuilder;Ljava/lang/Object;)V
2019-07-24 11:27:29 +00:00
.locals 0
check-cast p2, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode$RenderContext;
invoke-virtual {p0, p1, p2}, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode;->render(Landroid/text/SpannableStringBuilder;Lcom/discord/utilities/textprocessing/node/ChannelMentionNode$RenderContext;)V
return-void
.end method