AppCompatCompoundButtonHelper.smali
.class Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;
.super Ljava/lang/Object;
.source "AppCompatCompoundButtonHelper.java"
# instance fields
.field private mButtonTintList:Landroid/content/res/ColorStateList;
.field private mButtonTintMode:Landroid/graphics/PorterDuff$Mode;
.field private mHasButtonTint:Z
.field private mHasButtonTintMode:Z
.field private mSkipNextApply:Z
.field private final mView:Landroid/widget/CompoundButton;
# direct methods
.method static constructor <clinit>()V
.registers 1
return-void
.end method
.method constructor <init>(Landroid/widget/CompoundButton;)V
.registers 3
.param p1, "view" # Landroid/widget/CompoundButton;
.line 46
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 39
const/4 v0, 0x0
iput-object v0, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mButtonTintList:Landroid/content/res/ColorStateList;
.line 40
iput-object v0, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mButtonTintMode:Landroid/graphics/PorterDuff$Mode;
.line 41
const/4 v0, 0x0
iput-boolean v0, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mHasButtonTint:Z
.line 42
iput-boolean v0, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mHasButtonTintMode:Z
.line 47
iput-object p1, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mView:Landroid/widget/CompoundButton;
.line 48
return-void
.end method
# virtual methods
.method applyButtonTint()V
.registers 3
.line 127
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mView:Landroid/widget/CompoundButton;
invoke-static {v0}, Landroidx/core/widget/CompoundButtonCompat;->getButtonDrawable(Landroid/widget/CompoundButton;)Landroid/graphics/drawable/Drawable;
move-result-object v0
.line 129
.local v0, "buttonDrawable":Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_3e
iget-boolean v1, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mHasButtonTint:Z
if-nez v1, :cond_10
iget-boolean v1, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mHasButtonTintMode:Z
if-eqz v1, :cond_3e
.line 130
:cond_10
invoke-static {v0}, Landroidx/core/graphics/drawable/DrawableCompat;->wrap(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;
move-result-object v0
.line 131
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->mutate()Landroid/graphics/drawable/Drawable;
move-result-object v0
.line 132
iget-boolean v1, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mHasButtonTint:Z
if-eqz v1, :cond_21
.line 133
iget-object v1, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mButtonTintList:Landroid/content/res/ColorStateList;
invoke-static {v0, v1}, Landroidx/core/graphics/drawable/DrawableCompat;->setTintList(Landroid/graphics/drawable/Drawable;Landroid/content/res/ColorStateList;)V
.line 135
:cond_21
iget-boolean v1, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mHasButtonTintMode:Z
if-eqz v1, :cond_2a
.line 136
iget-object v1, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mButtonTintMode:Landroid/graphics/PorterDuff$Mode;
invoke-static {v0, v1}, Landroidx/core/graphics/drawable/DrawableCompat;->setTintMode(Landroid/graphics/drawable/Drawable;Landroid/graphics/PorterDuff$Mode;)V
.line 140
:cond_2a
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->isStateful()Z
move-result v1
if-eqz v1, :cond_39
.line 141
iget-object v1, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mView:Landroid/widget/CompoundButton;
invoke-virtual {v1}, Landroid/widget/CompoundButton;->getDrawableState()[I
move-result-object v1
invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->setState([I)Z
.line 143
:cond_39
iget-object v1, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mView:Landroid/widget/CompoundButton;
invoke-virtual {v1, v0}, Landroid/widget/CompoundButton;->setButtonDrawable(Landroid/graphics/drawable/Drawable;)V
.line 145
:cond_3e
return-void
.end method
.method getCompoundPaddingLeft(I)I
.registers 4
.param p1, "superValue" # I
.line 148
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x11
if-ge v0, v1, :cond_13
.line 151
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mView:Landroid/widget/CompoundButton;
invoke-static {v0}, Landroidx/core/widget/CompoundButtonCompat;->getButtonDrawable(Landroid/widget/CompoundButton;)Landroid/graphics/drawable/Drawable;
move-result-object v0
.line 152
.local v0, "buttonDrawable":Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_13
.line 153
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I
move-result v1
add-int/2addr p1, v1
.line 156
.end local v0 # "buttonDrawable":Landroid/graphics/drawable/Drawable;
:cond_13
return p1
.end method
.method getSupportButtonTintList()Landroid/content/res/ColorStateList;
.registers 2
.line 102
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mButtonTintList:Landroid/content/res/ColorStateList;
return-object v0
.end method
.method getSupportButtonTintMode()Landroid/graphics/PorterDuff$Mode;
.registers 2
.line 113
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mButtonTintMode:Landroid/graphics/PorterDuff$Mode;
return-object v0
.end method
.method loadFromAttributes(Landroid/util/AttributeSet;I)V
.registers 13
.param p1, "attrs" # Landroid/util/AttributeSet;
.param p2, "defStyleAttr" # I
.line 51
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mView:Landroid/widget/CompoundButton;
.line 52
invoke-virtual {v0}, Landroid/widget/CompoundButton;->getContext()Landroid/content/Context;
move-result-object v0
sget-object v1, Landroidx/appcompat/R$styleable;->CompoundButton:[I
const/4 v2, 0x0
invoke-static {v0, p1, v1, p2, v2}, Landroidx/appcompat/widget/TintTypedArray;->obtainStyledAttributes(Landroid/content/Context;Landroid/util/AttributeSet;[III)Landroidx/appcompat/widget/TintTypedArray;
move-result-object v0
.line 54
.local v0, "a":Landroidx/appcompat/widget/TintTypedArray;
iget-object v3, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mView:Landroid/widget/CompoundButton;
invoke-virtual {v3}, Landroid/widget/CompoundButton;->getContext()Landroid/content/Context;
move-result-object v4
sget-object v5, Landroidx/appcompat/R$styleable;->CompoundButton:[I
.line 55
invoke-virtual {v0}, Landroidx/appcompat/widget/TintTypedArray;->getWrappedTypeArray()Landroid/content/res/TypedArray;
move-result-object v7
.line 54
const/4 v9, 0x0
move-object v6, p1
move v8, p2
invoke-static/range {v3 .. v9}, Landroidx/core/view/ViewCompat;->saveAttributeDataForStyleable(Landroid/view/View;Landroid/content/Context;[ILandroid/util/AttributeSet;Landroid/content/res/TypedArray;II)V
.line 57
const/4 v1, 0x0
.line 58
.local v1, "buttonDrawableLoaded":Z
:try_start_20
sget v3, Landroidx/appcompat/R$styleable;->CompoundButton_buttonCompat:I
invoke-virtual {v0, v3}, Landroidx/appcompat/widget/TintTypedArray;->hasValue(I)Z
move-result v3
if-eqz v3, :cond_42
.line 59
sget v3, Landroidx/appcompat/R$styleable;->CompoundButton_buttonCompat:I
invoke-virtual {v0, v3, v2}, Landroidx/appcompat/widget/TintTypedArray;->getResourceId(II)I
move-result v3
:try_end_2e
.catchall {:try_start_20 .. :try_end_2e} :catchall_94
.line 60
.local v3, "resourceId":I
if-eqz v3, :cond_42
.line 62
:try_start_30
iget-object v4, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mView:Landroid/widget/CompoundButton;
iget-object v5, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mView:Landroid/widget/CompoundButton;
.line 63
invoke-virtual {v5}, Landroid/widget/CompoundButton;->getContext()Landroid/content/Context;
move-result-object v5
invoke-static {v5, v3}, Landroidx/appcompat/content/res/AppCompatResources;->getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
move-result-object v5
.line 62
invoke-virtual {v4, v5}, Landroid/widget/CompoundButton;->setButtonDrawable(Landroid/graphics/drawable/Drawable;)V
:try_end_3f
.catch Landroid/content/res/Resources$NotFoundException; {:try_start_30 .. :try_end_3f} :catch_41
.catchall {:try_start_30 .. :try_end_3f} :catchall_94
.line 64
const/4 v1, 0x1
.line 68
goto :goto_42
.line 65
:catch_41
move-exception v4
.line 71
.end local v3 # "resourceId":I
:cond_42
:goto_42
if-nez v1, :cond_63
:try_start_44
sget v3, Landroidx/appcompat/R$styleable;->CompoundButton_android_button:I
invoke-virtual {v0, v3}, Landroidx/appcompat/widget/TintTypedArray;->hasValue(I)Z
move-result v3
if-eqz v3, :cond_63
.line 72
sget v3, Landroidx/appcompat/R$styleable;->CompoundButton_android_button:I
invoke-virtual {v0, v3, v2}, Landroidx/appcompat/widget/TintTypedArray;->getResourceId(II)I
move-result v2
.line 74
.local v2, "resourceId":I
if-eqz v2, :cond_63
.line 75
iget-object v3, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mView:Landroid/widget/CompoundButton;
iget-object v4, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mView:Landroid/widget/CompoundButton;
.line 76
invoke-virtual {v4}, Landroid/widget/CompoundButton;->getContext()Landroid/content/Context;
move-result-object v4
invoke-static {v4, v2}, Landroidx/appcompat/content/res/AppCompatResources;->getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
move-result-object v4
.line 75
invoke-virtual {v3, v4}, Landroid/widget/CompoundButton;->setButtonDrawable(Landroid/graphics/drawable/Drawable;)V
.line 79
.end local v2 # "resourceId":I
:cond_63
sget v2, Landroidx/appcompat/R$styleable;->CompoundButton_buttonTint:I
invoke-virtual {v0, v2}, Landroidx/appcompat/widget/TintTypedArray;->hasValue(I)Z
move-result v2
if-eqz v2, :cond_76
.line 80
iget-object v2, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mView:Landroid/widget/CompoundButton;
sget v3, Landroidx/appcompat/R$styleable;->CompoundButton_buttonTint:I
.line 81
invoke-virtual {v0, v3}, Landroidx/appcompat/widget/TintTypedArray;->getColorStateList(I)Landroid/content/res/ColorStateList;
move-result-object v3
.line 80
invoke-static {v2, v3}, Landroidx/core/widget/CompoundButtonCompat;->setButtonTintList(Landroid/widget/CompoundButton;Landroid/content/res/ColorStateList;)V
.line 83
:cond_76
sget v2, Landroidx/appcompat/R$styleable;->CompoundButton_buttonTintMode:I
invoke-virtual {v0, v2}, Landroidx/appcompat/widget/TintTypedArray;->hasValue(I)Z
move-result v2
if-eqz v2, :cond_8f
.line 84
iget-object v2, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mView:Landroid/widget/CompoundButton;
sget v3, Landroidx/appcompat/R$styleable;->CompoundButton_buttonTintMode:I
const/4 v4, -0x1
.line 86
invoke-virtual {v0, v3, v4}, Landroidx/appcompat/widget/TintTypedArray;->getInt(II)I
move-result v3
const/4 v4, 0x0
.line 85
invoke-static {v3, v4}, Landroidx/appcompat/widget/DrawableUtils;->parseTintMode(ILandroid/graphics/PorterDuff$Mode;)Landroid/graphics/PorterDuff$Mode;
move-result-object v3
.line 84
invoke-static {v2, v3}, Landroidx/core/widget/CompoundButtonCompat;->setButtonTintMode(Landroid/widget/CompoundButton;Landroid/graphics/PorterDuff$Mode;)V
:try_end_8f
.catchall {:try_start_44 .. :try_end_8f} :catchall_94
.line 90
.end local v1 # "buttonDrawableLoaded":Z
:cond_8f
invoke-virtual {v0}, Landroidx/appcompat/widget/TintTypedArray;->recycle()V
.line 91
nop
.line 92
return-void
.line 90
:catchall_94
move-exception v1
invoke-virtual {v0}, Landroidx/appcompat/widget/TintTypedArray;->recycle()V
.line 91
throw v1
.end method
.method onSetButtonDrawable()V
.registers 2
.line 117
iget-boolean v0, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mSkipNextApply:Z
if-eqz v0, :cond_8
.line 118
const/4 v0, 0x0
iput-boolean v0, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mSkipNextApply:Z
.line 119
return-void
.line 122
:cond_8
const/4 v0, 0x1
iput-boolean v0, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mSkipNextApply:Z
.line 123
invoke-virtual {p0}, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->applyButtonTint()V
.line 124
return-void
.end method
.method setSupportButtonTintList(Landroid/content/res/ColorStateList;)V
.registers 3
.param p1, "tint" # Landroid/content/res/ColorStateList;
.line 95
iput-object p1, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mButtonTintList:Landroid/content/res/ColorStateList;
.line 96
const/4 v0, 0x1
iput-boolean v0, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mHasButtonTint:Z
.line 98
invoke-virtual {p0}, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->applyButtonTint()V
.line 99
return-void
.end method
.method setSupportButtonTintMode(Landroid/graphics/PorterDuff$Mode;)V
.registers 3
.param p1, "tintMode" # Landroid/graphics/PorterDuff$Mode;
.line 106
iput-object p1, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mButtonTintMode:Landroid/graphics/PorterDuff$Mode;
.line 107
const/4 v0, 0x1
iput-boolean v0, p0, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->mHasButtonTintMode:Z
.line 109
invoke-virtual {p0}, Landroidx/appcompat/widget/AppCompatCompoundButtonHelper;->applyButtonTint()V
.line 110
return-void
.end method