.class public Landroidx/appcompat/widget/ThemeUtils; .super Ljava/lang/Object; .source "ThemeUtils.java" # static fields .field static final ACTIVATED_STATE_SET:[I .field static final CHECKED_STATE_SET:[I .field static final DISABLED_STATE_SET:[I .field static final EMPTY_STATE_SET:[I .field static final FOCUSED_STATE_SET:[I .field static final NOT_PRESSED_OR_FOCUSED_STATE_SET:[I .field static final PRESSED_STATE_SET:[I .field static final SELECTED_STATE_SET:[I .field private static final TAG:Ljava/lang/String; = "ThemeUtils" .field private static final TEMP_ARRAY:[I .field private static final TL_TYPED_VALUE:Ljava/lang/ThreadLocal; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/lang/ThreadLocal<", "Landroid/util/TypedValue;", ">;" } .end annotation .end field # direct methods .method static constructor ()V .locals 2 .line 41 new-instance v0, Ljava/lang/ThreadLocal; invoke-direct {v0}, Ljava/lang/ThreadLocal;->()V sput-object v0, Landroidx/appcompat/widget/ThemeUtils;->TL_TYPED_VALUE:Ljava/lang/ThreadLocal; const v0, -0x101009e .line 43 filled-new-array {v0}, [I move-result-object v0 sput-object v0, Landroidx/appcompat/widget/ThemeUtils;->DISABLED_STATE_SET:[I const v0, 0x101009c .line 44 filled-new-array {v0}, [I move-result-object v0 sput-object v0, Landroidx/appcompat/widget/ThemeUtils;->FOCUSED_STATE_SET:[I const v0, 0x10102fe .line 45 filled-new-array {v0}, [I move-result-object v0 sput-object v0, Landroidx/appcompat/widget/ThemeUtils;->ACTIVATED_STATE_SET:[I const v0, 0x10100a7 .line 46 filled-new-array {v0}, [I move-result-object v0 sput-object v0, Landroidx/appcompat/widget/ThemeUtils;->PRESSED_STATE_SET:[I const v0, 0x10100a0 .line 47 filled-new-array {v0}, [I move-result-object v0 sput-object v0, Landroidx/appcompat/widget/ThemeUtils;->CHECKED_STATE_SET:[I const v0, 0x10100a1 .line 48 filled-new-array {v0}, [I move-result-object v0 sput-object v0, Landroidx/appcompat/widget/ThemeUtils;->SELECTED_STATE_SET:[I const v0, -0x10100a7 const v1, -0x101009c .line 49 filled-new-array {v0, v1}, [I move-result-object v0 sput-object v0, Landroidx/appcompat/widget/ThemeUtils;->NOT_PRESSED_OR_FOCUSED_STATE_SET:[I const/4 v0, 0x0 .line 51 new-array v0, v0, [I sput-object v0, Landroidx/appcompat/widget/ThemeUtils;->EMPTY_STATE_SET:[I const/4 v0, 0x1 .line 53 new-array v0, v0, [I sput-object v0, Landroidx/appcompat/widget/ThemeUtils;->TEMP_ARRAY:[I return-void .end method .method private constructor ()V .locals 0 .line 178 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method .method public static checkAppCompatTheme(Landroid/view/View;Landroid/content/Context;)V .locals 3 const-string v0, "View " .line 162 sget-object v1, Landroidx/appcompat/R$styleable;->AppCompatTheme:[I invoke-virtual {p1, v1}, Landroid/content/Context;->obtainStyledAttributes([I)Landroid/content/res/TypedArray; move-result-object p1 .line 168 :try_start_0 sget v1, Landroidx/appcompat/R$styleable;->AppCompatTheme_windowActionBar:I invoke-virtual {p1, v1}, Landroid/content/res/TypedArray;->hasValue(I)Z move-result v1 if-nez v1, :cond_0 .line 169 const-string v1, "ThemeUtils" new-instance v2, Ljava/lang/StringBuilder; invoke-direct {v2, v0}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class; move-result-object p0 invoke-virtual {v2, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; move-result-object p0 const-string v0, " is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant)." invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 invoke-static {v1, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 174 :cond_0 invoke-virtual {p1}, Landroid/content/res/TypedArray;->recycle()V return-void :catchall_0 move-exception p0 invoke-virtual {p1}, Landroid/content/res/TypedArray;->recycle()V .line 175 throw p0 .end method .method public static createDisabledStateList(II)Landroid/content/res/ColorStateList; .locals 4 const/4 v0, 0x2 .line 66 new-array v1, v0, [[I .line 67 new-array v0, v0, [I .line 71 sget-object v2, Landroidx/appcompat/widget/ThemeUtils;->DISABLED_STATE_SET:[I const/4 v3, 0x0 aput-object v2, v1, v3 .line 72 aput p1, v0, v3 .line 76 sget-object p1, Landroidx/appcompat/widget/ThemeUtils;->EMPTY_STATE_SET:[I const/4 v2, 0x1 aput-object p1, v1, v2 .line 77 aput p0, v0, v2 .line 80 new-instance p0, Landroid/content/res/ColorStateList; invoke-direct {p0, v1, v0}, Landroid/content/res/ColorStateList;->([[I[I)V return-object p0 .end method .method public static getDisabledThemeAttrColor(Landroid/content/Context;I)I .locals 4 .line 126 invoke-static {p0, p1}, Landroidx/appcompat/widget/ThemeUtils;->getThemeAttrColorStateList(Landroid/content/Context;I)Landroid/content/res/ColorStateList; move-result-object v0 if-eqz v0, :cond_0 .line 127 invoke-virtual {v0}, Landroid/content/res/ColorStateList;->isStateful()Z move-result v1 if-eqz v1, :cond_0 .line 129 sget-object p0, Landroidx/appcompat/widget/ThemeUtils;->DISABLED_STATE_SET:[I invoke-virtual {v0}, Landroid/content/res/ColorStateList;->getDefaultColor()I move-result p1 invoke-virtual {v0, p0, p1}, Landroid/content/res/ColorStateList;->getColorForState([II)I move-result p0 return p0 .line 133 :cond_0 invoke-static {}, Landroidx/appcompat/widget/ThemeUtils;->getTypedValue()Landroid/util/TypedValue; move-result-object v0 .line 135 invoke-virtual {p0}, Landroid/content/Context;->getTheme()Landroid/content/res/Resources$Theme; move-result-object v1 const v2, 0x1010033 const/4 v3, 0x1 invoke-virtual {v1, v2, v0, v3}, Landroid/content/res/Resources$Theme;->resolveAttribute(ILandroid/util/TypedValue;Z)Z .line 136 invoke-virtual {v0}, Landroid/util/TypedValue;->getFloat()F move-result v0 .line 138 invoke-static {p0, p1, v0}, Landroidx/appcompat/widget/ThemeUtils;->getThemeAttrColor(Landroid/content/Context;IF)I move-result p0 return p0 .end method .method public static getThemeAttrColor(Landroid/content/Context;I)I .locals 2 .line 91 sget-object v0, Landroidx/appcompat/widget/ThemeUtils;->TEMP_ARRAY:[I const/4 v1, 0x0 aput p1, v0, v1 const/4 p1, 0x0 .line 92 invoke-static {p0, p1, v0}, Landroidx/appcompat/widget/TintTypedArray;->obtainStyledAttributes(Landroid/content/Context;Landroid/util/AttributeSet;[I)Landroidx/appcompat/widget/TintTypedArray; move-result-object p0 .line 94 :try_start_0 invoke-virtual {p0, v1, v1}, Landroidx/appcompat/widget/TintTypedArray;->getColor(II)I move-result p1 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 96 invoke-virtual {p0}, Landroidx/appcompat/widget/TintTypedArray;->recycle()V return p1 :catchall_0 move-exception p1 invoke-virtual {p0}, Landroidx/appcompat/widget/TintTypedArray;->recycle()V .line 97 throw p1 .end method .method static getThemeAttrColor(Landroid/content/Context;IF)I .locals 0 .line 152 invoke-static {p0, p1}, Landroidx/appcompat/widget/ThemeUtils;->getThemeAttrColor(Landroid/content/Context;I)I move-result p0 .line 153 invoke-static {p0}, Landroid/graphics/Color;->alpha(I)I move-result p1 int-to-float p1, p1 mul-float/2addr p1, p2 .line 154 invoke-static {p1}, Ljava/lang/Math;->round(F)I move-result p1 invoke-static {p0, p1}, Landroidx/core/graphics/ColorUtils;->setAlphaComponent(II)I move-result p0 return p0 .end method .method public static getThemeAttrColorStateList(Landroid/content/Context;I)Landroid/content/res/ColorStateList; .locals 2 .line 109 sget-object v0, Landroidx/appcompat/widget/ThemeUtils;->TEMP_ARRAY:[I const/4 v1, 0x0 aput p1, v0, v1 const/4 p1, 0x0 .line 110 invoke-static {p0, p1, v0}, Landroidx/appcompat/widget/TintTypedArray;->obtainStyledAttributes(Landroid/content/Context;Landroid/util/AttributeSet;[I)Landroidx/appcompat/widget/TintTypedArray; move-result-object p0 .line 112 :try_start_0 invoke-virtual {p0, v1}, Landroidx/appcompat/widget/TintTypedArray;->getColorStateList(I)Landroid/content/res/ColorStateList; move-result-object p1 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 114 invoke-virtual {p0}, Landroidx/appcompat/widget/TintTypedArray;->recycle()V return-object p1 :catchall_0 move-exception p1 invoke-virtual {p0}, Landroidx/appcompat/widget/TintTypedArray;->recycle()V .line 115 throw p1 .end method .method private static getTypedValue()Landroid/util/TypedValue; .locals 2 .line 143 sget-object v0, Landroidx/appcompat/widget/ThemeUtils;->TL_TYPED_VALUE:Ljava/lang/ThreadLocal; invoke-virtual {v0}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object; move-result-object v1 check-cast v1, Landroid/util/TypedValue; if-nez v1, :cond_0 .line 145 new-instance v1, Landroid/util/TypedValue; invoke-direct {v1}, Landroid/util/TypedValue;->()V .line 146 invoke-virtual {v0, v1}, Ljava/lang/ThreadLocal;->set(Ljava/lang/Object;)V :cond_0 return-object v1 .end method