87 lines
2.2 KiB
Smali
87 lines
2.2 KiB
Smali
.class public Lcom/discord/utilities/textprocessing/AstRenderer;
|
|
.super Ljava/lang/Object;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static render(Ljava/util/Collection;Ljava/lang/Object;)Lcom/facebook/drawee/span/DraweeSpanStringBuilder;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Collection<",
|
|
"+",
|
|
"Lcom/discord/simpleast/core/node/Node<",
|
|
"TT;>;>;TT;)",
|
|
"Lcom/facebook/drawee/span/DraweeSpanStringBuilder;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Lcom/facebook/drawee/span/DraweeSpanStringBuilder;
|
|
|
|
invoke-direct {v0}, Lcom/facebook/drawee/span/DraweeSpanStringBuilder;-><init>()V
|
|
|
|
invoke-static {v0, p0, p1}, Lcom/discord/simpleast/core/a/b;->a(Landroid/text/SpannableStringBuilder;Ljava/util/Collection;Ljava/lang/Object;)Landroid/text/SpannableStringBuilder;
|
|
|
|
invoke-static {v0}, Lcom/discord/utilities/textprocessing/AstRenderer;->trim(Landroid/text/SpannableStringBuilder;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private static trim(Landroid/text/SpannableStringBuilder;)V
|
|
.locals 5
|
|
|
|
invoke-virtual {p0}, Landroid/text/SpannableStringBuilder;->length()I
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v1, v0, [C
|
|
|
|
invoke-virtual {p0}, Landroid/text/SpannableStringBuilder;->length()I
|
|
|
|
move-result v2
|
|
|
|
sub-int/2addr v2, v0
|
|
|
|
invoke-virtual {p0}, Landroid/text/SpannableStringBuilder;->length()I
|
|
|
|
move-result v3
|
|
|
|
const/4 v4, 0x0
|
|
|
|
invoke-virtual {p0, v2, v3, v1, v4}, Landroid/text/SpannableStringBuilder;->getChars(II[CI)V
|
|
|
|
aget-char v1, v1, v4
|
|
|
|
const/16 v2, 0xa
|
|
|
|
if-ne v1, v2, :cond_0
|
|
|
|
invoke-virtual {p0}, Landroid/text/SpannableStringBuilder;->length()I
|
|
|
|
move-result v1
|
|
|
|
sub-int/2addr v1, v0
|
|
|
|
invoke-virtual {p0}, Landroid/text/SpannableStringBuilder;->length()I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p0, v1, v0}, Landroid/text/SpannableStringBuilder;->delete(II)Landroid/text/SpannableStringBuilder;
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|