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
|
|
|
|
.field private final channelId:J
|
|
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
.method public final equals(Ljava/lang/Object;)Z
|
|
|
|
.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
|
|
|
|
|
|
|
|
return p1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
.method public final render(Landroid/text/SpannableStringBuilder;Lcom/discord/utilities/textprocessing/node/ChannelMentionNode$RenderContext;)V
|
|
|
|
.locals 12
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Landroid/text/SpannableStringBuilder;",
|
|
|
|
"TT;)V"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const-string v0, "builder"
|
|
|
|
|
2019-10-09 23:16:36 +00:00
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const-string v0, "renderContext"
|
|
|
|
|
2019-10-09 23:16:36 +00:00
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-interface {p2}, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode$RenderContext;->getContext()Landroid/content/Context;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/text/SpannableStringBuilder;->length()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
new-instance v2, Ljava/util/ArrayList;
|
|
|
|
|
|
|
|
const/4 v3, 0x3
|
|
|
|
|
|
|
|
invoke-direct {v2, v3}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
|
|
|
|
new-instance v3, Landroid/text/style/StyleSpan;
|
|
|
|
|
|
|
|
const/4 v4, 0x1
|
|
|
|
|
|
|
|
invoke-direct {v3, v4}, Landroid/text/style/StyleSpan;-><init>(I)V
|
|
|
|
|
|
|
|
invoke-virtual {v2, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
invoke-interface {p2}, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode$RenderContext;->getChannelNames()Ljava/util/Map;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
|
|
|
|
iget-wide v3, p0, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode;->channelId:J
|
|
|
|
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
invoke-interface {p2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
check-cast p2, Ljava/lang/String;
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 p2, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
2019-10-23 04:50:18 +00:00
|
|
|
const v3, 0x7f0600f1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
|
|
|
|
new-instance v11, Lcom/discord/utilities/spans/ClickableSpan;
|
|
|
|
|
|
|
|
invoke-static {v0, v3}, Lcom/discord/utilities/color/ColorCompat;->getColor(Landroid/content/Context;I)I
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
const/4 v6, 0x0
|
|
|
|
|
|
|
|
const/4 v7, 0x0
|
|
|
|
|
|
|
|
new-instance v3, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode$render$1;
|
|
|
|
|
|
|
|
invoke-direct {v3, p0}, Lcom/discord/utilities/textprocessing/node/ChannelMentionNode$render$1;-><init>(Lcom/discord/utilities/textprocessing/node/ChannelMentionNode;)V
|
|
|
|
|
|
|
|
move-object v8, v3
|
|
|
|
|
|
|
|
check-cast v8, Lkotlin/jvm/functions/Function1;
|
|
|
|
|
|
|
|
const/4 v9, 0x4
|
|
|
|
|
|
|
|
const/4 v10, 0x0
|
|
|
|
|
|
|
|
move-object v4, v11
|
|
|
|
|
|
|
|
invoke-direct/range {v4 .. v10}, Lcom/discord/utilities/spans/ClickableSpan;-><init>(Ljava/lang/Integer;ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
|
|
|
|
invoke-virtual {v2, v11}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
new-instance v4, Landroid/text/style/ForegroundColorSpan;
|
|
|
|
|
|
|
|
invoke-static {v0, v3}, Lcom/discord/utilities/color/ColorCompat;->getColor(Landroid/content/Context;I)I
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
invoke-direct {v4, v3}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V
|
|
|
|
|
|
|
|
invoke-virtual {v2, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
new-instance v3, Landroid/text/style/BackgroundColorSpan;
|
|
|
|
|
2019-10-23 04:50:18 +00:00
|
|
|
const v4, 0x7f0600f2
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
invoke-static {v0, v4}, Lcom/discord/utilities/color/ColorCompat;->getColor(Landroid/content/Context;I)I
|
|
|
|
|
|
|
|
move-result v4
|
|
|
|
|
|
|
|
invoke-direct {v3, v4}, Landroid/text/style/BackgroundColorSpan;-><init>(I)V
|
|
|
|
|
|
|
|
invoke-virtual {v2, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
sget-object v3, Lcom/discord/utilities/channel/ChannelUtils;->INSTANCE:Lcom/discord/utilities/channel/ChannelUtils;
|
|
|
|
|
|
|
|
const/4 v4, 0x0
|
|
|
|
|
|
|
|
invoke-virtual {v3, v0, p2, v4}, Lcom/discord/utilities/channel/ChannelUtils;->getDisplayName(Landroid/content/Context;Ljava/lang/String;I)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
check-cast p2, Ljava/lang/CharSequence;
|
|
|
|
|
|
|
|
invoke-virtual {p1, p2}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;
|
|
|
|
|
|
|
|
check-cast v2, Ljava/lang/Iterable;
|
|
|
|
|
|
|
|
invoke-interface {v2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
:goto_2
|
|
|
|
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
|
|
|
|
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Landroid/text/style/CharacterStyle;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/text/SpannableStringBuilder;->length()I
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
const/16 v3, 0x21
|
|
|
|
|
|
|
|
invoke-virtual {p1, v0, v1, v2, v3}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V
|
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final bridge synthetic render(Landroid/text/SpannableStringBuilder;Ljava/lang/Object;)V
|
|
|
|
.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
|