319 lines
7.9 KiB
Smali
319 lines
7.9 KiB
Smali
.class public Lcom/google/android/material/resources/MaterialAttributes;
|
|
.super Ljava/lang/Object;
|
|
.source "MaterialAttributes.java"
|
|
|
|
|
|
# annotations
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
value = {
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP:Landroidx/annotation/RestrictTo$Scope;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static resolve(Landroid/content/Context;I)Landroid/util/TypedValue;
|
|
.locals 2
|
|
.param p0 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/AttrRes;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.line 1
|
|
new-instance v0, Landroid/util/TypedValue;
|
|
|
|
invoke-direct {v0}, Landroid/util/TypedValue;-><init>()V
|
|
|
|
.line 2
|
|
invoke-virtual {p0}, Landroid/content/Context;->getTheme()Landroid/content/res/Resources$Theme;
|
|
|
|
move-result-object p0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-virtual {p0, p1, v0, v1}, Landroid/content/res/Resources$Theme;->resolveAttribute(ILandroid/util/TypedValue;Z)Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static resolveBoolean(Landroid/content/Context;IZ)Z
|
|
.locals 1
|
|
.param p0 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/AttrRes;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 1
|
|
invoke-static {p0, p1}, Lcom/google/android/material/resources/MaterialAttributes;->resolve(Landroid/content/Context;I)Landroid/util/TypedValue;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
.line 2
|
|
iget p1, p0, Landroid/util/TypedValue;->type:I
|
|
|
|
const/16 v0, 0x12
|
|
|
|
if-ne p1, v0, :cond_1
|
|
|
|
iget p0, p0, Landroid/util/TypedValue;->data:I
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
const/4 p2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p2, 0x0
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return p2
|
|
.end method
|
|
|
|
.method public static resolveBooleanOrThrow(Landroid/content/Context;ILjava/lang/String;)Z
|
|
.locals 0
|
|
.param p0 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/AttrRes;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 1
|
|
invoke-static {p0, p1, p2}, Lcom/google/android/material/resources/MaterialAttributes;->resolveOrThrow(Landroid/content/Context;ILjava/lang/String;)I
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
const/4 p0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
:goto_0
|
|
return p0
|
|
.end method
|
|
|
|
.method public static resolveDimension(Landroid/content/Context;II)I
|
|
.locals 2
|
|
.param p0 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/AttrRes;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # I
|
|
.annotation build Landroidx/annotation/DimenRes;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/Px;
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-static {p0, p1}, Lcom/google/android/material/resources/MaterialAttributes;->resolve(Landroid/content/Context;I)Landroid/util/TypedValue;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 2
|
|
iget v0, p1, Landroid/util/TypedValue;->type:I
|
|
|
|
const/4 v1, 0x5
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 3
|
|
:cond_0
|
|
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p1, p0}, Landroid/util/TypedValue;->getDimension(Landroid/util/DisplayMetrics;)F
|
|
|
|
move-result p0
|
|
|
|
:goto_0
|
|
float-to-int p0, p0
|
|
|
|
return p0
|
|
|
|
.line 4
|
|
:cond_1
|
|
:goto_1
|
|
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0, p2}, Landroid/content/res/Resources;->getDimension(I)F
|
|
|
|
move-result p0
|
|
|
|
goto :goto_0
|
|
.end method
|
|
|
|
.method public static resolveMinimumAccessibleTouchTarget(Landroid/content/Context;)I
|
|
.locals 2
|
|
.param p0 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/Px;
|
|
.end annotation
|
|
|
|
.line 1
|
|
sget v0, Lcom/google/android/material/R$attr;->minTouchTargetSize:I
|
|
|
|
sget v1, Lcom/google/android/material/R$dimen;->mtrl_min_touch_target_size:I
|
|
|
|
invoke-static {p0, v0, v1}, Lcom/google/android/material/resources/MaterialAttributes;->resolveDimension(Landroid/content/Context;II)I
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static resolveOrThrow(Landroid/content/Context;ILjava/lang/String;)I
|
|
.locals 3
|
|
.param p0 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/AttrRes;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 1
|
|
invoke-static {p0, p1}, Lcom/google/android/material/resources/MaterialAttributes;->resolve(Landroid/content/Context;I)Landroid/util/TypedValue;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
iget p0, v0, Landroid/util/TypedValue;->data:I
|
|
|
|
return p0
|
|
|
|
.line 3
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
const/4 v1, 0x2
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aput-object p2, v1, v2
|
|
|
|
const/4 p2, 0x1
|
|
|
|
.line 4
|
|
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0, p1}, Landroid/content/res/Resources;->getResourceName(I)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
aput-object p0, v1, p2
|
|
|
|
const-string p0, "%1$s requires a value for the %2$s attribute to be set in your app theme. You can either set the attribute in your theme or update your theme to inherit from Theme.MaterialComponents (or a descendant)."
|
|
|
|
.line 5
|
|
invoke-static {p0, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static resolveOrThrow(Landroid/view/View;I)I
|
|
.locals 1
|
|
.param p0 # Landroid/view/View;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/AttrRes;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 6
|
|
invoke-virtual {p0}, Landroid/view/View;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
.line 7
|
|
invoke-static {v0, p1, p0}, Lcom/google/android/material/resources/MaterialAttributes;->resolveOrThrow(Landroid/content/Context;ILjava/lang/String;)I
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
.end method
|