133 lines
2.8 KiB
Smali
133 lines
2.8 KiB
Smali
.class public final Lcom/discord/utilities/spans/TypefaceSpanCompat;
|
|
.super Landroid/text/style/MetricAffectingSpan;
|
|
.source "TypefaceSpanCompat.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/utilities/spans/TypefaceSpanCompat$Monospace;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final typeface:Landroid/graphics/Typeface;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/graphics/Typeface;)V
|
|
.locals 0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-direct {p0}, Landroid/text/style/MetricAffectingSpan;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/utilities/spans/TypefaceSpanCompat;->typeface:Landroid/graphics/Typeface;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "typeface"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private final apply(Landroid/graphics/Paint;)V
|
|
.locals 2
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Paint;->getTypeface()Landroid/graphics/Typeface;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Landroid/graphics/Typeface;->getStyle()I
|
|
|
|
move-result v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
iget-object v1, p0, Lcom/discord/utilities/spans/TypefaceSpanCompat;->typeface:Landroid/graphics/Typeface;
|
|
|
|
invoke-virtual {v1}, Landroid/graphics/Typeface;->getStyle()I
|
|
|
|
move-result v1
|
|
|
|
not-int v1, v1
|
|
|
|
and-int/2addr v0, v1
|
|
|
|
and-int/lit8 v1, v0, 0x1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-virtual {p1, v1}, Landroid/graphics/Paint;->setFakeBoldText(Z)V
|
|
|
|
:cond_1
|
|
and-int/lit8 v0, v0, 0x2
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
const/high16 v0, -0x41800000 # -0.25f
|
|
|
|
invoke-virtual {p1, v0}, Landroid/graphics/Paint;->setTextSkewX(F)V
|
|
|
|
:cond_2
|
|
iget-object v0, p0, Lcom/discord/utilities/spans/TypefaceSpanCompat;->typeface:Landroid/graphics/Typeface;
|
|
|
|
invoke-virtual {p1, v0}, Landroid/graphics/Paint;->setTypeface(Landroid/graphics/Typeface;)Landroid/graphics/Typeface;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public updateDrawState(Landroid/text/TextPaint;)V
|
|
.locals 0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/spans/TypefaceSpanCompat;->apply(Landroid/graphics/Paint;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "drawState"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public updateMeasureState(Landroid/text/TextPaint;)V
|
|
.locals 0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/spans/TypefaceSpanCompat;->apply(Landroid/graphics/Paint;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "paint"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|