SwitchCompat.smali
.class public Landroidx/appcompat/widget/SwitchCompat;
.super Landroid/widget/CompoundButton;
.source "SwitchCompat.java"
# static fields
.field private static final ACCESSIBILITY_EVENT_CLASS_NAME:Ljava/lang/String; = "android.widget.Switch"
.field private static final CHECKED_STATE_SET:[I
.field private static final MONOSPACE:I = 0x3
.field private static final SANS:I = 0x1
.field private static final SERIF:I = 0x2
.field private static final THUMB_ANIMATION_DURATION:I = 0xfa
.field private static final THUMB_POS:Landroid/util/Property;
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroid/util/Property<",
"Landroidx/appcompat/widget/SwitchCompat;",
"Ljava/lang/Float;",
">;"
}
.end annotation
.end field
.field private static final TOUCH_MODE_DOWN:I = 0x1
.field private static final TOUCH_MODE_DRAGGING:I = 0x2
.field private static final TOUCH_MODE_IDLE:I
# instance fields
.field private mHasThumbTint:Z
.field private mHasThumbTintMode:Z
.field private mHasTrackTint:Z
.field private mHasTrackTintMode:Z
.field private mMinFlingVelocity:I
.field private mOffLayout:Landroid/text/Layout;
.field private mOnLayout:Landroid/text/Layout;
.field mPositionAnimator:Landroid/animation/ObjectAnimator;
.field private mShowText:Z
.field private mSplitTrack:Z
.field private mSwitchBottom:I
.field private mSwitchHeight:I
.field private mSwitchLeft:I
.field private mSwitchMinWidth:I
.field private mSwitchPadding:I
.field private mSwitchRight:I
.field private mSwitchTop:I
.field private mSwitchTransformationMethod:Landroid/text/method/TransformationMethod;
.field private mSwitchWidth:I
.field private final mTempRect:Landroid/graphics/Rect;
.field private mTextColors:Landroid/content/res/ColorStateList;
.field private final mTextHelper:Landroidx/appcompat/widget/AppCompatTextHelper;
.field private mTextOff:Ljava/lang/CharSequence;
.field private mTextOn:Ljava/lang/CharSequence;
.field private final mTextPaint:Landroid/text/TextPaint;
.field private mThumbDrawable:Landroid/graphics/drawable/Drawable;
.field mThumbPosition:F
.field private mThumbTextPadding:I
.field private mThumbTintList:Landroid/content/res/ColorStateList;
.field private mThumbTintMode:Landroid/graphics/PorterDuff$Mode;
.field private mThumbWidth:I
.field private mTouchMode:I
.field private mTouchSlop:I
.field private mTouchX:F
.field private mTouchY:F
.field private mTrackDrawable:Landroid/graphics/drawable/Drawable;
.field private mTrackTintList:Landroid/content/res/ColorStateList;
.field private mTrackTintMode:Landroid/graphics/PorterDuff$Mode;
.field private mVelocityTracker:Landroid/view/VelocityTracker;
# direct methods
.method static constructor <clinit>()V
.registers 3
.line 102
new-instance v0, Landroidx/appcompat/widget/SwitchCompat$1;
const-class v1, Ljava/lang/Float;
const-string v2, "thumbPos"
invoke-direct {v0, v1, v2}, Landroidx/appcompat/widget/SwitchCompat$1;-><init>(Ljava/lang/Class;Ljava/lang/String;)V
sput-object v0, Landroidx/appcompat/widget/SwitchCompat;->THUMB_POS:Landroid/util/Property;
const/4 v0, 0x1
new-array v0, v0, [I
const/4 v1, 0x0
const v2, 0x10100a0
aput v2, v0, v1
.line 185
sput-object v0, Landroidx/appcompat/widget/SwitchCompat;->CHECKED_STATE_SET:[I
return-void
.end method
.method public constructor <init>(Landroid/content/Context;)V
.registers 3
const/4 v0, 0x0
.line 195
invoke-direct {p0, p1, v0}, Landroidx/appcompat/widget/SwitchCompat;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.registers 4
.line 206
sget v0, Landroidx/appcompat/R$attr;->switchStyle:I
invoke-direct {p0, p1, p2, v0}, Landroidx/appcompat/widget/SwitchCompat;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
.registers 15
.line 220
invoke-direct {p0, p1, p2, p3}, Landroid/widget/CompoundButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
const/4 v0, 0x0
.line 116
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintList:Landroid/content/res/ColorStateList;
.line 117
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintMode:Landroid/graphics/PorterDuff$Mode;
const/4 v1, 0x0
.line 118
iput-boolean v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTint:Z
.line 119
iput-boolean v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTintMode:Z
.line 122
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintList:Landroid/content/res/ColorStateList;
.line 123
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintMode:Landroid/graphics/PorterDuff$Mode;
.line 124
iput-boolean v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTint:Z
.line 125
iput-boolean v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTintMode:Z
.line 139
invoke-static {}, Landroid/view/VelocityTracker;->obtain()Landroid/view/VelocityTracker;
move-result-object v2
iput-object v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mVelocityTracker:Landroid/view/VelocityTracker;
.line 182
new-instance v2, Landroid/graphics/Rect;
invoke-direct {v2}, Landroid/graphics/Rect;-><init>()V
iput-object v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTempRect:Landroid/graphics/Rect;
.line 222
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getContext()Landroid/content/Context;
move-result-object v2
invoke-static {p0, v2}, Landroidx/appcompat/widget/ThemeUtils;->checkAppCompatTheme(Landroid/view/View;Landroid/content/Context;)V
.line 224
new-instance v2, Landroid/text/TextPaint;
const/4 v3, 0x1
invoke-direct {v2, v3}, Landroid/text/TextPaint;-><init>(I)V
iput-object v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
.line 226
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getResources()Landroid/content/res/Resources;
move-result-object v2
.line 227
iget-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
invoke-virtual {v2}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
move-result-object v2
iget v2, v2, Landroid/util/DisplayMetrics;->density:F
iput v2, v4, Landroid/text/TextPaint;->density:F
.line 229
sget-object v2, Landroidx/appcompat/R$styleable;->SwitchCompat:[I
invoke-static {p1, p2, v2, p3, v1}, Landroidx/appcompat/widget/TintTypedArray;->obtainStyledAttributes(Landroid/content/Context;Landroid/util/AttributeSet;[III)Landroidx/appcompat/widget/TintTypedArray;
move-result-object v2
.line 231
sget-object v6, Landroidx/appcompat/R$styleable;->SwitchCompat:[I
.line 233
invoke-virtual {v2}, Landroidx/appcompat/widget/TintTypedArray;->getWrappedTypeArray()Landroid/content/res/TypedArray;
move-result-object v8
const/4 v10, 0x0
move-object v4, p0
move-object v5, p1
move-object v7, p2
move v9, p3
.line 231
invoke-static/range {v4 .. v10}, Landroidx/core/view/ViewCompat;->saveAttributeDataForStyleable(Landroid/view/View;Landroid/content/Context;[ILandroid/util/AttributeSet;Landroid/content/res/TypedArray;II)V
.line 235
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_android_thumb:I
invoke-virtual {v2, v4}, Landroidx/appcompat/widget/TintTypedArray;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v4
iput-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v4, :cond_60
.line 237
invoke-virtual {v4, p0}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V
.line 239
:cond_60
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_track:I
invoke-virtual {v2, v4}, Landroidx/appcompat/widget/TintTypedArray;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v4
iput-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v4, :cond_6d
.line 241
invoke-virtual {v4, p0}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V
.line 243
:cond_6d
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_android_textOn:I
invoke-virtual {v2, v4}, Landroidx/appcompat/widget/TintTypedArray;->getText(I)Ljava/lang/CharSequence;
move-result-object v4
iput-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOn:Ljava/lang/CharSequence;
.line 244
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_android_textOff:I
invoke-virtual {v2, v4}, Landroidx/appcompat/widget/TintTypedArray;->getText(I)Ljava/lang/CharSequence;
move-result-object v4
iput-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOff:Ljava/lang/CharSequence;
.line 245
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_showText:I
invoke-virtual {v2, v4, v3}, Landroidx/appcompat/widget/TintTypedArray;->getBoolean(IZ)Z
move-result v4
iput-boolean v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mShowText:Z
.line 246
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_thumbTextPadding:I
invoke-virtual {v2, v4, v1}, Landroidx/appcompat/widget/TintTypedArray;->getDimensionPixelSize(II)I
move-result v4
iput v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTextPadding:I
.line 248
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_switchMinWidth:I
invoke-virtual {v2, v4, v1}, Landroidx/appcompat/widget/TintTypedArray;->getDimensionPixelSize(II)I
move-result v4
iput v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchMinWidth:I
.line 250
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_switchPadding:I
invoke-virtual {v2, v4, v1}, Landroidx/appcompat/widget/TintTypedArray;->getDimensionPixelSize(II)I
move-result v4
iput v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchPadding:I
.line 252
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_splitTrack:I
invoke-virtual {v2, v4, v1}, Landroidx/appcompat/widget/TintTypedArray;->getBoolean(IZ)Z
move-result v4
iput-boolean v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mSplitTrack:Z
.line 254
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_thumbTint:I
invoke-virtual {v2, v4}, Landroidx/appcompat/widget/TintTypedArray;->getColorStateList(I)Landroid/content/res/ColorStateList;
move-result-object v4
if-eqz v4, :cond_b1
.line 256
iput-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintList:Landroid/content/res/ColorStateList;
.line 257
iput-boolean v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTint:Z
.line 259
:cond_b1
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_thumbTintMode:I
const/4 v5, -0x1
.line 260
invoke-virtual {v2, v4, v5}, Landroidx/appcompat/widget/TintTypedArray;->getInt(II)I
move-result v4
.line 259
invoke-static {v4, v0}, Landroidx/appcompat/widget/DrawableUtils;->parseTintMode(ILandroid/graphics/PorterDuff$Mode;)Landroid/graphics/PorterDuff$Mode;
move-result-object v4
.line 261
iget-object v6, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintMode:Landroid/graphics/PorterDuff$Mode;
if-eq v6, v4, :cond_c4
.line 262
iput-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintMode:Landroid/graphics/PorterDuff$Mode;
.line 263
iput-boolean v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTintMode:Z
.line 265
:cond_c4
iget-boolean v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTint:Z
if-nez v4, :cond_cc
iget-boolean v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTintMode:Z
if-eqz v4, :cond_cf
.line 266
:cond_cc
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->applyThumbTint()V
.line 269
:cond_cf
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_trackTint:I
invoke-virtual {v2, v4}, Landroidx/appcompat/widget/TintTypedArray;->getColorStateList(I)Landroid/content/res/ColorStateList;
move-result-object v4
if-eqz v4, :cond_db
.line 271
iput-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintList:Landroid/content/res/ColorStateList;
.line 272
iput-boolean v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTint:Z
.line 274
:cond_db
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_trackTintMode:I
.line 275
invoke-virtual {v2, v4, v5}, Landroidx/appcompat/widget/TintTypedArray;->getInt(II)I
move-result v4
.line 274
invoke-static {v4, v0}, Landroidx/appcompat/widget/DrawableUtils;->parseTintMode(ILandroid/graphics/PorterDuff$Mode;)Landroid/graphics/PorterDuff$Mode;
move-result-object v0
.line 276
iget-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintMode:Landroid/graphics/PorterDuff$Mode;
if-eq v4, v0, :cond_ed
.line 277
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintMode:Landroid/graphics/PorterDuff$Mode;
.line 278
iput-boolean v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTintMode:Z
.line 280
:cond_ed
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTint:Z
if-nez v0, :cond_f5
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTintMode:Z
if-eqz v0, :cond_f8
.line 281
:cond_f5
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->applyTrackTint()V
.line 284
:cond_f8
sget v0, Landroidx/appcompat/R$styleable;->SwitchCompat_switchTextAppearance:I
invoke-virtual {v2, v0, v1}, Landroidx/appcompat/widget/TintTypedArray;->getResourceId(II)I
move-result v0
if-eqz v0, :cond_103
.line 287
invoke-virtual {p0, p1, v0}, Landroidx/appcompat/widget/SwitchCompat;->setSwitchTextAppearance(Landroid/content/Context;I)V
.line 290
:cond_103
new-instance v0, Landroidx/appcompat/widget/AppCompatTextHelper;
invoke-direct {v0, p0}, Landroidx/appcompat/widget/AppCompatTextHelper;-><init>(Landroid/widget/TextView;)V
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextHelper:Landroidx/appcompat/widget/AppCompatTextHelper;
.line 291
invoke-virtual {v0, p2, p3}, Landroidx/appcompat/widget/AppCompatTextHelper;->loadFromAttributes(Landroid/util/AttributeSet;I)V
.line 293
invoke-virtual {v2}, Landroidx/appcompat/widget/TintTypedArray;->recycle()V
.line 295
invoke-static {p1}, Landroid/view/ViewConfiguration;->get(Landroid/content/Context;)Landroid/view/ViewConfiguration;
move-result-object p1
.line 296
invoke-virtual {p1}, Landroid/view/ViewConfiguration;->getScaledTouchSlop()I
move-result p2
iput p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchSlop:I
.line 297
invoke-virtual {p1}, Landroid/view/ViewConfiguration;->getScaledMinimumFlingVelocity()I
move-result p1
iput p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mMinFlingVelocity:I
.line 300
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->refreshDrawableState()V
.line 301
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->isChecked()Z
move-result p1
invoke-virtual {p0, p1}, Landroidx/appcompat/widget/SwitchCompat;->setChecked(Z)V
return-void
.end method
.method private animateThumbToCheckedState(Z)V
.registers 6
if-eqz p1, :cond_5
const/high16 p1, 0x3f800000 # 1.0f
goto :goto_6
:cond_5
const/4 p1, 0x0
.line 1036
:goto_6
sget-object v0, Landroidx/appcompat/widget/SwitchCompat;->THUMB_POS:Landroid/util/Property;
const/4 v1, 0x1
new-array v2, v1, [F
const/4 v3, 0x0
aput p1, v2, v3
invoke-static {p0, v0, v2}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Landroid/util/Property;[F)Landroid/animation/ObjectAnimator;
move-result-object p1
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mPositionAnimator:Landroid/animation/ObjectAnimator;
const-wide/16 v2, 0xfa
.line 1037
invoke-virtual {p1, v2, v3}, Landroid/animation/ObjectAnimator;->setDuration(J)Landroid/animation/ObjectAnimator;
.line 1038
sget p1, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v0, 0x12
if-lt p1, v0, :cond_24
.line 1039
iget-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mPositionAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {p1, v1}, Landroid/animation/ObjectAnimator;->setAutoCancel(Z)V
.line 1041
:cond_24
iget-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mPositionAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {p1}, Landroid/animation/ObjectAnimator;->start()V
return-void
.end method
.method private applyThumbTint()V
.registers 3
.line 705
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_3d
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTint:Z
if-nez v0, :cond_c
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTintMode:Z
if-eqz v0, :cond_3d
.line 706
:cond_c
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
invoke-static {v0}, Landroidx/core/graphics/drawable/DrawableCompat;->wrap(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;
move-result-object v0
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->mutate()Landroid/graphics/drawable/Drawable;
move-result-object v0
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
.line 708
iget-boolean v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTint:Z
if-eqz v1, :cond_21
.line 709
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintList:Landroid/content/res/ColorStateList;
invoke-static {v0, v1}, Landroidx/core/graphics/drawable/DrawableCompat;->setTintList(Landroid/graphics/drawable/Drawable;Landroid/content/res/ColorStateList;)V
.line 712
:cond_21
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTintMode:Z
if-eqz v0, :cond_2c
.line 713
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintMode:Landroid/graphics/PorterDuff$Mode;
invoke-static {v0, v1}, Landroidx/core/graphics/drawable/DrawableCompat;->setTintMode(Landroid/graphics/drawable/Drawable;Landroid/graphics/PorterDuff$Mode;)V
.line 718
:cond_2c
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->isStateful()Z
move-result v0
if-eqz v0, :cond_3d
.line 719
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getDrawableState()[I
move-result-object v1
invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->setState([I)Z
:cond_3d
return-void
.end method
.method private applyTrackTint()V
.registers 3
.line 582
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_3d
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTint:Z
if-nez v0, :cond_c
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTintMode:Z
if-eqz v0, :cond_3d
.line 583
:cond_c
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
invoke-static {v0}, Landroidx/core/graphics/drawable/DrawableCompat;->wrap(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;
move-result-object v0
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->mutate()Landroid/graphics/drawable/Drawable;
move-result-object v0
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
.line 585
iget-boolean v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTint:Z
if-eqz v1, :cond_21
.line 586
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintList:Landroid/content/res/ColorStateList;
invoke-static {v0, v1}, Landroidx/core/graphics/drawable/DrawableCompat;->setTintList(Landroid/graphics/drawable/Drawable;Landroid/content/res/ColorStateList;)V
.line 589
:cond_21
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTintMode:Z
if-eqz v0, :cond_2c
.line 590
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintMode:Landroid/graphics/PorterDuff$Mode;
invoke-static {v0, v1}, Landroidx/core/graphics/drawable/DrawableCompat;->setTintMode(Landroid/graphics/drawable/Drawable;Landroid/graphics/PorterDuff$Mode;)V
.line 595
:cond_2c
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->isStateful()Z
move-result v0
if-eqz v0, :cond_3d
.line 596
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getDrawableState()[I
move-result-object v1
invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->setState([I)Z
:cond_3d
return-void
.end method
.method private cancelPositionAnimator()V
.registers 2
.line 1045
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mPositionAnimator:Landroid/animation/ObjectAnimator;
if-eqz v0, :cond_7
.line 1046
invoke-virtual {v0}, Landroid/animation/ObjectAnimator;->cancel()V
:cond_7
return-void
.end method
.method private cancelSuperTouch(Landroid/view/MotionEvent;)V
.registers 3
.line 995
invoke-static {p1}, Landroid/view/MotionEvent;->obtain(Landroid/view/MotionEvent;)Landroid/view/MotionEvent;
move-result-object p1
const/4 v0, 0x3
.line 996
invoke-virtual {p1, v0}, Landroid/view/MotionEvent;->setAction(I)V
.line 997
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onTouchEvent(Landroid/view/MotionEvent;)Z
.line 998
invoke-virtual {p1}, Landroid/view/MotionEvent;->recycle()V
return-void
.end method
.method private static constrain(FFF)F
.registers 4
cmpg-float v0, p0, p1
if-gez v0, :cond_6
move p0, p1
goto :goto_b
:cond_6
cmpl-float p1, p0, p2
if-lez p1, :cond_b
move p0, p2
:cond_b
:goto_b
return p0
.end method
.method private getTargetCheckedState()Z
.registers 3
.line 1051
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbPosition:F
const/high16 v1, 0x3f000000 # 0.5f
cmpl-float v0, v0, v1
if-lez v0, :cond_a
const/4 v0, 0x1
goto :goto_b
:cond_a
const/4 v0, 0x0
:goto_b
return v0
.end method
.method private getThumbOffset()I
.registers 3
.line 1304
invoke-static {p0}, Landroidx/appcompat/widget/ViewUtils;->isLayoutRtl(Landroid/view/View;)Z
move-result v0
if-eqz v0, :cond_c
const/high16 v0, 0x3f800000 # 1.0f
.line 1305
iget v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbPosition:F
sub-float/2addr v0, v1
goto :goto_e
.line 1307
:cond_c
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbPosition:F
.line 1309
:goto_e
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->getThumbScrollRange()I
move-result v1
int-to-float v1, v1
mul-float v0, v0, v1
const/high16 v1, 0x3f000000 # 0.5f
add-float/2addr v0, v1
float-to-int v0, v0
return v0
.end method
.method private getThumbScrollRange()I
.registers 5
.line 1313
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_26
.line 1314
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTempRect:Landroid/graphics/Rect;
.line 1315
invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z
.line 1318
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_12
.line 1319
invoke-static {v0}, Landroidx/appcompat/widget/DrawableUtils;->getOpticalBounds(Landroid/graphics/drawable/Drawable;)Landroid/graphics/Rect;
move-result-object v0
goto :goto_14
.line 1321
:cond_12
sget-object v0, Landroidx/appcompat/widget/DrawableUtils;->INSETS_NONE:Landroid/graphics/Rect;
.line 1324
:goto_14
iget v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchWidth:I
iget v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbWidth:I
sub-int/2addr v2, v3
iget v3, v1, Landroid/graphics/Rect;->left:I
sub-int/2addr v2, v3
iget v1, v1, Landroid/graphics/Rect;->right:I
sub-int/2addr v2, v1
iget v1, v0, Landroid/graphics/Rect;->left:I
sub-int/2addr v2, v1
iget v0, v0, Landroid/graphics/Rect;->right:I
sub-int/2addr v2, v0
return v2
:cond_26
const/4 v0, 0x0
return v0
.end method
.method private hitThumb(FF)Z
.registers 9
.line 899
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
const/4 v1, 0x0
if-nez v0, :cond_6
return v1
.line 904
:cond_6
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->getThumbOffset()I
move-result v0
.line 906
iget-object v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
iget-object v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mTempRect:Landroid/graphics/Rect;
invoke-virtual {v2, v3}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z
.line 907
iget v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchTop:I
iget v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchSlop:I
sub-int/2addr v2, v3
.line 908
iget v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchLeft:I
add-int/2addr v4, v0
sub-int/2addr v4, v3
.line 909
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbWidth:I
add-int/2addr v0, v4
iget-object v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mTempRect:Landroid/graphics/Rect;
iget v3, v3, Landroid/graphics/Rect;->left:I
add-int/2addr v0, v3
iget-object v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mTempRect:Landroid/graphics/Rect;
iget v3, v3, Landroid/graphics/Rect;->right:I
add-int/2addr v0, v3
iget v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchSlop:I
add-int/2addr v0, v3
.line 911
iget v5, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchBottom:I
add-int/2addr v5, v3
int-to-float v3, v4
cmpl-float v3, p1, v3
if-lez v3, :cond_42
int-to-float v0, v0
cmpg-float p1, p1, v0
if-gez p1, :cond_42
int-to-float p1, v2
cmpl-float p1, p2, p1
if-lez p1, :cond_42
int-to-float p1, v5
cmpg-float p1, p2, p1
if-gez p1, :cond_42
const/4 v1, 0x1
:cond_42
return v1
.end method
.method private makeLayout(Ljava/lang/CharSequence;)Landroid/text/Layout;
.registers 10
.line 885
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchTransformationMethod:Landroid/text/method/TransformationMethod;
if-eqz v0, :cond_8
.line 886
invoke-interface {v0, p1, p0}, Landroid/text/method/TransformationMethod;->getTransformation(Ljava/lang/CharSequence;Landroid/view/View;)Ljava/lang/CharSequence;
move-result-object p1
:cond_8
move-object v1, p1
.line 889
new-instance p1, Landroid/text/StaticLayout;
iget-object v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
if-eqz v1, :cond_1b
.line 891
invoke-static {v1, v2}, Landroid/text/Layout;->getDesiredWidth(Ljava/lang/CharSequence;Landroid/text/TextPaint;)F
move-result v0
float-to-double v3, v0
invoke-static {v3, v4}, Ljava/lang/Math;->ceil(D)D
move-result-wide v3
double-to-int v0, v3
move v3, v0
goto :goto_1d
:cond_1b
const/4 v0, 0x0
const/4 v3, 0x0
:goto_1d
sget-object v4, Landroid/text/Layout$Alignment;->ALIGN_NORMAL:Landroid/text/Layout$Alignment;
const/high16 v5, 0x3f800000 # 1.0f
const/4 v6, 0x0
const/4 v7, 0x1
move-object v0, p1
invoke-direct/range {v0 .. v7}, Landroid/text/StaticLayout;-><init>(Ljava/lang/CharSequence;Landroid/text/TextPaint;ILandroid/text/Layout$Alignment;FFZ)V
return-object p1
.end method
.method private setSwitchTypefaceByIndex(II)V
.registers 4
const/4 v0, 0x1
if-eq p1, v0, :cond_11
const/4 v0, 0x2
if-eq p1, v0, :cond_e
const/4 v0, 0x3
if-eq p1, v0, :cond_b
const/4 p1, 0x0
goto :goto_13
.line 361
:cond_b
sget-object p1, Landroid/graphics/Typeface;->MONOSPACE:Landroid/graphics/Typeface;
goto :goto_13
.line 357
:cond_e
sget-object p1, Landroid/graphics/Typeface;->SERIF:Landroid/graphics/Typeface;
goto :goto_13
.line 353
:cond_11
sget-object p1, Landroid/graphics/Typeface;->SANS_SERIF:Landroid/graphics/Typeface;
.line 365
:goto_13
invoke-virtual {p0, p1, p2}, Landroidx/appcompat/widget/SwitchCompat;->setSwitchTypeface(Landroid/graphics/Typeface;I)V
return-void
.end method
.method private stopDrag(Landroid/view/MotionEvent;)V
.registers 8
const/4 v0, 0x0
.line 1007
iput v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchMode:I
.line 1011
invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I
move-result v1
const/4 v2, 0x1
if-ne v1, v2, :cond_12
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->isEnabled()Z
move-result v1
if-eqz v1, :cond_12
const/4 v1, 0x1
goto :goto_13
:cond_12
const/4 v1, 0x0
.line 1012
:goto_13
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->isChecked()Z
move-result v3
if-eqz v1, :cond_49
.line 1015
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mVelocityTracker:Landroid/view/VelocityTracker;
const/16 v4, 0x3e8
invoke-virtual {v1, v4}, Landroid/view/VelocityTracker;->computeCurrentVelocity(I)V
.line 1016
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mVelocityTracker:Landroid/view/VelocityTracker;
invoke-virtual {v1}, Landroid/view/VelocityTracker;->getXVelocity()F
move-result v1
.line 1017
invoke-static {v1}, Ljava/lang/Math;->abs(F)F
move-result v4
iget v5, p0, Landroidx/appcompat/widget/SwitchCompat;->mMinFlingVelocity:I
int-to-float v5, v5
cmpl-float v4, v4, v5
if-lez v4, :cond_44
.line 1018
invoke-static {p0}, Landroidx/appcompat/widget/ViewUtils;->isLayoutRtl(Landroid/view/View;)Z
move-result v4
const/4 v5, 0x0
if-eqz v4, :cond_3d
cmpg-float v1, v1, v5
if-gez v1, :cond_42
goto :goto_4a
:cond_3d
cmpl-float v1, v1, v5
if-lez v1, :cond_42
goto :goto_4a
:cond_42
const/4 v2, 0x0
goto :goto_4a
.line 1020
:cond_44
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->getTargetCheckedState()Z
move-result v2
goto :goto_4a
:cond_49
move v2, v3
:goto_4a
if-eq v2, v3, :cond_4f
.line 1027
invoke-virtual {p0, v0}, Landroidx/appcompat/widget/SwitchCompat;->playSoundEffect(I)V
.line 1030
:cond_4f
invoke-virtual {p0, v2}, Landroidx/appcompat/widget/SwitchCompat;->setChecked(Z)V
.line 1031
invoke-direct {p0, p1}, Landroidx/appcompat/widget/SwitchCompat;->cancelSuperTouch(Landroid/view/MotionEvent;)V
return-void
.end method
# virtual methods
.method public draw(Landroid/graphics/Canvas;)V
.registers 12
.line 1144
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTempRect:Landroid/graphics/Rect;
.line 1145
iget v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchLeft:I
.line 1146
iget v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchTop:I
.line 1147
iget v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchRight:I
.line 1148
iget v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchBottom:I
.line 1150
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->getThumbOffset()I
move-result v5
add-int/2addr v5, v1
.line 1153
iget-object v6, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v6, :cond_18
.line 1154
invoke-static {v6}, Landroidx/appcompat/widget/DrawableUtils;->getOpticalBounds(Landroid/graphics/drawable/Drawable;)Landroid/graphics/Rect;
move-result-object v6
goto :goto_1a
.line 1156
:cond_18
sget-object v6, Landroidx/appcompat/widget/DrawableUtils;->INSETS_NONE:Landroid/graphics/Rect;
.line 1160
:goto_1a
iget-object v7, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v7, :cond_61
.line 1161
invoke-virtual {v7, v0}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z
.line 1164
iget v7, v0, Landroid/graphics/Rect;->left:I
add-int/2addr v5, v7
if-eqz v6, :cond_5a
.line 1172
iget v7, v6, Landroid/graphics/Rect;->left:I
iget v8, v0, Landroid/graphics/Rect;->left:I
if-le v7, v8, :cond_32
.line 1173
iget v7, v6, Landroid/graphics/Rect;->left:I
iget v8, v0, Landroid/graphics/Rect;->left:I
sub-int/2addr v7, v8
add-int/2addr v1, v7
.line 1175
:cond_32
iget v7, v6, Landroid/graphics/Rect;->top:I
iget v8, v0, Landroid/graphics/Rect;->top:I
if-le v7, v8, :cond_3f
.line 1176
iget v7, v6, Landroid/graphics/Rect;->top:I
iget v8, v0, Landroid/graphics/Rect;->top:I
sub-int/2addr v7, v8
add-int/2addr v7, v2
goto :goto_40
:cond_3f
move v7, v2
.line 1178
:goto_40
iget v8, v6, Landroid/graphics/Rect;->right:I
iget v9, v0, Landroid/graphics/Rect;->right:I
if-le v8, v9, :cond_4c
.line 1179
iget v8, v6, Landroid/graphics/Rect;->right:I
iget v9, v0, Landroid/graphics/Rect;->right:I
sub-int/2addr v8, v9
sub-int/2addr v3, v8
.line 1181
:cond_4c
iget v8, v6, Landroid/graphics/Rect;->bottom:I
iget v9, v0, Landroid/graphics/Rect;->bottom:I
if-le v8, v9, :cond_5b
.line 1182
iget v6, v6, Landroid/graphics/Rect;->bottom:I
iget v8, v0, Landroid/graphics/Rect;->bottom:I
sub-int/2addr v6, v8
sub-int v6, v4, v6
goto :goto_5c
:cond_5a
move v7, v2
:cond_5b
move v6, v4
.line 1185
:goto_5c
iget-object v8, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
invoke-virtual {v8, v1, v7, v3, v6}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V
.line 1189
:cond_61
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v1, :cond_80
.line 1190
invoke-virtual {v1, v0}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z
.line 1192
iget v1, v0, Landroid/graphics/Rect;->left:I
sub-int v1, v5, v1
.line 1193
iget v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbWidth:I
add-int/2addr v5, v3
iget v0, v0, Landroid/graphics/Rect;->right:I
add-int/2addr v5, v0
.line 1194
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
invoke-virtual {v0, v1, v2, v5, v4}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V
.line 1196
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getBackground()Landroid/graphics/drawable/Drawable;
move-result-object v0
if-eqz v0, :cond_80
.line 1198
invoke-static {v0, v1, v2, v5, v4}, Landroidx/core/graphics/drawable/DrawableCompat;->setHotspotBounds(Landroid/graphics/drawable/Drawable;IIII)V
.line 1204
:cond_80
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->draw(Landroid/graphics/Canvas;)V
return-void
.end method
.method public drawableHotspotChanged(FF)V
.registers 5
.line 1364
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x15
if-lt v0, v1, :cond_9
.line 1365
invoke-super {p0, p1, p2}, Landroid/widget/CompoundButton;->drawableHotspotChanged(FF)V
.line 1368
:cond_9
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_10
.line 1369
invoke-static {v0, p1, p2}, Landroidx/core/graphics/drawable/DrawableCompat;->setHotspot(Landroid/graphics/drawable/Drawable;FF)V
.line 1372
:cond_10
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_17
.line 1373
invoke-static {v0, p1, p2}, Landroidx/core/graphics/drawable/DrawableCompat;->setHotspot(Landroid/graphics/drawable/Drawable;FF)V
:cond_17
return-void
.end method
.method protected drawableStateChanged()V
.registers 5
.line 1342
invoke-super {p0}, Landroid/widget/CompoundButton;->drawableStateChanged()V
.line 1344
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getDrawableState()[I
move-result-object v0
.line 1347
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
const/4 v2, 0x0
if-eqz v1, :cond_17
.line 1348
invoke-virtual {v1}, Landroid/graphics/drawable/Drawable;->isStateful()Z
move-result v3
if-eqz v3, :cond_17
.line 1349
invoke-virtual {v1, v0}, Landroid/graphics/drawable/Drawable;->setState([I)Z
move-result v1
or-int/2addr v2, v1
.line 1352
:cond_17
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v1, :cond_26
.line 1353
invoke-virtual {v1}, Landroid/graphics/drawable/Drawable;->isStateful()Z
move-result v3
if-eqz v3, :cond_26
.line 1354
invoke-virtual {v1, v0}, Landroid/graphics/drawable/Drawable;->setState([I)Z
move-result v0
or-int/2addr v2, v0
:cond_26
if-eqz v2, :cond_2b
.line 1358
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->invalidate()V
:cond_2b
return-void
.end method
.method public getCompoundPaddingLeft()I
.registers 3
.line 1274
invoke-static {p0}, Landroidx/appcompat/widget/ViewUtils;->isLayoutRtl(Landroid/view/View;)Z
move-result v0
if-nez v0, :cond_b
.line 1275
invoke-super {p0}, Landroid/widget/CompoundButton;->getCompoundPaddingLeft()I
move-result v0
return v0
.line 1277
:cond_b
invoke-super {p0}, Landroid/widget/CompoundButton;->getCompoundPaddingLeft()I
move-result v0
iget v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchWidth:I
add-int/2addr v0, v1
.line 1278
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getText()Ljava/lang/CharSequence;
move-result-object v1
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_1f
.line 1279
iget v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchPadding:I
add-int/2addr v0, v1
:cond_1f
return v0
.end method
.method public getCompoundPaddingRight()I
.registers 3
.line 1286
invoke-static {p0}, Landroidx/appcompat/widget/ViewUtils;->isLayoutRtl(Landroid/view/View;)Z
move-result v0
if-eqz v0, :cond_b
.line 1287
invoke-super {p0}, Landroid/widget/CompoundButton;->getCompoundPaddingRight()I
move-result v0
return v0
.line 1289
:cond_b
invoke-super {p0}, Landroid/widget/CompoundButton;->getCompoundPaddingRight()I
move-result v0
iget v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchWidth:I
add-int/2addr v0, v1
.line 1290
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getText()Ljava/lang/CharSequence;
move-result-object v1
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_1f
.line 1291
iget v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchPadding:I
add-int/2addr v0, v1
:cond_1f
return v0
.end method
.method public getShowText()Z
.registers 2
.line 803
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mShowText:Z
return v0
.end method
.method public getSplitTrack()Z
.registers 2
.line 744
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mSplitTrack:Z
return v0
.end method
.method public getSwitchMinWidth()I
.registers 2
.line 457
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchMinWidth:I
return v0
.end method
.method public getSwitchPadding()I
.registers 2
.line 432
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchPadding:I
return v0
.end method
.method public getTextOff()Ljava/lang/CharSequence;
.registers 2
.line 772
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOff:Ljava/lang/CharSequence;
return-object v0
.end method
.method public getTextOn()Ljava/lang/CharSequence;
.registers 2
.line 753
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOn:Ljava/lang/CharSequence;
return-object v0
.end method
.method public getThumbDrawable()Landroid/graphics/drawable/Drawable;
.registers 2
.line 641
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
return-object v0
.end method
.method public getThumbTextPadding()I
.registers 2
.line 480
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTextPadding:I
return v0
.end method
.method public getThumbTintList()Landroid/content/res/ColorStateList;
.registers 2
.line 672
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintList:Landroid/content/res/ColorStateList;
return-object v0
.end method
.method public getThumbTintMode()Landroid/graphics/PorterDuff$Mode;
.registers 2
.line 701
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintMode:Landroid/graphics/PorterDuff$Mode;
return-object v0
.end method
.method public getTrackDrawable()Landroid/graphics/drawable/Drawable;
.registers 2
.line 520
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
return-object v0
.end method
.method public getTrackTintList()Landroid/content/res/ColorStateList;
.registers 2
.line 550
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintList:Landroid/content/res/ColorStateList;
return-object v0
.end method
.method public getTrackTintMode()Landroid/graphics/PorterDuff$Mode;
.registers 2
.line 578
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintMode:Landroid/graphics/PorterDuff$Mode;
return-object v0
.end method
.method public jumpDrawablesToCurrentState()V
.registers 2
.line 1384
invoke-super {p0}, Landroid/widget/CompoundButton;->jumpDrawablesToCurrentState()V
.line 1386
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_a
.line 1387
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->jumpToCurrentState()V
.line 1390
:cond_a
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_11
.line 1391
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->jumpToCurrentState()V
.line 1394
:cond_11
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mPositionAnimator:Landroid/animation/ObjectAnimator;
if-eqz v0, :cond_23
invoke-virtual {v0}, Landroid/animation/ObjectAnimator;->isStarted()Z
move-result v0
if-eqz v0, :cond_23
.line 1395
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mPositionAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {v0}, Landroid/animation/ObjectAnimator;->end()V
const/4 v0, 0x0
.line 1396
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mPositionAnimator:Landroid/animation/ObjectAnimator;
:cond_23
return-void
.end method
.method protected onCreateDrawableState(I)[I
.registers 3
add-int/lit8 p1, p1, 0x1
.line 1333
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onCreateDrawableState(I)[I
move-result-object p1
.line 1334
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->isChecked()Z
move-result v0
if-eqz v0, :cond_11
.line 1335
sget-object v0, Landroidx/appcompat/widget/SwitchCompat;->CHECKED_STATE_SET:[I
invoke-static {p1, v0}, Landroidx/appcompat/widget/SwitchCompat;->mergeDrawableStates([I[I)[I
:cond_11
return-object p1
.end method
.method protected onDraw(Landroid/graphics/Canvas;)V
.registers 11
.line 1209
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onDraw(Landroid/graphics/Canvas;)V
.line 1211
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTempRect:Landroid/graphics/Rect;
.line 1212
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v1, :cond_d
.line 1214
invoke-virtual {v1, v0}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z
goto :goto_10
.line 1216
:cond_d
invoke-virtual {v0}, Landroid/graphics/Rect;->setEmpty()V
.line 1219
:goto_10
iget v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchTop:I
.line 1220
iget v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchBottom:I
.line 1221
iget v4, v0, Landroid/graphics/Rect;->top:I
add-int/2addr v2, v4
.line 1222
iget v4, v0, Landroid/graphics/Rect;->bottom:I
sub-int/2addr v3, v4
.line 1224
iget-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v1, :cond_4c
.line 1226
iget-boolean v5, p0, Landroidx/appcompat/widget/SwitchCompat;->mSplitTrack:Z
if-eqz v5, :cond_49
if-eqz v4, :cond_49
.line 1227
invoke-static {v4}, Landroidx/appcompat/widget/DrawableUtils;->getOpticalBounds(Landroid/graphics/drawable/Drawable;)Landroid/graphics/Rect;
move-result-object v5
.line 1228
invoke-virtual {v4, v0}, Landroid/graphics/drawable/Drawable;->copyBounds(Landroid/graphics/Rect;)V
.line 1229
iget v6, v0, Landroid/graphics/Rect;->left:I
iget v7, v5, Landroid/graphics/Rect;->left:I
add-int/2addr v6, v7
iput v6, v0, Landroid/graphics/Rect;->left:I
.line 1230
iget v6, v0, Landroid/graphics/Rect;->right:I
iget v5, v5, Landroid/graphics/Rect;->right:I
sub-int/2addr v6, v5
iput v6, v0, Landroid/graphics/Rect;->right:I
.line 1232
invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I
move-result v5
.line 1233
sget-object v6, Landroid/graphics/Region$Op;->DIFFERENCE:Landroid/graphics/Region$Op;
invoke-virtual {p1, v0, v6}, Landroid/graphics/Canvas;->clipRect(Landroid/graphics/Rect;Landroid/graphics/Region$Op;)Z
.line 1234
invoke-virtual {v1, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V
.line 1235
invoke-virtual {p1, v5}, Landroid/graphics/Canvas;->restoreToCount(I)V
goto :goto_4c
.line 1237
:cond_49
invoke-virtual {v1, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V
.line 1241
:cond_4c
:goto_4c
invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I
move-result v0
if-eqz v4, :cond_55
.line 1244
invoke-virtual {v4, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V
.line 1247
:cond_55
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->getTargetCheckedState()Z
move-result v1
if-eqz v1, :cond_5e
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mOnLayout:Landroid/text/Layout;
goto :goto_60
:cond_5e
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mOffLayout:Landroid/text/Layout;
:goto_60
if-eqz v1, :cond_a3
.line 1249
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getDrawableState()[I
move-result-object v5
.line 1250
iget-object v6, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextColors:Landroid/content/res/ColorStateList;
if-eqz v6, :cond_74
.line 1251
iget-object v7, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
const/4 v8, 0x0
invoke-virtual {v6, v5, v8}, Landroid/content/res/ColorStateList;->getColorForState([II)I
move-result v6
invoke-virtual {v7, v6}, Landroid/text/TextPaint;->setColor(I)V
.line 1253
:cond_74
iget-object v6, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
iput-object v5, v6, Landroid/text/TextPaint;->drawableState:[I
if-eqz v4, :cond_84
.line 1257
invoke-virtual {v4}, Landroid/graphics/drawable/Drawable;->getBounds()Landroid/graphics/Rect;
move-result-object v4
.line 1258
iget v5, v4, Landroid/graphics/Rect;->left:I
iget v4, v4, Landroid/graphics/Rect;->right:I
add-int/2addr v5, v4
goto :goto_88
.line 1260
:cond_84
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getWidth()I
move-result v5
.line 1263
:goto_88
div-int/lit8 v5, v5, 0x2
invoke-virtual {v1}, Landroid/text/Layout;->getWidth()I
move-result v4
div-int/lit8 v4, v4, 0x2
sub-int/2addr v5, v4
add-int/2addr v2, v3
.line 1264
div-int/lit8 v2, v2, 0x2
invoke-virtual {v1}, Landroid/text/Layout;->getHeight()I
move-result v3
div-int/lit8 v3, v3, 0x2
sub-int/2addr v2, v3
int-to-float v3, v5
int-to-float v2, v2
.line 1265
invoke-virtual {p1, v3, v2}, Landroid/graphics/Canvas;->translate(FF)V
.line 1266
invoke-virtual {v1, p1}, Landroid/text/Layout;->draw(Landroid/graphics/Canvas;)V
.line 1269
:cond_a3
invoke-virtual {p1, v0}, Landroid/graphics/Canvas;->restoreToCount(I)V
return-void
.end method
.method public onInitializeAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)V
.registers 3
.line 1402
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onInitializeAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)V
const-string v0, "android.widget.Switch"
.line 1403
invoke-virtual {p1, v0}, Landroid/view/accessibility/AccessibilityEvent;->setClassName(Ljava/lang/CharSequence;)V
return-void
.end method
.method public onInitializeAccessibilityNodeInfo(Landroid/view/accessibility/AccessibilityNodeInfo;)V
.registers 5
.line 1408
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onInitializeAccessibilityNodeInfo(Landroid/view/accessibility/AccessibilityNodeInfo;)V
const-string v0, "android.widget.Switch"
.line 1409
invoke-virtual {p1, v0}, Landroid/view/accessibility/AccessibilityNodeInfo;->setClassName(Ljava/lang/CharSequence;)V
.line 1410
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->isChecked()Z
move-result v0
if-eqz v0, :cond_11
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOn:Ljava/lang/CharSequence;
goto :goto_13
:cond_11
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOff:Ljava/lang/CharSequence;
.line 1411
:goto_13
invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_3a
.line 1412
invoke-virtual {p1}, Landroid/view/accessibility/AccessibilityNodeInfo;->getText()Ljava/lang/CharSequence;
move-result-object v1
.line 1413
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v2
if-eqz v2, :cond_27
.line 1414
invoke-virtual {p1, v0}, Landroid/view/accessibility/AccessibilityNodeInfo;->setText(Ljava/lang/CharSequence;)V
goto :goto_3a
.line 1416
:cond_27
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
.line 1417
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/CharSequence;)Ljava/lang/StringBuilder;
const/16 v1, 0x20
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/CharSequence;)Ljava/lang/StringBuilder;
.line 1418
invoke-virtual {p1, v2}, Landroid/view/accessibility/AccessibilityNodeInfo;->setText(Ljava/lang/CharSequence;)V
:cond_3a
:goto_3a
return-void
.end method
.method protected onLayout(ZIIII)V
.registers 6
.line 1088
invoke-super/range {p0 .. p5}, Landroid/widget/CompoundButton;->onLayout(ZIIII)V
.line 1092
iget-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
const/4 p2, 0x0
if-eqz p1, :cond_2e
.line 1093
iget-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTempRect:Landroid/graphics/Rect;
.line 1094
iget-object p3, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz p3, :cond_12
.line 1095
invoke-virtual {p3, p1}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z
goto :goto_15
.line 1097
:cond_12
invoke-virtual {p1}, Landroid/graphics/Rect;->setEmpty()V
.line 1100
:goto_15
iget-object p3, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
invoke-static {p3}, Landroidx/appcompat/widget/DrawableUtils;->getOpticalBounds(Landroid/graphics/drawable/Drawable;)Landroid/graphics/Rect;
move-result-object p3
.line 1101
iget p4, p3, Landroid/graphics/Rect;->left:I
iget p5, p1, Landroid/graphics/Rect;->left:I
sub-int/2addr p4, p5
invoke-static {p2, p4}, Ljava/lang/Math;->max(II)I
move-result p4
.line 1102
iget p3, p3, Landroid/graphics/Rect;->right:I
iget p1, p1, Landroid/graphics/Rect;->right:I
sub-int/2addr p3, p1
invoke-static {p2, p3}, Ljava/lang/Math;->max(II)I
move-result p2
goto :goto_2f
:cond_2e
const/4 p4, 0x0
.line 1107
:goto_2f
invoke-static {p0}, Landroidx/appcompat/widget/ViewUtils;->isLayoutRtl(Landroid/view/View;)Z
move-result p1
if-eqz p1, :cond_40
.line 1108
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getPaddingLeft()I
move-result p1
add-int/2addr p1, p4
.line 1109
iget p3, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchWidth:I
add-int/2addr p3, p1
sub-int/2addr p3, p4
sub-int/2addr p3, p2
goto :goto_51
.line 1111
:cond_40
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getWidth()I
move-result p1
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getPaddingRight()I
move-result p3
sub-int/2addr p1, p3
sub-int p3, p1, p2
.line 1112
iget p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchWidth:I
sub-int p1, p3, p1
add-int/2addr p1, p4
add-int/2addr p1, p2
.line 1117
:goto_51
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getGravity()I
move-result p2
and-int/lit8 p2, p2, 0x70
const/16 p4, 0x10
if-eq p2, p4, :cond_75
const/16 p4, 0x50
if-eq p2, p4, :cond_66
.line 1120
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getPaddingTop()I
move-result p2
.line 1121
iget p4, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchHeight:I
goto :goto_8a
.line 1131
:cond_66
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getHeight()I
move-result p2
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getPaddingBottom()I
move-result p4
sub-int p4, p2, p4
.line 1132
iget p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchHeight:I
sub-int p2, p4, p2
goto :goto_8b
.line 1125
:cond_75
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getPaddingTop()I
move-result p2
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getHeight()I
move-result p4
add-int/2addr p2, p4
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getPaddingBottom()I
move-result p4
sub-int/2addr p2, p4
div-int/lit8 p2, p2, 0x2
iget p4, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchHeight:I
div-int/lit8 p5, p4, 0x2
sub-int/2addr p2, p5
:goto_8a
add-int/2addr p4, p2
.line 1136
:goto_8b
iput p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchLeft:I
.line 1137
iput p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchTop:I
.line 1138
iput p4, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchBottom:I
.line 1139
iput p3, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchRight:I
return-void
.end method
.method public onMeasure(II)V
.registers 9
.line 808
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mShowText:Z
if-eqz v0, :cond_1c
.line 809
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mOnLayout:Landroid/text/Layout;
if-nez v0, :cond_10
.line 810
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOn:Ljava/lang/CharSequence;
invoke-direct {p0, v0}, Landroidx/appcompat/widget/SwitchCompat;->makeLayout(Ljava/lang/CharSequence;)Landroid/text/Layout;
move-result-object v0
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mOnLayout:Landroid/text/Layout;
.line 813
:cond_10
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mOffLayout:Landroid/text/Layout;
if-nez v0, :cond_1c
.line 814
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOff:Ljava/lang/CharSequence;
invoke-direct {p0, v0}, Landroidx/appcompat/widget/SwitchCompat;->makeLayout(Ljava/lang/CharSequence;)Landroid/text/Layout;
move-result-object v0
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mOffLayout:Landroid/text/Layout;
.line 818
:cond_1c
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTempRect:Landroid/graphics/Rect;
.line 821
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
const/4 v2, 0x0
if-eqz v1, :cond_39
.line 823
invoke-virtual {v1, v0}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z
.line 824
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
invoke-virtual {v1}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I
move-result v1
iget v3, v0, Landroid/graphics/Rect;->left:I
sub-int/2addr v1, v3
iget v3, v0, Landroid/graphics/Rect;->right:I
sub-int/2addr v1, v3
.line 825
iget-object v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
invoke-virtual {v3}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I
move-result v3
goto :goto_3b
:cond_39
const/4 v1, 0x0
const/4 v3, 0x0
.line 832
:goto_3b
iget-boolean v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mShowText:Z
if-eqz v4, :cond_55
.line 833
iget-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mOnLayout:Landroid/text/Layout;
invoke-virtual {v4}, Landroid/text/Layout;->getWidth()I
move-result v4
iget-object v5, p0, Landroidx/appcompat/widget/SwitchCompat;->mOffLayout:Landroid/text/Layout;
invoke-virtual {v5}, Landroid/text/Layout;->getWidth()I
move-result v5
invoke-static {v4, v5}, Ljava/lang/Math;->max(II)I
move-result v4
iget v5, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTextPadding:I
mul-int/lit8 v5, v5, 0x2
add-int/2addr v4, v5
goto :goto_56
:cond_55
const/4 v4, 0x0
.line 839
:goto_56
invoke-static {v4, v1}, Ljava/lang/Math;->max(II)I
move-result v1
iput v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbWidth:I
.line 842
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v1, :cond_6a
.line 843
invoke-virtual {v1, v0}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z
.line 844
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
invoke-virtual {v1}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I
move-result v2
goto :goto_6d
.line 846
:cond_6a
invoke-virtual {v0}, Landroid/graphics/Rect;->setEmpty()V
.line 852
:goto_6d
iget v1, v0, Landroid/graphics/Rect;->left:I
.line 853
iget v0, v0, Landroid/graphics/Rect;->right:I
.line 854
iget-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v4, :cond_85
.line 855
invoke-static {v4}, Landroidx/appcompat/widget/DrawableUtils;->getOpticalBounds(Landroid/graphics/drawable/Drawable;)Landroid/graphics/Rect;
move-result-object v4
.line 856
iget v5, v4, Landroid/graphics/Rect;->left:I
invoke-static {v1, v5}, Ljava/lang/Math;->max(II)I
move-result v1
.line 857
iget v4, v4, Landroid/graphics/Rect;->right:I
invoke-static {v0, v4}, Ljava/lang/Math;->max(II)I
move-result v0
.line 860
:cond_85
iget v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchMinWidth:I
iget v5, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbWidth:I
mul-int/lit8 v5, v5, 0x2
add-int/2addr v5, v1
add-int/2addr v5, v0
invoke-static {v4, v5}, Ljava/lang/Math;->max(II)I
move-result v0
.line 862
invoke-static {v2, v3}, Ljava/lang/Math;->max(II)I
move-result v1
.line 863
iput v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchWidth:I
.line 864
iput v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchHeight:I
.line 866
invoke-super {p0, p1, p2}, Landroid/widget/CompoundButton;->onMeasure(II)V
.line 868
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getMeasuredHeight()I
move-result p1
if-ge p1, v1, :cond_a9
.line 870
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getMeasuredWidthAndState()I
move-result p1
invoke-virtual {p0, p1, v1}, Landroidx/appcompat/widget/SwitchCompat;->setMeasuredDimension(II)V
:cond_a9
return-void
.end method
.method public onPopulateAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)V
.registers 3
.line 876
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onPopulateAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)V
.line 878
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->isChecked()Z
move-result v0
if-eqz v0, :cond_c
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOn:Ljava/lang/CharSequence;
goto :goto_e
:cond_c
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOff:Ljava/lang/CharSequence;
:goto_e
if-eqz v0, :cond_17
.line 880
invoke-virtual {p1}, Landroid/view/accessibility/AccessibilityEvent;->getText()Ljava/util/List;
move-result-object p1
invoke-interface {p1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
:cond_17
return-void
.end method
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
.registers 8
.line 917
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mVelocityTracker:Landroid/view/VelocityTracker;
invoke-virtual {v0, p1}, Landroid/view/VelocityTracker;->addMovement(Landroid/view/MotionEvent;)V
.line 918
invoke-virtual {p1}, Landroid/view/MotionEvent;->getActionMasked()I
move-result v0
const/4 v1, 0x1
if-eqz v0, :cond_9f
const/4 v2, 0x2
if-eq v0, v1, :cond_8b
if-eq v0, v2, :cond_16
const/4 v3, 0x3
if-eq v0, v3, :cond_8b
goto/16 :goto_b9
.line 932
:cond_16
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchMode:I
if-eq v0, v1, :cond_57
if-eq v0, v2, :cond_1e
goto/16 :goto_b9
.line 952
:cond_1e
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result p1
.line 953
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->getThumbScrollRange()I
move-result v0
.line 954
iget v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchX:F
sub-float v2, p1, v2
const/high16 v3, 0x3f800000 # 1.0f
const/4 v4, 0x0
if-eqz v0, :cond_32
int-to-float v0, v0
div-float/2addr v2, v0
goto :goto_3d
:cond_32
cmpl-float v0, v2, v4
if-lez v0, :cond_39
const/high16 v2, 0x3f800000 # 1.0f
goto :goto_3d
:cond_39
const/high16 v0, -0x40800000 # -1.0f
const/high16 v2, -0x40800000 # -1.0f
.line 963
:goto_3d
invoke-static {p0}, Landroidx/appcompat/widget/ViewUtils;->isLayoutRtl(Landroid/view/View;)Z
move-result v0
if-eqz v0, :cond_44
neg-float v2, v2
.line 966
:cond_44
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbPosition:F
add-float/2addr v0, v2
invoke-static {v0, v4, v3}, Landroidx/appcompat/widget/SwitchCompat;->constrain(FFF)F
move-result v0
.line 967
iget v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbPosition:F
cmpl-float v2, v0, v2
if-eqz v2, :cond_56
.line 968
iput p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchX:F
.line 969
invoke-virtual {p0, v0}, Landroidx/appcompat/widget/SwitchCompat;->setThumbPosition(F)V
:cond_56
return v1
.line 938
:cond_57
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result v0
.line 939
invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F
move-result v3
.line 940
iget v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchX:F
sub-float v4, v0, v4
invoke-static {v4}, Ljava/lang/Math;->abs(F)F
move-result v4
iget v5, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchSlop:I
int-to-float v5, v5
cmpl-float v4, v4, v5
if-gtz v4, :cond_7d
iget v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchY:F
sub-float v4, v3, v4
.line 941
invoke-static {v4}, Ljava/lang/Math;->abs(F)F
move-result v4
iget v5, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchSlop:I
int-to-float v5, v5
cmpl-float v4, v4, v5
if-lez v4, :cond_b9
.line 942
:cond_7d
iput v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchMode:I
.line 943
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getParent()Landroid/view/ViewParent;
move-result-object p1
invoke-interface {p1, v1}, Landroid/view/ViewParent;->requestDisallowInterceptTouchEvent(Z)V
.line 944
iput v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchX:F
.line 945
iput v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchY:F
return v1
.line 979
:cond_8b
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchMode:I
if-ne v0, v2, :cond_96
.line 980
invoke-direct {p0, p1}, Landroidx/appcompat/widget/SwitchCompat;->stopDrag(Landroid/view/MotionEvent;)V
.line 982
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onTouchEvent(Landroid/view/MotionEvent;)Z
return v1
:cond_96
const/4 v0, 0x0
.line 985
iput v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchMode:I
.line 986
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mVelocityTracker:Landroid/view/VelocityTracker;
invoke-virtual {v0}, Landroid/view/VelocityTracker;->clear()V
goto :goto_b9
.line 921
:cond_9f
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result v0
.line 922
invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F
move-result v2
.line 923
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->isEnabled()Z
move-result v3
if-eqz v3, :cond_b9
invoke-direct {p0, v0, v2}, Landroidx/appcompat/widget/SwitchCompat;->hitThumb(FF)Z
move-result v3
if-eqz v3, :cond_b9
.line 924
iput v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchMode:I
.line 925
iput v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchX:F
.line 926
iput v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchY:F
.line 991
:cond_b9
:goto_b9
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onTouchEvent(Landroid/view/MotionEvent;)Z
move-result p1
return p1
.end method
.method public setChecked(Z)V
.registers 3
.line 1071
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->setChecked(Z)V
.line 1075
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->isChecked()Z
move-result p1
.line 1077
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getWindowToken()Landroid/os/IBinder;
move-result-object v0
if-eqz v0, :cond_17
invoke-static {p0}, Landroidx/core/view/ViewCompat;->isLaidOut(Landroid/view/View;)Z
move-result v0
if-eqz v0, :cond_17
.line 1078
invoke-direct {p0, p1}, Landroidx/appcompat/widget/SwitchCompat;->animateThumbToCheckedState(Z)V
goto :goto_23
.line 1081
:cond_17
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->cancelPositionAnimator()V
if-eqz p1, :cond_1f
const/high16 p1, 0x3f800000 # 1.0f
goto :goto_20
:cond_1f
const/4 p1, 0x0
.line 1082
:goto_20
invoke-virtual {p0, p1}, Landroidx/appcompat/widget/SwitchCompat;->setThumbPosition(F)V
:goto_23
return-void
.end method
.method public setCustomSelectionActionModeCallback(Landroid/view/ActionMode$Callback;)V
.registers 2
.line 1430
invoke-static {p0, p1}, Landroidx/core/widget/TextViewCompat;->wrapCustomSelectionActionModeCallback(Landroid/widget/TextView;Landroid/view/ActionMode$Callback;)Landroid/view/ActionMode$Callback;
move-result-object p1
.line 1429
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->setCustomSelectionActionModeCallback(Landroid/view/ActionMode$Callback;)V
return-void
.end method
.method public setShowText(Z)V
.registers 3
.line 792
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mShowText:Z
if-eq v0, p1, :cond_9
.line 793
iput-boolean p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mShowText:Z
.line 794
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->requestLayout()V
:cond_9
return-void
.end method
.method public setSplitTrack(Z)V
.registers 2
.line 734
iput-boolean p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSplitTrack:Z
.line 735
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->invalidate()V
return-void
.end method
.method public setSwitchMinWidth(I)V
.registers 2
.line 444
iput p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchMinWidth:I
.line 445
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->requestLayout()V
return-void
.end method
.method public setSwitchPadding(I)V
.registers 2
.line 420
iput p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchPadding:I
.line 421
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->requestLayout()V
return-void
.end method
.method public setSwitchTextAppearance(Landroid/content/Context;I)V
.registers 6
.line 311
sget-object v0, Landroidx/appcompat/R$styleable;->TextAppearance:[I
invoke-static {p1, p2, v0}, Landroidx/appcompat/widget/TintTypedArray;->obtainStyledAttributes(Landroid/content/Context;I[I)Landroidx/appcompat/widget/TintTypedArray;
move-result-object p1
.line 317
sget p2, Landroidx/appcompat/R$styleable;->TextAppearance_android_textColor:I
invoke-virtual {p1, p2}, Landroidx/appcompat/widget/TintTypedArray;->getColorStateList(I)Landroid/content/res/ColorStateList;
move-result-object p2
if-eqz p2, :cond_11
.line 319
iput-object p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextColors:Landroid/content/res/ColorStateList;
goto :goto_17
.line 322
:cond_11
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getTextColors()Landroid/content/res/ColorStateList;
move-result-object p2
iput-object p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextColors:Landroid/content/res/ColorStateList;
.line 325
:goto_17
sget p2, Landroidx/appcompat/R$styleable;->TextAppearance_android_textSize:I
const/4 v0, 0x0
invoke-virtual {p1, p2, v0}, Landroidx/appcompat/widget/TintTypedArray;->getDimensionPixelSize(II)I
move-result p2
if-eqz p2, :cond_33
int-to-float p2, p2
.line 327
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
invoke-virtual {v1}, Landroid/text/TextPaint;->getTextSize()F
move-result v1
cmpl-float v1, p2, v1
if-eqz v1, :cond_33
.line 328
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
invoke-virtual {v1, p2}, Landroid/text/TextPaint;->setTextSize(F)V
.line 329
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->requestLayout()V
.line 334
:cond_33
sget p2, Landroidx/appcompat/R$styleable;->TextAppearance_android_typeface:I
const/4 v1, -0x1
invoke-virtual {p1, p2, v1}, Landroidx/appcompat/widget/TintTypedArray;->getInt(II)I
move-result p2
.line 335
sget v2, Landroidx/appcompat/R$styleable;->TextAppearance_android_textStyle:I
invoke-virtual {p1, v2, v1}, Landroidx/appcompat/widget/TintTypedArray;->getInt(II)I
move-result v1
.line 337
invoke-direct {p0, p2, v1}, Landroidx/appcompat/widget/SwitchCompat;->setSwitchTypefaceByIndex(II)V
.line 339
sget p2, Landroidx/appcompat/R$styleable;->TextAppearance_textAllCaps:I
invoke-virtual {p1, p2, v0}, Landroidx/appcompat/widget/TintTypedArray;->getBoolean(IZ)Z
move-result p2
if-eqz p2, :cond_57
.line 341
new-instance p2, Landroidx/appcompat/text/AllCapsTransformationMethod;
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getContext()Landroid/content/Context;
move-result-object v0
invoke-direct {p2, v0}, Landroidx/appcompat/text/AllCapsTransformationMethod;-><init>(Landroid/content/Context;)V
iput-object p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchTransformationMethod:Landroid/text/method/TransformationMethod;
goto :goto_5a
:cond_57
const/4 p2, 0x0
.line 343
iput-object p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchTransformationMethod:Landroid/text/method/TransformationMethod;
.line 346
:goto_5a
invoke-virtual {p1}, Landroidx/appcompat/widget/TintTypedArray;->recycle()V
return-void
.end method
.method public setSwitchTypeface(Landroid/graphics/Typeface;)V
.registers 3
.line 403
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
invoke-virtual {v0}, Landroid/text/TextPaint;->getTypeface()Landroid/graphics/Typeface;
move-result-object v0
if-eqz v0, :cond_14
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
invoke-virtual {v0}, Landroid/text/TextPaint;->getTypeface()Landroid/graphics/Typeface;
move-result-object v0
invoke-virtual {v0, p1}, Landroid/graphics/Typeface;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_1e
:cond_14
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
.line 404
invoke-virtual {v0}, Landroid/text/TextPaint;->getTypeface()Landroid/graphics/Typeface;
move-result-object v0
if-nez v0, :cond_29
if-eqz p1, :cond_29
.line 405
:cond_1e
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
invoke-virtual {v0, p1}, Landroid/text/TextPaint;->setTypeface(Landroid/graphics/Typeface;)Landroid/graphics/Typeface;
.line 407
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->requestLayout()V
.line 408
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->invalidate()V
:cond_29
return-void
.end method
.method public setSwitchTypeface(Landroid/graphics/Typeface;I)V
.registers 6
const/4 v0, 0x0
const/4 v1, 0x0
if-lez p2, :cond_32
if-nez p1, :cond_b
.line 377
invoke-static {p2}, Landroid/graphics/Typeface;->defaultFromStyle(I)Landroid/graphics/Typeface;
move-result-object p1
goto :goto_f
.line 379
:cond_b
invoke-static {p1, p2}, Landroid/graphics/Typeface;->create(Landroid/graphics/Typeface;I)Landroid/graphics/Typeface;
move-result-object p1
.line 382
:goto_f
invoke-virtual {p0, p1}, Landroidx/appcompat/widget/SwitchCompat;->setSwitchTypeface(Landroid/graphics/Typeface;)V
if-eqz p1, :cond_19
.line 384
invoke-virtual {p1}, Landroid/graphics/Typeface;->getStyle()I
move-result p1
goto :goto_1a
:cond_19
const/4 p1, 0x0
:goto_1a
not-int p1, p1
and-int/2addr p1, p2
.line 386
iget-object p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
and-int/lit8 v2, p1, 0x1
if-eqz v2, :cond_23
const/4 v1, 0x1
:cond_23
invoke-virtual {p2, v1}, Landroid/text/TextPaint;->setFakeBoldText(Z)V
.line 387
iget-object p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
and-int/lit8 p1, p1, 0x2
if-eqz p1, :cond_2e
const/high16 v0, -0x41800000 # -0.25f
:cond_2e
invoke-virtual {p2, v0}, Landroid/text/TextPaint;->setTextSkewX(F)V
goto :goto_3f
.line 389
:cond_32
iget-object p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
invoke-virtual {p2, v1}, Landroid/text/TextPaint;->setFakeBoldText(Z)V
.line 390
iget-object p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
invoke-virtual {p2, v0}, Landroid/text/TextPaint;->setTextSkewX(F)V
.line 391
invoke-virtual {p0, p1}, Landroidx/appcompat/widget/SwitchCompat;->setSwitchTypeface(Landroid/graphics/Typeface;)V
:goto_3f
return-void
.end method
.method public setTextOff(Ljava/lang/CharSequence;)V
.registers 2
.line 781
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOff:Ljava/lang/CharSequence;
.line 782
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->requestLayout()V
return-void
.end method
.method public setTextOn(Ljava/lang/CharSequence;)V
.registers 2
.line 762
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOn:Ljava/lang/CharSequence;
.line 763
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->requestLayout()V
return-void
.end method
.method public setThumbDrawable(Landroid/graphics/drawable/Drawable;)V
.registers 4
.line 610
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_8
const/4 v1, 0x0
.line 611
invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V
.line 613
:cond_8
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz p1, :cond_f
.line 615
invoke-virtual {p1, p0}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V
.line 617
:cond_f
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->requestLayout()V
return-void
.end method
.method setThumbPosition(F)V
.registers 2
.line 1060
iput p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbPosition:F
.line 1061
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->invalidate()V
return-void
.end method
.method public setThumbResource(I)V
.registers 3
.line 629
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getContext()Landroid/content/Context;
move-result-object v0
invoke-static {v0, p1}, Landroidx/appcompat/content/res/AppCompatResources;->getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
move-result-object p1
invoke-virtual {p0, p1}, Landroidx/appcompat/widget/SwitchCompat;->setThumbDrawable(Landroid/graphics/drawable/Drawable;)V
return-void
.end method
.method public setThumbTextPadding(I)V
.registers 2
.line 468
iput p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTextPadding:I
.line 469
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->requestLayout()V
return-void
.end method
.method public setThumbTintList(Landroid/content/res/ColorStateList;)V
.registers 2
.line 659
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintList:Landroid/content/res/ColorStateList;
const/4 p1, 0x1
.line 660
iput-boolean p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTint:Z
.line 662
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->applyThumbTint()V
return-void
.end method
.method public setThumbTintMode(Landroid/graphics/PorterDuff$Mode;)V
.registers 2
.line 687
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintMode:Landroid/graphics/PorterDuff$Mode;
const/4 p1, 0x1
.line 688
iput-boolean p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTintMode:Z
.line 690
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->applyThumbTint()V
return-void
.end method
.method public setTrackDrawable(Landroid/graphics/drawable/Drawable;)V
.registers 4
.line 491
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_8
const/4 v1, 0x0
.line 492
invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V
.line 494
:cond_8
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz p1, :cond_f
.line 496
invoke-virtual {p1, p0}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V
.line 498
:cond_f
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->requestLayout()V
return-void
.end method
.method public setTrackResource(I)V
.registers 3
.line 509
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->getContext()Landroid/content/Context;
move-result-object v0
invoke-static {v0, p1}, Landroidx/appcompat/content/res/AppCompatResources;->getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
move-result-object p1
invoke-virtual {p0, p1}, Landroidx/appcompat/widget/SwitchCompat;->setTrackDrawable(Landroid/graphics/drawable/Drawable;)V
return-void
.end method
.method public setTrackTintList(Landroid/content/res/ColorStateList;)V
.registers 2
.line 537
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintList:Landroid/content/res/ColorStateList;
const/4 p1, 0x1
.line 538
iput-boolean p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTint:Z
.line 540
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->applyTrackTint()V
return-void
.end method
.method public setTrackTintMode(Landroid/graphics/PorterDuff$Mode;)V
.registers 2
.line 564
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintMode:Landroid/graphics/PorterDuff$Mode;
const/4 p1, 0x1
.line 565
iput-boolean p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTintMode:Z
.line 567
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->applyTrackTint()V
return-void
.end method
.method public toggle()V
.registers 2
.line 1066
invoke-virtual {p0}, Landroidx/appcompat/widget/SwitchCompat;->isChecked()Z
move-result v0
xor-int/lit8 v0, v0, 0x1
invoke-virtual {p0, v0}, Landroidx/appcompat/widget/SwitchCompat;->setChecked(Z)V
return-void
.end method
.method protected verifyDrawable(Landroid/graphics/drawable/Drawable;)Z
.registers 3
.line 1379
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->verifyDrawable(Landroid/graphics/drawable/Drawable;)Z
move-result v0
if-nez v0, :cond_11
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eq p1, v0, :cond_11
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-ne p1, v0, :cond_f
goto :goto_11
:cond_f
const/4 p1, 0x0
goto :goto_12
:cond_11
:goto_11
const/4 p1, 0x1
:goto_12
return p1
.end method