granularity level: instruction
.class public final Landroidx/core/graphics/drawable/DrawableCompat;
.super Ljava/lang/Object;
.source "DrawableCompat.java"
.field private static final TAG:Ljava/lang/String; = "DrawableCompat"
.field private static sGetLayoutDirectionMethod:Ljava/lang/reflect/Method;
.field private static sGetLayoutDirectionMethodFetched:Z
.field private static sSetLayoutDirectionMethod:Ljava/lang/reflect/Method;
.field private static sSetLayoutDirectionMethodFetched:Z
.method private constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static applyTheme(Landroid/graphics/drawable/Drawable;Landroid/content/res/Resources$Theme;)V
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x15
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1}, Landroid/graphics/drawable/Drawable;->applyTheme(Landroid/content/res/Resources$Theme;)V
:cond_0
return-void
.end method
.method public static canApplyTheme(Landroid/graphics/drawable/Drawable;)Z
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x15
if-lt v0, v1, :cond_0
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->canApplyTheme()Z
move-result p0
return p0
:cond_0
const/4 p0, 0x0
return p0
.end method
.method public static clearColorFilter(Landroid/graphics/drawable/Drawable;)V
.locals 3
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x17
if-lt v0, v1, :cond_0
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->clearColorFilter()V
goto :goto_1
:cond_0
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x15
if-lt v0, v1, :cond_4
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->clearColorFilter()V
instance-of v0, p0, Landroid/graphics/drawable/InsetDrawable;
if-eqz v0, :cond_1
check-cast p0, Landroid/graphics/drawable/InsetDrawable;
invoke-virtual {p0}, Landroid/graphics/drawable/InsetDrawable;->getDrawable()Landroid/graphics/drawable/Drawable;
move-result-object p0
invoke-static {p0}, Landroidx/core/graphics/drawable/DrawableCompat;->clearColorFilter(Landroid/graphics/drawable/Drawable;)V
goto :goto_1
:cond_1
instance-of v0, p0, Landroidx/core/graphics/drawable/WrappedDrawable;
if-eqz v0, :cond_2
check-cast p0, Landroidx/core/graphics/drawable/WrappedDrawable;
invoke-interface {p0}, Landroidx/core/graphics/drawable/WrappedDrawable;->getWrappedDrawable()Landroid/graphics/drawable/Drawable;
move-result-object p0
invoke-static {p0}, Landroidx/core/graphics/drawable/DrawableCompat;->clearColorFilter(Landroid/graphics/drawable/Drawable;)V
goto :goto_1
:cond_2
instance-of v0, p0, Landroid/graphics/drawable/DrawableContainer;
if-eqz v0, :cond_5
check-cast p0, Landroid/graphics/drawable/DrawableContainer;
invoke-virtual {p0}, Landroid/graphics/drawable/DrawableContainer;->getConstantState()Landroid/graphics/drawable/Drawable$ConstantState;
move-result-object p0
check-cast p0, Landroid/graphics/drawable/DrawableContainer$DrawableContainerState;
if-eqz p0, :cond_5
const/4 v0, 0x0
invoke-virtual {p0}, Landroid/graphics/drawable/DrawableContainer$DrawableContainerState;->getChildCount()I
move-result v1
:goto_0
if-ge v0, v1, :cond_5
invoke-virtual {p0, v0}, Landroid/graphics/drawable/DrawableContainer$DrawableContainerState;->getChild(I)Landroid/graphics/drawable/Drawable;
move-result-object v2
if-eqz v2, :cond_3
invoke-static {v2}, Landroidx/core/graphics/drawable/DrawableCompat;->clearColorFilter(Landroid/graphics/drawable/Drawable;)V
:cond_3
add-int/lit8 v0, v0, 0x1
goto :goto_0
:cond_4
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->clearColorFilter()V
:goto_1
:cond_5
return-void
.end method
.method public static getAlpha(Landroid/graphics/drawable/Drawable;)I
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x13
if-lt v0, v1, :cond_0
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getAlpha()I
move-result p0
return p0
:cond_0
const/4 p0, 0x0
return p0
.end method
.method public static getColorFilter(Landroid/graphics/drawable/Drawable;)Landroid/graphics/ColorFilter;
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x15
if-lt v0, v1, :cond_0
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getColorFilter()Landroid/graphics/ColorFilter;
move-result-object p0
return-object p0
:cond_0
const/4 p0, 0x0
return-object p0
.end method
.method public static getLayoutDirection(Landroid/graphics/drawable/Drawable;)I
.locals 6
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x17
if-lt v0, v1, :cond_0
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getLayoutDirection()I
move-result p0
return p0
:cond_0
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x11
const/4 v2, 0x0
if-lt v0, v1, :cond_2
sget-boolean v0, Landroidx/core/graphics/drawable/DrawableCompat;->sGetLayoutDirectionMethodFetched:Z
const-string v1, "DrawableCompat"
if-nez v0, :cond_1
const/4 v0, 0x1
:try_start_0
const-class v3, Landroid/graphics/drawable/Drawable;
const-string v4, "getLayoutDirection"
new-array v5, v2, [Ljava/lang/Class;
invoke-virtual {v3, v4, v5}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v3
sput-object v3, Landroidx/core/graphics/drawable/DrawableCompat;->sGetLayoutDirectionMethod:Ljava/lang/reflect/Method;
invoke-virtual {v3, v0}, Ljava/lang/reflect/Method;->setAccessible(Z)V
:try_end_0
.catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception v3
const-string v4, "Failed to retrieve getLayoutDirection() method"
invoke-static {v1, v4, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
:goto_0
sput-boolean v0, Landroidx/core/graphics/drawable/DrawableCompat;->sGetLayoutDirectionMethodFetched:Z
:cond_1
sget-object v0, Landroidx/core/graphics/drawable/DrawableCompat;->sGetLayoutDirectionMethod:Ljava/lang/reflect/Method;
if-eqz v0, :cond_2
:try_start_1
new-array v3, v2, [Ljava/lang/Object;
invoke-virtual {v0, p0, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p0
check-cast p0, Ljava/lang/Integer;
invoke-virtual {p0}, Ljava/lang/Integer;->intValue()I
move-result p0
:try_end_1
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
return p0
:catch_1
move-exception p0
const-string v0, "Failed to invoke getLayoutDirection() via reflection"
invoke-static {v1, v0, p0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
const/4 p0, 0x0
sput-object p0, Landroidx/core/graphics/drawable/DrawableCompat;->sGetLayoutDirectionMethod:Ljava/lang/reflect/Method;
:cond_2
return v2
.end method
.method public static inflate(Landroid/graphics/drawable/Drawable;Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;Landroid/util/AttributeSet;Landroid/content/res/Resources$Theme;)V
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Lorg/xmlpull/v1/XmlPullParserException;,
Ljava/io/IOException;
}
.end annotation
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x15
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1, p2, p3, p4}, Landroid/graphics/drawable/Drawable;->inflate(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;Landroid/util/AttributeSet;Landroid/content/res/Resources$Theme;)V
goto :goto_0
:cond_0
invoke-virtual {p0, p1, p2, p3}, Landroid/graphics/drawable/Drawable;->inflate(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;Landroid/util/AttributeSet;)V
:goto_0
return-void
.end method
.method public static isAutoMirrored(Landroid/graphics/drawable/Drawable;)Z
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x13
if-lt v0, v1, :cond_0
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->isAutoMirrored()Z
move-result p0
return p0
:cond_0
const/4 p0, 0x0
return p0
.end method
.method public static jumpToCurrentState(Landroid/graphics/drawable/Drawable;)V
.locals 0
.annotation runtime Ljava/lang/Deprecated;
.end annotation
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->jumpToCurrentState()V
return-void
.end method
.method public static setAutoMirrored(Landroid/graphics/drawable/Drawable;Z)V
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x13
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1}, Landroid/graphics/drawable/Drawable;->setAutoMirrored(Z)V
:cond_0
return-void
.end method
.method public static setHotspot(Landroid/graphics/drawable/Drawable;FF)V
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x15
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1, p2}, Landroid/graphics/drawable/Drawable;->setHotspot(FF)V
:cond_0
return-void
.end method
.method public static setHotspotBounds(Landroid/graphics/drawable/Drawable;IIII)V
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x15
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1, p2, p3, p4}, Landroid/graphics/drawable/Drawable;->setHotspotBounds(IIII)V
:cond_0
return-void
.end method
.method public static setLayoutDirection(Landroid/graphics/drawable/Drawable;I)Z
.locals 7
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x17
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1}, Landroid/graphics/drawable/Drawable;->setLayoutDirection(I)Z
move-result p0
return p0
:cond_0
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x11
const/4 v2, 0x0
if-lt v0, v1, :cond_2
sget-boolean v0, Landroidx/core/graphics/drawable/DrawableCompat;->sSetLayoutDirectionMethodFetched:Z
const-string v1, "DrawableCompat"
const/4 v3, 0x1
if-nez v0, :cond_1
:try_start_0
const-class v0, Landroid/graphics/drawable/Drawable;
const-string v4, "setLayoutDirection"
new-array v5, v3, [Ljava/lang/Class;
sget-object v6, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;
aput-object v6, v5, v2
invoke-virtual {v0, v4, v5}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v0
sput-object v0, Landroidx/core/graphics/drawable/DrawableCompat;->sSetLayoutDirectionMethod:Ljava/lang/reflect/Method;
invoke-virtual {v0, v3}, Ljava/lang/reflect/Method;->setAccessible(Z)V
:try_end_0
.catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception v0
const-string v4, "Failed to retrieve setLayoutDirection(int) method"
invoke-static {v1, v4, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
:goto_0
sput-boolean v3, Landroidx/core/graphics/drawable/DrawableCompat;->sSetLayoutDirectionMethodFetched:Z
:cond_1
sget-object v0, Landroidx/core/graphics/drawable/DrawableCompat;->sSetLayoutDirectionMethod:Ljava/lang/reflect/Method;
if-eqz v0, :cond_2
:try_start_1
new-array v4, v3, [Ljava/lang/Object;
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p1
aput-object p1, v4, v2
invoke-virtual {v0, p0, v4}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
:try_end_1
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
return v3
:catch_1
move-exception p0
const-string p1, "Failed to invoke setLayoutDirection(int) via reflection"
invoke-static {v1, p1, p0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
const/4 p0, 0x0
sput-object p0, Landroidx/core/graphics/drawable/DrawableCompat;->sSetLayoutDirectionMethod:Ljava/lang/reflect/Method;
:cond_2
return v2
.end method
.method public static setTint(Landroid/graphics/drawable/Drawable;I)V
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x15
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1}, Landroid/graphics/drawable/Drawable;->setTint(I)V
goto :goto_0
:cond_0
instance-of v0, p0, Landroidx/core/graphics/drawable/TintAwareDrawable;
if-eqz v0, :cond_1
check-cast p0, Landroidx/core/graphics/drawable/TintAwareDrawable;
invoke-interface {p0, p1}, Landroidx/core/graphics/drawable/TintAwareDrawable;->setTint(I)V
:cond_1
:goto_0
return-void
.end method
.method public static setTintList(Landroid/graphics/drawable/Drawable;Landroid/content/res/ColorStateList;)V
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x15
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1}, Landroid/graphics/drawable/Drawable;->setTintList(Landroid/content/res/ColorStateList;)V
goto :goto_0
:cond_0
instance-of v0, p0, Landroidx/core/graphics/drawable/TintAwareDrawable;
if-eqz v0, :cond_1
check-cast p0, Landroidx/core/graphics/drawable/TintAwareDrawable;
invoke-interface {p0, p1}, Landroidx/core/graphics/drawable/TintAwareDrawable;->setTintList(Landroid/content/res/ColorStateList;)V
:cond_1
:goto_0
return-void
.end method
.method public static setTintMode(Landroid/graphics/drawable/Drawable;Landroid/graphics/PorterDuff$Mode;)V
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x15
if-lt v0, v1, :cond_0
invoke-virtual {p0, p1}, Landroid/graphics/drawable/Drawable;->setTintMode(Landroid/graphics/PorterDuff$Mode;)V
goto :goto_0
:cond_0
instance-of v0, p0, Landroidx/core/graphics/drawable/TintAwareDrawable;
if-eqz v0, :cond_1
check-cast p0, Landroidx/core/graphics/drawable/TintAwareDrawable;
invoke-interface {p0, p1}, Landroidx/core/graphics/drawable/TintAwareDrawable;->setTintMode(Landroid/graphics/PorterDuff$Mode;)V
:cond_1
:goto_0
return-void
.end method
.method public static unwrap(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Landroid/graphics/drawable/Drawable;",
">(",
"Landroid/graphics/drawable/Drawable;",
")TT;"
}
.end annotation
instance-of v0, p0, Landroidx/core/graphics/drawable/WrappedDrawable;
if-eqz v0, :cond_0
check-cast p0, Landroidx/core/graphics/drawable/WrappedDrawable;
invoke-interface {p0}, Landroidx/core/graphics/drawable/WrappedDrawable;->getWrappedDrawable()Landroid/graphics/drawable/Drawable;
move-result-object p0
:cond_0
return-object p0
.end method
.method public static wrap(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x17
if-lt v0, v1, :cond_0
return-object p0
:cond_0
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x15
if-lt v0, v1, :cond_2
instance-of v0, p0, Landroidx/core/graphics/drawable/TintAwareDrawable;
if-nez v0, :cond_1
new-instance v0, Landroidx/core/graphics/drawable/WrappedDrawableApi21;
invoke-direct {v0, p0}, Landroidx/core/graphics/drawable/WrappedDrawableApi21;-><init>(Landroid/graphics/drawable/Drawable;)V
return-object v0
:cond_1
return-object p0
:cond_2
instance-of v0, p0, Landroidx/core/graphics/drawable/TintAwareDrawable;
if-nez v0, :cond_3
new-instance v0, Landroidx/core/graphics/drawable/WrappedDrawableApi14;
invoke-direct {v0, p0}, Landroidx/core/graphics/drawable/WrappedDrawableApi14;-><init>(Landroid/graphics/drawable/Drawable;)V
return-object v0
:cond_3
return-object p0
.end method