2020-05-17 12:40:10 +00:00
|
|
|
.class public Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "AppCompatTextViewAutoSizeHelper.java"
|
|
|
|
|
|
|
|
|
|
|
|
# static fields
|
|
|
|
.field public static final DEFAULT_AUTO_SIZE_GRANULARITY_IN_PX:I = 0x1
|
|
|
|
|
|
|
|
.field public static final DEFAULT_AUTO_SIZE_MAX_TEXT_SIZE_IN_SP:I = 0x70
|
|
|
|
|
|
|
|
.field public static final DEFAULT_AUTO_SIZE_MIN_TEXT_SIZE_IN_SP:I = 0xc
|
|
|
|
|
|
|
|
.field public static final TAG:Ljava/lang/String; = "ACTVAutoSizeHelper"
|
|
|
|
|
|
|
|
.field public static final TEMP_RECTF:Landroid/graphics/RectF;
|
|
|
|
|
|
|
|
.field public static final UNSET_AUTO_SIZE_UNIFORM_CONFIGURATION_VALUE:F = -1.0f
|
|
|
|
|
|
|
|
.field public static final VERY_WIDE:I = 0x100000
|
|
|
|
|
|
|
|
.field public static sTextViewFieldByNameCache:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Ljava/util/concurrent/ConcurrentHashMap<",
|
|
|
|
"Ljava/lang/String;",
|
|
|
|
"Ljava/lang/reflect/Field;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
.field public static sTextViewMethodByNameCache:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Ljava/util/concurrent/ConcurrentHashMap<",
|
|
|
|
"Ljava/lang/String;",
|
|
|
|
"Ljava/lang/reflect/Method;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
|
|
|
.field public mAutoSizeMaxTextSizeInPx:F
|
|
|
|
|
|
|
|
.field public mAutoSizeMinTextSizeInPx:F
|
|
|
|
|
|
|
|
.field public mAutoSizeStepGranularityInPx:F
|
|
|
|
|
|
|
|
.field public mAutoSizeTextSizesInPx:[I
|
|
|
|
|
|
|
|
.field public mAutoSizeTextType:I
|
|
|
|
|
|
|
|
.field public final mContext:Landroid/content/Context;
|
|
|
|
|
|
|
|
.field public mHasPresetAutoSizeValues:Z
|
|
|
|
|
|
|
|
.field public mNeedsAutoSizeText:Z
|
|
|
|
|
|
|
|
.field public mTempTextPaint:Landroid/text/TextPaint;
|
|
|
|
|
|
|
|
.field public final mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public static constructor <clinit>()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
new-instance v0, Landroid/graphics/RectF;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Landroid/graphics/RectF;-><init>()V
|
|
|
|
|
|
|
|
sput-object v0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->TEMP_RECTF:Landroid/graphics/RectF;
|
|
|
|
|
|
|
|
new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V
|
|
|
|
|
|
|
|
sput-object v0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->sTextViewMethodByNameCache:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
|
|
|
|
new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V
|
|
|
|
|
|
|
|
sput-object v0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->sTextViewFieldByNameCache:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public constructor <init>(Landroid/widget/TextView;)V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
iput v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextType:I
|
|
|
|
|
|
|
|
iput-boolean v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mNeedsAutoSizeText:Z
|
|
|
|
|
|
|
|
const/high16 v1, -0x40800000 # -1.0f
|
|
|
|
|
|
|
|
iput v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeStepGranularityInPx:F
|
|
|
|
|
|
|
|
iput v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeMinTextSizeInPx:F
|
|
|
|
|
|
|
|
iput v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeMaxTextSizeInPx:F
|
|
|
|
|
|
|
|
new-array v1, v0, [I
|
|
|
|
|
|
|
|
iput-object v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextSizesInPx:[I
|
|
|
|
|
|
|
|
iput-boolean v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mHasPresetAutoSizeValues:Z
|
|
|
|
|
|
|
|
iput-object p1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
iput-object p1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mContext:Landroid/content/Context;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static accessAndReturnWithDefault(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.locals 2
|
|
|
|
.param p0 # Ljava/lang/Object;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.param p1 # Ljava/lang/String;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.param p2 # Ljava/lang/Object;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"<T:",
|
|
|
|
"Ljava/lang/Object;",
|
|
|
|
">(",
|
|
|
|
"Ljava/lang/Object;",
|
|
|
|
"Ljava/lang/String;",
|
|
|
|
"TT;)TT;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
invoke-static {p1}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->getTextViewField(Ljava/lang/String;)Ljava/lang/reflect/Field;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
return-object p2
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/reflect/Field;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
:try_end_0
|
|
|
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
|
|
|
|
:catch_0
|
|
|
|
move-exception p0
|
|
|
|
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
const-string v1, "Failed to access TextView#"
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string p1, " member"
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const-string v0, "ACTVAutoSizeHelper"
|
|
|
|
|
|
|
|
invoke-static {v0, p1, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
|
|
|
|
return-object p2
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private cleanupAutoSizePresetSizes([I)[I
|
|
|
|
.locals 6
|
|
|
|
|
|
|
|
array-length v0, p1
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-static {p1}, Ljava/util/Arrays;->sort([I)V
|
|
|
|
|
|
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
|
|
|
|
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
const/4 v3, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-ge v3, v0, :cond_2
|
|
|
|
|
|
|
|
aget v4, p1, v3
|
|
|
|
|
|
|
|
if-lez v4, :cond_1
|
|
|
|
|
|
|
|
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
invoke-static {v1, v5}, Ljava/util/Collections;->binarySearch(Ljava/util/List;Ljava/lang/Object;)I
|
|
|
|
|
|
|
|
move-result v5
|
|
|
|
|
|
|
|
if-gez v5, :cond_1
|
|
|
|
|
|
|
|
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {v1, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_2
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {v1}, Ljava/util/ArrayList;->size()I
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
if-ne v0, v3, :cond_3
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
|
|
|
|
:cond_3
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {v1}, Ljava/util/ArrayList;->size()I
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
new-array v0, p1, [I
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
if-ge v2, p1, :cond_4
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
check-cast v3, Ljava/lang/Integer;
|
|
|
|
|
|
|
|
invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
aput v3, v0, v2
|
|
|
|
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private clearAutoSizeConfiguration()V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
iput v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextType:I
|
|
|
|
|
|
|
|
const/high16 v1, -0x40800000 # -1.0f
|
|
|
|
|
|
|
|
iput v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeMinTextSizeInPx:F
|
|
|
|
|
|
|
|
iput v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeMaxTextSizeInPx:F
|
|
|
|
|
|
|
|
iput v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeStepGranularityInPx:F
|
|
|
|
|
|
|
|
new-array v1, v0, [I
|
|
|
|
|
|
|
|
iput-object v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextSizesInPx:[I
|
|
|
|
|
|
|
|
iput-boolean v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mNeedsAutoSizeText:Z
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private createStaticLayoutForMeasuring(Ljava/lang/CharSequence;Landroid/text/Layout$Alignment;II)Landroid/text/StaticLayout;
|
|
|
|
.locals 3
|
|
|
|
.annotation build Landroidx/annotation/RequiresApi;
|
|
|
|
value = 0x17
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-interface {p1}, Ljava/lang/CharSequence;->length()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTempTextPaint:Landroid/text/TextPaint;
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
invoke-static {p1, v2, v0, v1, p3}, Landroid/text/StaticLayout$Builder;->obtain(Ljava/lang/CharSequence;IILandroid/text/TextPaint;I)Landroid/text/StaticLayout$Builder;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-virtual {p1, p2}, Landroid/text/StaticLayout$Builder;->setAlignment(Landroid/text/Layout$Alignment;)Landroid/text/StaticLayout$Builder;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
iget-object p3, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {p3}, Landroid/widget/TextView;->getLineSpacingExtra()F
|
|
|
|
|
|
|
|
move-result p3
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/widget/TextView;->getLineSpacingMultiplier()F
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
invoke-virtual {p2, p3, v0}, Landroid/text/StaticLayout$Builder;->setLineSpacing(FF)Landroid/text/StaticLayout$Builder;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
iget-object p3, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {p3}, Landroid/widget/TextView;->getIncludeFontPadding()Z
|
|
|
|
|
|
|
|
move-result p3
|
|
|
|
|
|
|
|
invoke-virtual {p2, p3}, Landroid/text/StaticLayout$Builder;->setIncludePad(Z)Landroid/text/StaticLayout$Builder;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
iget-object p3, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {p3}, Landroid/widget/TextView;->getBreakStrategy()I
|
|
|
|
|
|
|
|
move-result p3
|
|
|
|
|
|
|
|
invoke-virtual {p2, p3}, Landroid/text/StaticLayout$Builder;->setBreakStrategy(I)Landroid/text/StaticLayout$Builder;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
iget-object p3, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {p3}, Landroid/widget/TextView;->getHyphenationFrequency()I
|
|
|
|
|
|
|
|
move-result p3
|
|
|
|
|
|
|
|
invoke-virtual {p2, p3}, Landroid/text/StaticLayout$Builder;->setHyphenationFrequency(I)Landroid/text/StaticLayout$Builder;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
const/4 p3, -0x1
|
|
|
|
|
|
|
|
if-ne p4, p3, :cond_0
|
|
|
|
|
|
|
|
const p4, 0x7fffffff
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {p2, p4}, Landroid/text/StaticLayout$Builder;->setMaxLines(I)Landroid/text/StaticLayout$Builder;
|
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
sget p2, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
|
|
|
|
const/16 p3, 0x1d
|
|
|
|
|
|
|
|
if-lt p2, p3, :cond_1
|
|
|
|
|
|
|
|
iget-object p2, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {p2}, Landroid/widget/TextView;->getTextDirectionHeuristic()Landroid/text/TextDirectionHeuristic;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
iget-object p2, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
const-string p3, "getTextDirectionHeuristic"
|
|
|
|
|
|
|
|
sget-object p4, Landroid/text/TextDirectionHeuristics;->FIRSTSTRONG_LTR:Landroid/text/TextDirectionHeuristic;
|
|
|
|
|
|
|
|
invoke-static {p2, p3, p4}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->invokeAndReturnWithDefault(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
check-cast p2, Landroid/text/TextDirectionHeuristic;
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
invoke-virtual {p1, p2}, Landroid/text/StaticLayout$Builder;->setTextDirection(Landroid/text/TextDirectionHeuristic;)Landroid/text/StaticLayout$Builder;
|
|
|
|
:try_end_0
|
|
|
|
.catch Ljava/lang/ClassCastException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:catch_0
|
|
|
|
const-string p2, "ACTVAutoSizeHelper"
|
|
|
|
|
|
|
|
const-string p3, "Failed to obtain TextDirectionHeuristic, auto size may be incorrect"
|
|
|
|
|
|
|
|
invoke-static {p2, p3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
invoke-virtual {p1}, Landroid/text/StaticLayout$Builder;->build()Landroid/text/StaticLayout;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private createStaticLayoutForMeasuringPre16(Ljava/lang/CharSequence;Landroid/text/Layout$Alignment;I)Landroid/text/StaticLayout;
|
|
|
|
.locals 9
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
const/high16 v1, 0x3f800000 # 1.0f
|
|
|
|
|
|
|
|
invoke-static {v1}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
const-string v2, "mSpacingMult"
|
|
|
|
|
|
|
|
invoke-static {v0, v2, v1}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->accessAndReturnWithDefault(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Ljava/lang/Float;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Float;->floatValue()F
|
|
|
|
|
|
|
|
move-result v6
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
invoke-static {v1}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
const-string v2, "mSpacingAdd"
|
|
|
|
|
|
|
|
invoke-static {v0, v2, v1}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->accessAndReturnWithDefault(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Ljava/lang/Float;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Float;->floatValue()F
|
|
|
|
|
|
|
|
move-result v7
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
sget-object v1, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const-string v2, "mIncludePad"
|
|
|
|
|
|
|
|
invoke-static {v0, v2, v1}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->accessAndReturnWithDefault(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Ljava/lang/Boolean;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z
|
|
|
|
|
|
|
|
move-result v8
|
|
|
|
|
|
|
|
new-instance v0, Landroid/text/StaticLayout;
|
|
|
|
|
|
|
|
iget-object v3, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTempTextPaint:Landroid/text/TextPaint;
|
|
|
|
|
|
|
|
move-object v1, v0
|
|
|
|
|
|
|
|
move-object v2, p1
|
|
|
|
|
|
|
|
move v4, p3
|
|
|
|
|
|
|
|
move-object v5, p2
|
|
|
|
|
|
|
|
invoke-direct/range {v1 .. v8}, Landroid/text/StaticLayout;-><init>(Ljava/lang/CharSequence;Landroid/text/TextPaint;ILandroid/text/Layout$Alignment;FFZ)V
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private createStaticLayoutForMeasuringPre23(Ljava/lang/CharSequence;Landroid/text/Layout$Alignment;I)Landroid/text/StaticLayout;
|
|
|
|
.locals 9
|
|
|
|
.annotation build Landroidx/annotation/RequiresApi;
|
|
|
|
value = 0x10
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/widget/TextView;->getLineSpacingMultiplier()F
|
|
|
|
|
|
|
|
move-result v6
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/widget/TextView;->getLineSpacingExtra()F
|
|
|
|
|
|
|
|
move-result v7
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/widget/TextView;->getIncludeFontPadding()Z
|
|
|
|
|
|
|
|
move-result v8
|
|
|
|
|
|
|
|
new-instance v0, Landroid/text/StaticLayout;
|
|
|
|
|
|
|
|
iget-object v3, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTempTextPaint:Landroid/text/TextPaint;
|
|
|
|
|
|
|
|
move-object v1, v0
|
|
|
|
|
|
|
|
move-object v2, p1
|
|
|
|
|
|
|
|
move v4, p3
|
|
|
|
|
|
|
|
move-object v5, p2
|
|
|
|
|
|
|
|
invoke-direct/range {v1 .. v8}, Landroid/text/StaticLayout;-><init>(Ljava/lang/CharSequence;Landroid/text/TextPaint;ILandroid/text/Layout$Alignment;FFZ)V
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private findLargestTextSizeWhichFits(Landroid/graphics/RectF;)I
|
|
|
|
.locals 5
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextSizesInPx:[I
|
|
|
|
|
|
|
|
array-length v0, v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
const/4 v2, 0x1
|
|
|
|
|
|
|
|
sub-int/2addr v0, v2
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-gt v1, v0, :cond_1
|
|
|
|
|
|
|
|
add-int v2, v1, v0
|
|
|
|
|
|
|
|
div-int/lit8 v2, v2, 0x2
|
|
|
|
|
|
|
|
iget-object v3, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextSizesInPx:[I
|
|
|
|
|
|
|
|
aget v3, v3, v2
|
|
|
|
|
|
|
|
invoke-direct {p0, v3, p1}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->suggestedSizeFitsInSpace(ILandroid/graphics/RectF;)Z
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
|
|
|
|
move v4, v2
|
|
|
|
|
|
|
|
move v2, v1
|
|
|
|
|
|
|
|
move v1, v4
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
add-int/lit8 v2, v2, -0x1
|
|
|
|
|
|
|
|
move v0, v2
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
iget-object p1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextSizesInPx:[I
|
|
|
|
|
|
|
|
aget p1, p1, v2
|
|
|
|
|
|
|
|
return p1
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
new-instance p1, Ljava/lang/IllegalStateException;
|
|
|
|
|
|
|
|
const-string v0, "No available text sizes to choose from."
|
|
|
|
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static getTextViewField(Ljava/lang/String;)Ljava/lang/reflect/Field;
|
|
|
|
.locals 3
|
|
|
|
.param p0 # Ljava/lang/String;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
sget-object v0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->sTextViewFieldByNameCache:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p0}, Ljava/util/concurrent/ConcurrentHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Ljava/lang/reflect/Field;
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
const-class v0, Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/reflect/Field;->setAccessible(Z)V
|
|
|
|
|
|
|
|
sget-object v1, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->sTextViewFieldByNameCache:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
|
|
|
|
invoke-virtual {v1, p0, v0}, Ljava/util/concurrent/ConcurrentHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:try_end_0
|
|
|
|
.catch Ljava/lang/NoSuchFieldException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
return-object v0
|
|
|
|
|
|
|
|
:catch_0
|
|
|
|
move-exception v0
|
|
|
|
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
const-string v2, "Failed to access TextView#"
|
|
|
|
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string p0, " member"
|
|
|
|
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
const-string v1, "ACTVAutoSizeHelper"
|
|
|
|
|
|
|
|
invoke-static {v1, p0, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
|
|
|
|
const/4 p0, 0x0
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static getTextViewMethod(Ljava/lang/String;)Ljava/lang/reflect/Method;
|
|
|
|
.locals 3
|
|
|
|
.param p0 # Ljava/lang/String;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
sget-object v0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->sTextViewMethodByNameCache:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p0}, Ljava/util/concurrent/ConcurrentHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
const-class v0, Landroid/widget/TextView;
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
new-array v1, v1, [Ljava/lang/Class;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p0, v1}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/reflect/Method;->setAccessible(Z)V
|
|
|
|
|
|
|
|
sget-object v1, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->sTextViewMethodByNameCache:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
|
|
|
|
invoke-virtual {v1, p0, v0}, Ljava/util/concurrent/ConcurrentHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:try_end_0
|
|
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
return-object v0
|
|
|
|
|
|
|
|
:catch_0
|
|
|
|
move-exception v0
|
|
|
|
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
const-string v2, "Failed to retrieve TextView#"
|
|
|
|
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string p0, "() method"
|
|
|
|
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
const-string v1, "ACTVAutoSizeHelper"
|
|
|
|
|
|
|
|
invoke-static {v1, p0, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
|
|
|
|
const/4 p0, 0x0
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static invokeAndReturnWithDefault(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.locals 4
|
|
|
|
.param p0 # Ljava/lang/Object;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.param p1 # Ljava/lang/String;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.param p2 # Ljava/lang/Object;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"<T:",
|
|
|
|
"Ljava/lang/Object;",
|
|
|
|
">(",
|
|
|
|
"Ljava/lang/Object;",
|
|
|
|
"Ljava/lang/String;",
|
|
|
|
"TT;)TT;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
invoke-static {p1}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->getTextViewMethod(Ljava/lang/String;)Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
new-array v2, v0, [Ljava/lang/Object;
|
|
|
|
|
|
|
|
invoke-virtual {v1, p0, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
:try_end_0
|
|
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:catchall_0
|
|
|
|
move-exception p0
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:catch_0
|
|
|
|
move-exception p0
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
:try_start_1
|
|
|
|
const-string v1, "ACTVAutoSizeHelper"
|
|
|
|
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
const-string v3, "Failed to invoke TextView#"
|
|
|
|
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string p1, "() method"
|
|
|
|
|
|
|
|
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-static {v1, p1, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
:try_end_1
|
|
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
return-object p2
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
throw p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private setRawTextSize(F)V
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/widget/TextView;->getPaint()Landroid/text/TextPaint;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/text/TextPaint;->getTextSize()F
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
cmpl-float v0, p1, v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/widget/TextView;->getPaint()Landroid/text/TextPaint;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Landroid/text/TextPaint;->setTextSize(F)V
|
|
|
|
|
|
|
|
iget-object p1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/widget/TextView;->isInLayout()Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/widget/TextView;->getLayout()Landroid/text/Layout;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
iput-boolean v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mNeedsAutoSizeText:Z
|
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
const-string v1, "nullLayouts"
|
|
|
|
|
|
|
|
invoke-static {v1}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->getTextViewMethod(Ljava/lang/String;)Ljava/lang/reflect/Method;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
|
|
|
|
iget-object v2, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
new-array v0, v0, [Ljava/lang/Object;
|
|
|
|
|
|
|
|
invoke-virtual {v1, v2, v0}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:try_end_0
|
|
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:catch_0
|
|
|
|
move-exception v0
|
|
|
|
|
|
|
|
const-string v1, "ACTVAutoSizeHelper"
|
|
|
|
|
|
|
|
const-string v2, "Failed to invoke TextView#nullLayouts() method"
|
|
|
|
|
|
|
|
invoke-static {v1, v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
:goto_0
|
|
|
|
if-nez p1, :cond_1
|
|
|
|
|
|
|
|
iget-object p1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/widget/TextView;->requestLayout()V
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
iget-object p1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/widget/TextView;->forceLayout()V
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
iget-object p1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/widget/TextView;->invalidate()V
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private setupAutoSizeText()Z
|
|
|
|
.locals 7
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->supportsAutoSizeText()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
|
|
|
|
iget v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextType:I
|
|
|
|
|
|
|
|
const/4 v2, 0x1
|
|
|
|
|
|
|
|
if-ne v0, v2, :cond_3
|
|
|
|
|
|
|
|
iget-boolean v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mHasPresetAutoSizeValues:Z
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextSizesInPx:[I
|
|
|
|
|
|
|
|
array-length v0, v0
|
|
|
|
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeMaxTextSizeInPx:F
|
|
|
|
|
|
|
|
iget v3, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeMinTextSizeInPx:F
|
|
|
|
|
|
|
|
sub-float/2addr v0, v3
|
|
|
|
|
|
|
|
iget v3, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeStepGranularityInPx:F
|
|
|
|
|
|
|
|
div-float/2addr v0, v3
|
|
|
|
|
|
|
|
float-to-double v3, v0
|
|
|
|
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Math;->floor(D)D
|
|
|
|
|
|
|
|
move-result-wide v3
|
|
|
|
|
|
|
|
double-to-int v0, v3
|
|
|
|
|
|
|
|
add-int/2addr v0, v2
|
|
|
|
|
|
|
|
new-array v3, v0, [I
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-ge v1, v0, :cond_1
|
|
|
|
|
|
|
|
iget v4, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeMinTextSizeInPx:F
|
|
|
|
|
|
|
|
int-to-float v5, v1
|
|
|
|
|
|
|
|
iget v6, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeStepGranularityInPx:F
|
|
|
|
|
|
|
|
mul-float v5, v5, v6
|
|
|
|
|
|
|
|
add-float/2addr v5, v4
|
|
|
|
|
|
|
|
invoke-static {v5}, Ljava/lang/Math;->round(F)I
|
|
|
|
|
|
|
|
move-result v4
|
|
|
|
|
|
|
|
aput v4, v3, v1
|
|
|
|
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
invoke-direct {p0, v3}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->cleanupAutoSizePresetSizes([I)[I
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iput-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextSizesInPx:[I
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
iput-boolean v2, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mNeedsAutoSizeText:Z
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
iput-boolean v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mNeedsAutoSizeText:Z
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
iget-boolean v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mNeedsAutoSizeText:Z
|
|
|
|
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private setupAutoSizeUniformPresetSizes(Landroid/content/res/TypedArray;)V
|
|
|
|
.locals 4
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/content/res/TypedArray;->length()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
new-array v1, v0, [I
|
|
|
|
|
|
|
|
if-lez v0, :cond_1
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-ge v2, v0, :cond_0
|
|
|
|
|
|
|
|
const/4 v3, -0x1
|
|
|
|
|
|
|
|
invoke-virtual {p1, v2, v3}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
aput v3, v1, v2
|
|
|
|
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-direct {p0, v1}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->cleanupAutoSizePresetSizes([I)[I
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
iput-object p1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextSizesInPx:[I
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->setupAutoSizeUniformPresetSizesConfiguration()Z
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private setupAutoSizeUniformPresetSizesConfiguration()Z
|
|
|
|
.locals 4
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextSizesInPx:[I
|
|
|
|
|
|
|
|
array-length v0, v0
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
const/4 v2, 0x1
|
|
|
|
|
|
|
|
if-lez v0, :cond_0
|
|
|
|
|
|
|
|
const/4 v3, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
iput-boolean v3, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mHasPresetAutoSizeValues:Z
|
|
|
|
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
|
|
|
|
iput v2, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextType:I
|
|
|
|
|
|
|
|
iget-object v3, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextSizesInPx:[I
|
|
|
|
|
|
|
|
aget v1, v3, v1
|
|
|
|
|
|
|
|
int-to-float v1, v1
|
|
|
|
|
|
|
|
iput v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeMinTextSizeInPx:F
|
|
|
|
|
|
|
|
sub-int/2addr v0, v2
|
|
|
|
|
|
|
|
aget v0, v3, v0
|
|
|
|
|
|
|
|
int-to-float v0, v0
|
|
|
|
|
|
|
|
iput v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeMaxTextSizeInPx:F
|
|
|
|
|
|
|
|
const/high16 v0, -0x40800000 # -1.0f
|
|
|
|
|
|
|
|
iput v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeStepGranularityInPx:F
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
iget-boolean v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mHasPresetAutoSizeValues:Z
|
|
|
|
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private suggestedSizeFitsInSpace(ILandroid/graphics/RectF;)Z
|
|
|
|
.locals 5
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/widget/TextView;->getText()Ljava/lang/CharSequence;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Landroid/widget/TextView;->getTransformationMethod()Landroid/text/method/TransformationMethod;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
|
|
|
|
iget-object v2, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-interface {v1, v0, v2}, Landroid/text/method/TransformationMethod;->getTransformation(Ljava/lang/CharSequence;Landroid/view/View;)Ljava/lang/CharSequence;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
|
|
|
|
move-object v0, v1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Landroid/widget/TextView;->getMaxLines()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->initTempTextPaint(I)V
|
|
|
|
|
|
|
|
iget-object p1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
sget-object v2, Landroid/text/Layout$Alignment;->ALIGN_NORMAL:Landroid/text/Layout$Alignment;
|
|
|
|
|
|
|
|
const-string v3, "getLayoutAlignment"
|
|
|
|
|
|
|
|
invoke-static {p1, v3, v2}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->invokeAndReturnWithDefault(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
check-cast p1, Landroid/text/Layout$Alignment;
|
|
|
|
|
|
|
|
iget v2, p2, Landroid/graphics/RectF;->right:F
|
|
|
|
|
|
|
|
invoke-static {v2}, Ljava/lang/Math;->round(F)I
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0, p1, v2, v1}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->createLayout(Ljava/lang/CharSequence;Landroid/text/Layout$Alignment;II)Landroid/text/StaticLayout;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const/4 v2, -0x1
|
|
|
|
|
|
|
|
const/4 v3, 0x0
|
|
|
|
|
|
|
|
const/4 v4, 0x1
|
|
|
|
|
|
|
|
if-eq v1, v2, :cond_2
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/text/StaticLayout;->getLineCount()I
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
if-gt v2, v1, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/text/StaticLayout;->getLineCount()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
sub-int/2addr v1, v4
|
|
|
|
|
|
|
|
invoke-virtual {p1, v1}, Landroid/text/StaticLayout;->getLineEnd(I)I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/lang/CharSequence;->length()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eq v1, v0, :cond_2
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return v3
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
invoke-virtual {p1}, Landroid/text/StaticLayout;->getHeight()I
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
int-to-float p1, p1
|
|
|
|
|
|
|
|
iget p2, p2, Landroid/graphics/RectF;->bottom:F
|
|
|
|
|
|
|
|
cmpl-float p1, p1, p2
|
|
|
|
|
|
|
|
if-lez p1, :cond_3
|
|
|
|
|
|
|
|
return v3
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
return v4
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private supportsAutoSizeText()Z
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
instance-of v0, v0, Landroidx/appcompat/widget/AppCompatEditText;
|
|
|
|
|
|
|
|
xor-int/lit8 v0, v0, 0x1
|
|
|
|
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private validateAndSetAutoSizeTextTypeUniformConfiguration(FFF)V
|
|
|
|
.locals 3
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
|
|
value = {
|
|
|
|
Ljava/lang/IllegalArgumentException;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const-string v0, "px) is less or equal to (0px)"
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
cmpg-float v2, p1, v1
|
|
|
|
|
|
|
|
if-lez v2, :cond_2
|
|
|
|
|
|
|
|
cmpg-float v2, p2, p1
|
|
|
|
|
|
|
|
if-lez v2, :cond_1
|
|
|
|
|
|
|
|
cmpg-float v1, p3, v1
|
|
|
|
|
|
|
|
if-lez v1, :cond_0
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
iput v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextType:I
|
|
|
|
|
|
|
|
iput p1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeMinTextSizeInPx:F
|
|
|
|
|
|
|
|
iput p2, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeMaxTextSizeInPx:F
|
|
|
|
|
|
|
|
iput p3, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeStepGranularityInPx:F
|
|
|
|
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
iput-boolean p1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mHasPresetAutoSizeValues:Z
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
|
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
const-string v1, "The auto-size step granularity ("
|
|
|
|
|
|
|
|
invoke-virtual {p2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw p1
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
new-instance p3, Ljava/lang/IllegalArgumentException;
|
|
|
|
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
const-string v1, "Maximum auto-size text size ("
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string p2, "px) is less or equal to minimum auto-size text size ("
|
|
|
|
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string p1, "px)"
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-direct {p3, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw p3
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
new-instance p2, Ljava/lang/IllegalArgumentException;
|
|
|
|
|
|
|
|
new-instance p3, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {p3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
const-string v1, "Minimum auto-size text size ("
|
|
|
|
|
|
|
|
invoke-virtual {p3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {p3, p1}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {p3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw p2
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public autoSizeText()V
|
2020-07-08 16:44:49 +00:00
|
|
|
.locals 4
|
2020-05-17 12:40:10 +00:00
|
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
|
|
value = {
|
|
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->isAutoSizeEnabled()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget-boolean v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mNeedsAutoSizeText:Z
|
|
|
|
|
|
|
|
if-eqz v0, :cond_7
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/widget/TextView;->getMeasuredHeight()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-lez v0, :cond_6
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/widget/TextView;->getMeasuredWidth()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-gtz v0, :cond_1
|
|
|
|
|
|
|
|
goto/16 :goto_2
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
|
|
|
|
const/16 v1, 0x1d
|
|
|
|
|
|
|
|
if-lt v0, v1, :cond_2
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/widget/TextView;->isHorizontallyScrollable()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const-string v1, "getHorizontallyScrolling"
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
sget-object v2, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-static {v0, v1, v2}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->invokeAndReturnWithDefault(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Ljava/lang/Boolean;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
|
|
|
|
const/high16 v0, 0x100000
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/widget/TextView;->getMeasuredWidth()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Landroid/widget/TextView;->getTotalPaddingLeft()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Landroid/widget/TextView;->getTotalPaddingRight()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Landroid/widget/TextView;->getHeight()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
iget-object v2, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {v2}, Landroid/widget/TextView;->getCompoundPaddingBottom()I
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
move-result v2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
sub-int/2addr v1, v2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
iget-object v2, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {v2}, Landroid/widget/TextView;->getCompoundPaddingTop()I
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
move-result v2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
sub-int/2addr v1, v2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
if-lez v0, :cond_6
|
|
|
|
|
|
|
|
if-gtz v1, :cond_4
|
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_4
|
2020-07-08 16:44:49 +00:00
|
|
|
sget-object v2, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->TEMP_RECTF:Landroid/graphics/RectF;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
monitor-enter v2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:try_start_0
|
2020-07-08 16:44:49 +00:00
|
|
|
sget-object v3, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->TEMP_RECTF:Landroid/graphics/RectF;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-virtual {v3}, Landroid/graphics/RectF;->setEmpty()V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
sget-object v3, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->TEMP_RECTF:Landroid/graphics/RectF;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
int-to-float v0, v0
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
iput v0, v3, Landroid/graphics/RectF;->right:F
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
sget-object v0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->TEMP_RECTF:Landroid/graphics/RectF;
|
|
|
|
|
|
|
|
int-to-float v1, v1
|
|
|
|
|
|
|
|
iput v1, v0, Landroid/graphics/RectF;->bottom:F
|
|
|
|
|
|
|
|
sget-object v0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->TEMP_RECTF:Landroid/graphics/RectF;
|
|
|
|
|
|
|
|
invoke-direct {p0, v0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->findLargestTextSizeWhichFits(Landroid/graphics/RectF;)I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
int-to-float v0, v0
|
|
|
|
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Landroid/widget/TextView;->getTextSize()F
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
cmpl-float v1, v0, v1
|
|
|
|
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
invoke-virtual {p0, v1, v0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->setTextSizeInternal(IF)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_5
|
2020-07-08 16:44:49 +00:00
|
|
|
monitor-exit v2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
goto :goto_3
|
|
|
|
|
|
|
|
:catchall_0
|
|
|
|
move-exception v0
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
monitor-exit v2
|
2020-05-17 12:40:10 +00:00
|
|
|
:try_end_0
|
|
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
|
|
|
|
throw v0
|
|
|
|
|
|
|
|
:cond_6
|
|
|
|
:goto_2
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_7
|
|
|
|
:goto_3
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
iput-boolean v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mNeedsAutoSizeText:Z
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public createLayout(Ljava/lang/CharSequence;Landroid/text/Layout$Alignment;II)Landroid/text/StaticLayout;
|
|
|
|
.locals 2
|
|
|
|
.annotation build Landroidx/annotation/VisibleForTesting;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
|
|
|
|
const/16 v1, 0x17
|
|
|
|
|
|
|
|
if-lt v0, v1, :cond_0
|
|
|
|
|
|
|
|
invoke-direct {p0, p1, p2, p3, p4}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->createStaticLayoutForMeasuring(Ljava/lang/CharSequence;Landroid/text/Layout$Alignment;II)Landroid/text/StaticLayout;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-direct {p0, p1, p2, p3}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->createStaticLayoutForMeasuringPre23(Ljava/lang/CharSequence;Landroid/text/Layout$Alignment;I)Landroid/text/StaticLayout;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public getAutoSizeMaxTextSize()I
|
|
|
|
.locals 1
|
|
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
|
|
value = {
|
|
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeMaxTextSizeInPx:F
|
|
|
|
|
|
|
|
invoke-static {v0}, Ljava/lang/Math;->round(F)I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public getAutoSizeMinTextSize()I
|
|
|
|
.locals 1
|
|
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
|
|
value = {
|
|
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeMinTextSizeInPx:F
|
|
|
|
|
|
|
|
invoke-static {v0}, Ljava/lang/Math;->round(F)I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public getAutoSizeStepGranularity()I
|
|
|
|
.locals 1
|
|
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
|
|
value = {
|
|
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeStepGranularityInPx:F
|
|
|
|
|
|
|
|
invoke-static {v0}, Ljava/lang/Math;->round(F)I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public getAutoSizeTextAvailableSizes()[I
|
|
|
|
.locals 1
|
|
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
|
|
value = {
|
|
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextSizesInPx:[I
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public getAutoSizeTextType()I
|
|
|
|
.locals 1
|
|
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
|
|
value = {
|
|
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextType:I
|
|
|
|
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public initTempTextPaint(I)V
|
|
|
|
.locals 2
|
|
|
|
.annotation build Landroidx/annotation/VisibleForTesting;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTempTextPaint:Landroid/text/TextPaint;
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
new-instance v0, Landroid/text/TextPaint;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Landroid/text/TextPaint;-><init>()V
|
|
|
|
|
|
|
|
iput-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTempTextPaint:Landroid/text/TextPaint;
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {v0}, Landroid/text/TextPaint;->reset()V
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTempTextPaint:Landroid/text/TextPaint;
|
|
|
|
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTextView:Landroid/widget/TextView;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Landroid/widget/TextView;->getPaint()Landroid/text/TextPaint;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Landroid/text/TextPaint;->set(Landroid/text/TextPaint;)V
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mTempTextPaint:Landroid/text/TextPaint;
|
|
|
|
|
|
|
|
int-to-float p1, p1
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Landroid/text/TextPaint;->setTextSize(F)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public isAutoSizeEnabled()Z
|
|
|
|
.locals 1
|
|
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
|
|
value = {
|
|
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->supportsAutoSizeText()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
iget v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextType:I
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public loadFromAttributes(Landroid/util/AttributeSet;I)V
|
|
|
|
.locals 6
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mContext:Landroid/content/Context;
|
|
|
|
|
|
|
|
sget-object v1, Landroidx/appcompat/R$styleable;->AppCompatTextView:[I
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1, v1, p2, v2}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
sget p2, Landroidx/appcompat/R$styleable;->AppCompatTextView_autoSizeTextType:I
|
|
|
|
|
|
|
|
invoke-virtual {p1, p2}, Landroid/content/res/TypedArray;->hasValue(I)Z
|
|
|
|
|
|
|
|
move-result p2
|
|
|
|
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
|
|
|
|
sget p2, Landroidx/appcompat/R$styleable;->AppCompatTextView_autoSizeTextType:I
|
|
|
|
|
|
|
|
invoke-virtual {p1, p2, v2}, Landroid/content/res/TypedArray;->getInt(II)I
|
|
|
|
|
|
|
|
move-result p2
|
|
|
|
|
|
|
|
iput p2, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextType:I
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
sget p2, Landroidx/appcompat/R$styleable;->AppCompatTextView_autoSizeStepGranularity:I
|
|
|
|
|
|
|
|
invoke-virtual {p1, p2}, Landroid/content/res/TypedArray;->hasValue(I)Z
|
|
|
|
|
|
|
|
move-result p2
|
|
|
|
|
|
|
|
const/high16 v0, -0x40800000 # -1.0f
|
|
|
|
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
|
|
|
|
sget p2, Landroidx/appcompat/R$styleable;->AppCompatTextView_autoSizeStepGranularity:I
|
|
|
|
|
|
|
|
invoke-virtual {p1, p2, v0}, Landroid/content/res/TypedArray;->getDimension(IF)F
|
|
|
|
|
|
|
|
move-result p2
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
const/high16 p2, -0x40800000 # -1.0f
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
sget v1, Landroidx/appcompat/R$styleable;->AppCompatTextView_autoSizeMinTextSize:I
|
|
|
|
|
|
|
|
invoke-virtual {p1, v1}, Landroid/content/res/TypedArray;->hasValue(I)Z
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
|
|
|
|
sget v1, Landroidx/appcompat/R$styleable;->AppCompatTextView_autoSizeMinTextSize:I
|
|
|
|
|
|
|
|
invoke-virtual {p1, v1, v0}, Landroid/content/res/TypedArray;->getDimension(IF)F
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
const/high16 v1, -0x40800000 # -1.0f
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
sget v3, Landroidx/appcompat/R$styleable;->AppCompatTextView_autoSizeMaxTextSize:I
|
|
|
|
|
|
|
|
invoke-virtual {p1, v3}, Landroid/content/res/TypedArray;->hasValue(I)Z
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
|
|
|
|
sget v3, Landroidx/appcompat/R$styleable;->AppCompatTextView_autoSizeMaxTextSize:I
|
|
|
|
|
|
|
|
invoke-virtual {p1, v3, v0}, Landroid/content/res/TypedArray;->getDimension(IF)F
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
const/high16 v3, -0x40800000 # -1.0f
|
|
|
|
|
|
|
|
:goto_2
|
|
|
|
sget v4, Landroidx/appcompat/R$styleable;->AppCompatTextView_autoSizePresetSizes:I
|
|
|
|
|
|
|
|
invoke-virtual {p1, v4}, Landroid/content/res/TypedArray;->hasValue(I)Z
|
|
|
|
|
|
|
|
move-result v4
|
|
|
|
|
|
|
|
if-eqz v4, :cond_4
|
|
|
|
|
|
|
|
sget v4, Landroidx/appcompat/R$styleable;->AppCompatTextView_autoSizePresetSizes:I
|
|
|
|
|
|
|
|
invoke-virtual {p1, v4, v2}, Landroid/content/res/TypedArray;->getResourceId(II)I
|
|
|
|
|
|
|
|
move-result v4
|
|
|
|
|
|
|
|
if-lez v4, :cond_4
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/content/res/TypedArray;->getResources()Landroid/content/res/Resources;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
invoke-virtual {v5, v4}, Landroid/content/res/Resources;->obtainTypedArray(I)Landroid/content/res/TypedArray;
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
|
|
|
invoke-direct {p0, v4}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->setupAutoSizeUniformPresetSizes(Landroid/content/res/TypedArray;)V
|
|
|
|
|
|
|
|
invoke-virtual {v4}, Landroid/content/res/TypedArray;->recycle()V
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
invoke-virtual {p1}, Landroid/content/res/TypedArray;->recycle()V
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->supportsAutoSizeText()Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_9
|
|
|
|
|
|
|
|
iget p1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextType:I
|
|
|
|
|
|
|
|
const/4 v2, 0x1
|
|
|
|
|
|
|
|
if-ne p1, v2, :cond_a
|
|
|
|
|
|
|
|
iget-boolean p1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mHasPresetAutoSizeValues:Z
|
|
|
|
|
|
|
|
if-nez p1, :cond_8
|
|
|
|
|
|
|
|
iget-object p1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mContext:Landroid/content/Context;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const/4 v2, 0x2
|
|
|
|
|
|
|
|
cmpl-float v4, v1, v0
|
|
|
|
|
|
|
|
if-nez v4, :cond_5
|
|
|
|
|
|
|
|
const/high16 v1, 0x41400000 # 12.0f
|
|
|
|
|
|
|
|
invoke-static {v2, v1, p1}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
:cond_5
|
|
|
|
cmpl-float v4, v3, v0
|
|
|
|
|
|
|
|
if-nez v4, :cond_6
|
|
|
|
|
|
|
|
const/high16 v3, 0x42e00000 # 112.0f
|
|
|
|
|
|
|
|
invoke-static {v2, v3, p1}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
:cond_6
|
|
|
|
cmpl-float p1, p2, v0
|
|
|
|
|
|
|
|
if-nez p1, :cond_7
|
|
|
|
|
|
|
|
const/high16 p2, 0x3f800000 # 1.0f
|
|
|
|
|
|
|
|
:cond_7
|
|
|
|
invoke-direct {p0, v1, v3, p2}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->validateAndSetAutoSizeTextTypeUniformConfiguration(FFF)V
|
|
|
|
|
|
|
|
:cond_8
|
|
|
|
invoke-direct {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->setupAutoSizeText()Z
|
|
|
|
|
|
|
|
goto :goto_3
|
|
|
|
|
|
|
|
:cond_9
|
|
|
|
iput v2, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextType:I
|
|
|
|
|
|
|
|
:cond_a
|
|
|
|
:goto_3
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public setAutoSizeTextTypeUniformWithConfiguration(IIII)V
|
|
|
|
.locals 1
|
|
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
|
|
value = {
|
|
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
|
|
value = {
|
|
|
|
Ljava/lang/IllegalArgumentException;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->supportsAutoSizeText()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mContext:Landroid/content/Context;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
int-to-float p1, p1
|
|
|
|
|
|
|
|
invoke-static {p4, p1, v0}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
int-to-float p2, p2
|
|
|
|
|
|
|
|
invoke-static {p4, p2, v0}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F
|
|
|
|
|
|
|
|
move-result p2
|
|
|
|
|
|
|
|
int-to-float p3, p3
|
|
|
|
|
|
|
|
invoke-static {p4, p3, v0}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F
|
|
|
|
|
|
|
|
move-result p3
|
|
|
|
|
|
|
|
invoke-direct {p0, p1, p2, p3}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->validateAndSetAutoSizeTextTypeUniformConfiguration(FFF)V
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->setupAutoSizeText()Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->autoSizeText()V
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public setAutoSizeTextTypeUniformWithPresetSizes([II)V
|
|
|
|
.locals 5
|
|
|
|
.param p1 # [I
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
|
|
value = {
|
|
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
|
|
value = {
|
|
|
|
Ljava/lang/IllegalArgumentException;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->supportsAutoSizeText()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
|
|
|
|
array-length v0, p1
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
if-lez v0, :cond_3
|
|
|
|
|
|
|
|
new-array v2, v0, [I
|
|
|
|
|
|
|
|
if-nez p2, :cond_0
|
|
|
|
|
|
|
|
invoke-static {p1, v0}, Ljava/util/Arrays;->copyOf([II)[I
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget-object v3, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mContext:Landroid/content/Context;
|
|
|
|
|
|
|
|
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
invoke-virtual {v3}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-ge v1, v0, :cond_1
|
|
|
|
|
|
|
|
aget v4, p1, v1
|
|
|
|
|
|
|
|
int-to-float v4, v4
|
|
|
|
|
|
|
|
invoke-static {p2, v4, v3}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F
|
|
|
|
|
|
|
|
move-result v4
|
|
|
|
|
|
|
|
invoke-static {v4}, Ljava/lang/Math;->round(F)I
|
|
|
|
|
|
|
|
move-result v4
|
|
|
|
|
|
|
|
aput v4, v2, v1
|
|
|
|
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
:goto_1
|
|
|
|
invoke-direct {p0, v2}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->cleanupAutoSizePresetSizes([I)[I
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
|
|
|
iput-object p2, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mAutoSizeTextSizesInPx:[I
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->setupAutoSizeUniformPresetSizesConfiguration()Z
|
|
|
|
|
|
|
|
move-result p2
|
|
|
|
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
new-instance p2, Ljava/lang/IllegalArgumentException;
|
|
|
|
|
|
|
|
const-string v0, "None of the preset sizes is valid: "
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-static {v0}, Lf/e/b/a/a;->E(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-static {p1}, Ljava/util/Arrays;->toString([I)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw p2
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
iput-boolean v1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mHasPresetAutoSizeValues:Z
|
|
|
|
|
|
|
|
:goto_2
|
|
|
|
invoke-direct {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->setupAutoSizeText()Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->autoSizeText()V
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public setAutoSizeTextTypeWithDefaults(I)V
|
|
|
|
.locals 3
|
|
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
|
|
value = {
|
|
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->supportsAutoSizeText()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
if-ne p1, v0, :cond_0
|
|
|
|
|
|
|
|
iget-object p1, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mContext:Landroid/content/Context;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const/high16 v0, 0x41400000 # 12.0f
|
|
|
|
|
|
|
|
const/4 v1, 0x2
|
|
|
|
|
|
|
|
invoke-static {v1, v0, p1}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
const/high16 v2, 0x42e00000 # 112.0f
|
|
|
|
|
|
|
|
invoke-static {v1, v2, p1}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
const/high16 v1, 0x3f800000 # 1.0f
|
|
|
|
|
|
|
|
invoke-direct {p0, v0, p1, v1}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->validateAndSetAutoSizeTextTypeUniformConfiguration(FFF)V
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->setupAutoSizeText()Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->autoSizeText()V
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
|
|
|
|
const-string v1, "Unknown auto-size text type: "
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-static {v1, p1}, Lf/e/b/a/a;->h(Ljava/lang/String;I)Ljava/lang/String;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw v0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
invoke-direct {p0}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->clearAutoSizeConfiguration()V
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
:goto_0
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public setTextSizeInternal(IF)V
|
|
|
|
.locals 1
|
|
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
|
|
value = {
|
|
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->mContext:Landroid/content/Context;
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
invoke-static {}, Landroid/content/res/Resources;->getSystem()Landroid/content/res/Resources;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
invoke-virtual {v0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-static {p1, p2, v0}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Landroidx/appcompat/widget/AppCompatTextViewAutoSizeHelper;->setRawTextSize(F)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|