TextStyleSpan.smali
.class public Lim/tpelyyftgw/ui/components/TextStyleSpan;
.super Landroid/text/style/MetricAffectingSpan;
.source "TextStyleSpan.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;
}
.end annotation
# static fields
.field public static final FLAG_STYLE_BOLD:I
.field public static final FLAG_STYLE_ITALIC:I
.field public static final FLAG_STYLE_MENTION:I
.field public static final FLAG_STYLE_MONO:I
.field public static final FLAG_STYLE_QUOTE:I
.field public static final FLAG_STYLE_STRIKE:I
.field public static final FLAG_STYLE_UNDERLINE:I
.field public static final FLAG_STYLE_URL:I
# instance fields
.field private color:I
.field private style:Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;
.field private textSize:I
# direct methods
.method static constructor <clinit>()V
.registers 1
const v0, 0x156e
invoke-static {v0}, Lnp/NPFog;->d(I)I
move-result v0
sput v0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->FLAG_STYLE_BOLD:I
const v0, 0x156d
invoke-static {v0}, Lnp/NPFog;->d(I)I
move-result v0
sput v0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->FLAG_STYLE_ITALIC:I
const v0, 0x152f
invoke-static {v0}, Lnp/NPFog;->d(I)I
move-result v0
sput v0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->FLAG_STYLE_MENTION:I
const v0, 0x156b
invoke-static {v0}, Lnp/NPFog;->d(I)I
move-result v0
sput v0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->FLAG_STYLE_MONO:I
const v0, 0x154f
invoke-static {v0}, Lnp/NPFog;->d(I)I
move-result v0
sput v0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->FLAG_STYLE_QUOTE:I
const v0, 0x1567
invoke-static {v0}, Lnp/NPFog;->d(I)I
move-result v0
sput v0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->FLAG_STYLE_STRIKE:I
const v0, 0x157f
invoke-static {v0}, Lnp/NPFog;->d(I)I
move-result v0
sput v0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->FLAG_STYLE_UNDERLINE:I
const v0, 0x15ef
invoke-static {v0}, Lnp/NPFog;->d(I)I
move-result v0
sput v0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->FLAG_STYLE_URL:I
return-void
.end method
.method public constructor <init>(Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;)V
.registers 3
.param p1, "run" # Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;
.line 91
const/4 v0, 0x0
invoke-direct {p0, p1, v0, v0}, Lim/tpelyyftgw/ui/components/TextStyleSpan;-><init>(Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;II)V
.line 92
return-void
.end method
.method public constructor <init>(Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;I)V
.registers 4
.param p1, "run" # Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;
.param p2, "size" # I
.line 95
const/4 v0, 0x0
invoke-direct {p0, p1, p2, v0}, Lim/tpelyyftgw/ui/components/TextStyleSpan;-><init>(Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;II)V
.line 96
return-void
.end method
.method public constructor <init>(Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;II)V
.registers 4
.param p1, "run" # Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;
.param p2, "size" # I
.param p3, "textColor" # I
.line 98
invoke-direct {p0}, Landroid/text/style/MetricAffectingSpan;-><init>()V
.line 99
iput-object p1, p0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->style:Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;
.line 100
if-lez p2, :cond_9
.line 101
iput p2, p0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->textSize:I
.line 103
:cond_9
iput p3, p0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->color:I
.line 104
return-void
.end method
# virtual methods
.method public getStyleFlags()I
.registers 2
.line 107
iget-object v0, p0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->style:Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;
iget v0, v0, Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;->flags:I
return v0
.end method
.method public getTextStyleRun()Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;
.registers 2
.line 111
iget-object v0, p0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->style:Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;
return-object v0
.end method
.method public getTypeface()Landroid/graphics/Typeface;
.registers 2
.line 115
iget-object v0, p0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->style:Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;
invoke-virtual {v0}, Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;->getTypeface()Landroid/graphics/Typeface;
move-result-object v0
return-object v0
.end method
.method public isBold()Z
.registers 3
.line 127
iget-object v0, p0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->style:Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;
invoke-virtual {v0}, Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;->getTypeface()Landroid/graphics/Typeface;
move-result-object v0
const-string v1, "fonts/rmedium.ttf"
invoke-static {v1}, Lim/tpelyyftgw/messenger/AndroidUtilities;->getTypeface(Ljava/lang/String;)Landroid/graphics/Typeface;
move-result-object v1
if-ne v0, v1, :cond_10
const/4 v0, 0x1
goto :goto_11
:cond_10
const/4 v0, 0x0
:goto_11
return v0
.end method
.method public isBoldItalic()Z
.registers 3
.line 135
iget-object v0, p0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->style:Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;
invoke-virtual {v0}, Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;->getTypeface()Landroid/graphics/Typeface;
move-result-object v0
const-string v1, "fonts/rmediumitalic.ttf"
invoke-static {v1}, Lim/tpelyyftgw/messenger/AndroidUtilities;->getTypeface(Ljava/lang/String;)Landroid/graphics/Typeface;
move-result-object v1
if-ne v0, v1, :cond_10
const/4 v0, 0x1
goto :goto_11
:cond_10
const/4 v0, 0x0
:goto_11
return v0
.end method
.method public isItalic()Z
.registers 3
.line 131
iget-object v0, p0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->style:Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;
invoke-virtual {v0}, Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;->getTypeface()Landroid/graphics/Typeface;
move-result-object v0
const-string v1, "fonts/ritalic.ttf"
invoke-static {v1}, Lim/tpelyyftgw/messenger/AndroidUtilities;->getTypeface(Ljava/lang/String;)Landroid/graphics/Typeface;
move-result-object v1
if-ne v0, v1, :cond_10
const/4 v0, 0x1
goto :goto_11
:cond_10
const/4 v0, 0x0
:goto_11
return v0
.end method
.method public isMono()Z
.registers 3
.line 123
iget-object v0, p0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->style:Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;
invoke-virtual {v0}, Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;->getTypeface()Landroid/graphics/Typeface;
move-result-object v0
sget-object v1, Landroid/graphics/Typeface;->MONOSPACE:Landroid/graphics/Typeface;
if-ne v0, v1, :cond_c
const/4 v0, 0x1
goto :goto_d
:cond_c
const/4 v0, 0x0
:goto_d
return v0
.end method
.method public setColor(I)V
.registers 2
.param p1, "value" # I
.line 119
iput p1, p0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->color:I
.line 120
return-void
.end method
.method public updateDrawState(Landroid/text/TextPaint;)V
.registers 3
.param p1, "p" # Landroid/text/TextPaint;
.line 149
iget v0, p0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->textSize:I
if-eqz v0, :cond_8
.line 150
int-to-float v0, v0
invoke-virtual {p1, v0}, Landroid/text/TextPaint;->setTextSize(F)V
.line 152
:cond_8
iget v0, p0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->color:I
if-eqz v0, :cond_f
.line 153
invoke-virtual {p1, v0}, Landroid/text/TextPaint;->setColor(I)V
.line 155
:cond_f
invoke-virtual {p1}, Landroid/text/TextPaint;->getFlags()I
move-result v0
or-int/lit16 v0, v0, 0x80
invoke-virtual {p1, v0}, Landroid/text/TextPaint;->setFlags(I)V
.line 156
iget-object v0, p0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->style:Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;
invoke-virtual {v0, p1}, Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;->applyStyle(Landroid/text/TextPaint;)V
.line 157
return-void
.end method
.method public updateMeasureState(Landroid/text/TextPaint;)V
.registers 3
.param p1, "p" # Landroid/text/TextPaint;
.line 140
iget v0, p0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->textSize:I
if-eqz v0, :cond_8
.line 141
int-to-float v0, v0
invoke-virtual {p1, v0}, Landroid/text/TextPaint;->setTextSize(F)V
.line 143
:cond_8
invoke-virtual {p1}, Landroid/text/TextPaint;->getFlags()I
move-result v0
or-int/lit16 v0, v0, 0x80
invoke-virtual {p1, v0}, Landroid/text/TextPaint;->setFlags(I)V
.line 144
iget-object v0, p0, Lim/tpelyyftgw/ui/components/TextStyleSpan;->style:Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;
invoke-virtual {v0, p1}, Lim/tpelyyftgw/ui/components/TextStyleSpan$TextStyleRun;->applyStyle(Landroid/text/TextPaint;)V
.line 145
return-void
.end method