2020-11-12 02:11:44 +00:00
|
|
|
.class public final Landroidx/core/content/res/ComplexColorCompat;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "ComplexColorCompat.java"
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
|
|
value = {
|
|
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# static fields
|
2020-11-16 22:05:17 +00:00
|
|
|
.field private static final LOG_TAG:Ljava/lang/String; = "ComplexColorCompat"
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
2020-11-16 22:05:17 +00:00
|
|
|
.field private mColor:I
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
.field private final mColorStateList:Landroid/content/res/ColorStateList;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
.field private final mShader:Landroid/graphics/Shader;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
2020-11-16 22:05:17 +00:00
|
|
|
.method private constructor <init>(Landroid/graphics/Shader;Landroid/content/res/ColorStateList;I)V
|
2020-11-12 02:11:44 +00:00
|
|
|
.locals 0
|
|
|
|
.param p3 # I
|
|
|
|
.annotation build Landroidx/annotation/ColorInt;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
|
|
|
iput-object p1, p0, Landroidx/core/content/res/ComplexColorCompat;->mShader:Landroid/graphics/Shader;
|
|
|
|
|
|
|
|
iput-object p2, p0, Landroidx/core/content/res/ComplexColorCompat;->mColorStateList:Landroid/content/res/ColorStateList;
|
|
|
|
|
|
|
|
iput p3, p0, Landroidx/core/content/res/ComplexColorCompat;->mColor:I
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
.method private static createFromXml(Landroid/content/res/Resources;ILandroid/content/res/Resources$Theme;)Landroidx/core/content/res/ComplexColorCompat;
|
|
|
|
.locals 4
|
2020-11-12 02:11:44 +00:00
|
|
|
.param p0 # Landroid/content/res/Resources;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.param p1 # I
|
|
|
|
.annotation build Landroidx/annotation/ColorRes;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.param p2 # Landroid/content/res/Resources$Theme;
|
|
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
|
|
value = {
|
|
|
|
Ljava/io/IOException;,
|
|
|
|
Lorg/xmlpull/v1/XmlPullParserException;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1}, Landroid/content/res/Resources;->getXml(I)Landroid/content/res/XmlResourceParser;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-static {p1}, Landroid/util/Xml;->asAttributeSet(Lorg/xmlpull/v1/XmlPullParser;)Landroid/util/AttributeSet;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->next()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
const/4 v2, 0x2
|
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
if-eq v1, v2, :cond_0
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
const/4 v3, 0x1
|
|
|
|
|
2020-11-12 02:11:44 +00:00
|
|
|
if-eq v1, v3, :cond_0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
2020-11-16 22:05:17 +00:00
|
|
|
if-ne v1, v2, :cond_3
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Ljava/lang/String;->hashCode()I
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
const-string v2, "gradient"
|
2020-11-16 01:00:50 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
2020-11-16 01:00:50 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
move-result v2
|
2020-11-16 01:00:50 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
if-nez v2, :cond_2
|
2020-11-16 01:00:50 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
const-string v2, "selector"
|
2020-11-16 01:00:50 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
2020-11-16 01:00:50 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
move-result v2
|
2020-11-16 01:00:50 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
if-eqz v2, :cond_1
|
2020-11-16 01:00:50 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-static {p0, p1, v0, p2}, Landroidx/core/content/res/ColorStateListInflaterCompat;->createFromXmlInner(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;Landroid/util/AttributeSet;Landroid/content/res/Resources$Theme;)Landroid/content/res/ColorStateList;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-static {p0}, Landroidx/core/content/res/ComplexColorCompat;->from(Landroid/content/res/ColorStateList;)Landroidx/core/content/res/ComplexColorCompat;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
:cond_1
|
2020-11-12 02:11:44 +00:00
|
|
|
new-instance p0, Lorg/xmlpull/v1/XmlPullParserException;
|
|
|
|
|
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->getPositionDescription()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string p1, ": unsupported complex color tag "
|
|
|
|
|
|
|
|
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {p2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lorg/xmlpull/v1/XmlPullParserException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw p0
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
:cond_2
|
|
|
|
invoke-static {p0, p1, v0, p2}, Landroidx/core/content/res/GradientColorInflaterCompat;->createFromXmlInner(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;Landroid/util/AttributeSet;Landroid/content/res/Resources$Theme;)Landroid/graphics/Shader;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-static {p0}, Landroidx/core/content/res/ComplexColorCompat;->from(Landroid/graphics/Shader;)Landroidx/core/content/res/ComplexColorCompat;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
:cond_3
|
2020-11-12 02:11:44 +00:00
|
|
|
new-instance p0, Lorg/xmlpull/v1/XmlPullParserException;
|
|
|
|
|
|
|
|
const-string p1, "No start tag found"
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lorg/xmlpull/v1/XmlPullParserException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static from(I)Landroidx/core/content/res/ComplexColorCompat;
|
|
|
|
.locals 2
|
|
|
|
.param p0 # I
|
|
|
|
.annotation build Landroidx/annotation/ColorInt;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
|
|
|
|
new-instance v0, Landroidx/core/content/res/ComplexColorCompat;
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
invoke-direct {v0, v1, v1, p0}, Landroidx/core/content/res/ComplexColorCompat;-><init>(Landroid/graphics/Shader;Landroid/content/res/ColorStateList;I)V
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static from(Landroid/content/res/ColorStateList;)Landroidx/core/content/res/ComplexColorCompat;
|
|
|
|
.locals 3
|
|
|
|
.param p0 # Landroid/content/res/ColorStateList;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
|
|
|
|
new-instance v0, Landroidx/core/content/res/ComplexColorCompat;
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/content/res/ColorStateList;->getDefaultColor()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
invoke-direct {v0, v2, p0, v1}, Landroidx/core/content/res/ComplexColorCompat;-><init>(Landroid/graphics/Shader;Landroid/content/res/ColorStateList;I)V
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static from(Landroid/graphics/Shader;)Landroidx/core/content/res/ComplexColorCompat;
|
|
|
|
.locals 3
|
|
|
|
.param p0 # Landroid/graphics/Shader;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
|
|
|
|
new-instance v0, Landroidx/core/content/res/ComplexColorCompat;
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
invoke-direct {v0, p0, v1, v2}, Landroidx/core/content/res/ComplexColorCompat;-><init>(Landroid/graphics/Shader;Landroid/content/res/ColorStateList;I)V
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static inflate(Landroid/content/res/Resources;ILandroid/content/res/Resources$Theme;)Landroidx/core/content/res/ComplexColorCompat;
|
|
|
|
.locals 0
|
|
|
|
.param p0 # Landroid/content/res/Resources;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.param p1 # I
|
|
|
|
.annotation build Landroidx/annotation/ColorRes;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.param p2 # Landroid/content/res/Resources$Theme;
|
|
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
:try_start_0
|
|
|
|
invoke-static {p0, p1, p2}, Landroidx/core/content/res/ComplexColorCompat;->createFromXml(Landroid/content/res/Resources;ILandroid/content/res/Resources$Theme;)Landroidx/core/content/res/ComplexColorCompat;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
:try_end_0
|
|
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
|
|
|
|
:catch_0
|
|
|
|
move-exception p0
|
|
|
|
|
|
|
|
const-string p1, "ComplexColorCompat"
|
|
|
|
|
|
|
|
const-string p2, "Failed to inflate ComplexColor."
|
|
|
|
|
|
|
|
invoke-static {p1, p2, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
|
|
|
|
const/4 p0, 0x0
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public getColor()I
|
|
|
|
.locals 1
|
|
|
|
.annotation build Landroidx/annotation/ColorInt;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget v0, p0, Landroidx/core/content/res/ComplexColorCompat;->mColor:I
|
|
|
|
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public getShader()Landroid/graphics/Shader;
|
|
|
|
.locals 1
|
|
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/core/content/res/ComplexColorCompat;->mShader:Landroid/graphics/Shader;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public isGradient()Z
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/core/content/res/ComplexColorCompat;->mShader:Landroid/graphics/Shader;
|
|
|
|
|
|
|
|
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 isStateful()Z
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/core/content/res/ComplexColorCompat;->mShader:Landroid/graphics/Shader;
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/core/content/res/ComplexColorCompat;->mColorStateList:Landroid/content/res/ColorStateList;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/content/res/ColorStateList;->isStateful()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
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 onStateChanged([I)Z
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroidx/core/content/res/ComplexColorCompat;->isStateful()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/core/content/res/ComplexColorCompat;->mColorStateList:Landroid/content/res/ColorStateList;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/content/res/ColorStateList;->getDefaultColor()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1, v1}, Landroid/content/res/ColorStateList;->getColorForState([II)I
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
iget v0, p0, Landroidx/core/content/res/ComplexColorCompat;->mColor:I
|
|
|
|
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
iput p1, p0, Landroidx/core/content/res/ComplexColorCompat;->mColor:I
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public setColor(I)V
|
|
|
|
.locals 0
|
|
|
|
.param p1 # I
|
|
|
|
.annotation build Landroidx/annotation/ColorInt;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
|
|
|
|
iput p1, p0, Landroidx/core/content/res/ComplexColorCompat;->mColor:I
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public willDraw()Z
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroidx/core/content/res/ComplexColorCompat;->isGradient()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
|
|
|
|
iget v0, p0, Landroidx/core/content/res/ComplexColorCompat;->mColor:I
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
:goto_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
return v0
|
|
|
|
.end method
|