apkfuckery/com.discord/smali/androidx/appcompat/widget/SwitchCompat.smali

3047 lines
80 KiB
Smali
Raw Normal View History

2019-07-24 11:27:29 +00:00
.class public Landroidx/appcompat/widget/SwitchCompat;
.super Landroid/widget/CompoundButton;
.source "SwitchCompat.java"
# static fields
2019-12-06 03:29:40 +00:00
.field public static final ACCESSIBILITY_EVENT_CLASS_NAME:Ljava/lang/String; = "android.widget.Switch"
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final CHECKED_STATE_SET:[I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final MONOSPACE:I = 0x3
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final SANS:I = 0x1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final SERIF:I = 0x2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final THUMB_ANIMATION_DURATION:I = 0xfa
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final THUMB_POS:Landroid/util/Property;
2019-07-24 11:27:29 +00:00
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroid/util/Property<",
"Landroidx/appcompat/widget/SwitchCompat;",
"Ljava/lang/Float;",
">;"
}
.end annotation
.end field
2019-12-06 03:29:40 +00:00
.field public static final TOUCH_MODE_DOWN:I = 0x1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final TOUCH_MODE_DRAGGING:I = 0x2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final TOUCH_MODE_IDLE:I
2019-07-24 11:27:29 +00:00
# instance fields
2019-12-06 03:29:40 +00:00
.field public mHasThumbTint:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mHasThumbTintMode:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mHasTrackTint:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mHasTrackTintMode:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mMinFlingVelocity:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mOffLayout:Landroid/text/Layout;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mOnLayout:Landroid/text/Layout;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mPositionAnimator:Landroid/animation/ObjectAnimator;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mShowText:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mSplitTrack:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mSwitchBottom:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mSwitchHeight:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mSwitchLeft:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mSwitchMinWidth:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mSwitchPadding:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mSwitchRight:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mSwitchTop:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mSwitchTransformationMethod:Landroid/text/method/TransformationMethod;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mSwitchWidth:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final mTempRect:Landroid/graphics/Rect;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mTextColors:Landroid/content/res/ColorStateList;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final mTextHelper:Landroidx/appcompat/widget/AppCompatTextHelper;
2019-11-15 02:21:15 +00:00
2019-12-06 03:29:40 +00:00
.field public mTextOff:Ljava/lang/CharSequence;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mTextOn:Ljava/lang/CharSequence;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final mTextPaint:Landroid/text/TextPaint;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mThumbDrawable:Landroid/graphics/drawable/Drawable;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mThumbPosition:F
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mThumbTextPadding:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mThumbTintList:Landroid/content/res/ColorStateList;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mThumbTintMode:Landroid/graphics/PorterDuff$Mode;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mThumbWidth:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mTouchMode:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mTouchSlop:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mTouchX:F
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mTouchY:F
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mTrackDrawable:Landroid/graphics/drawable/Drawable;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mTrackTintList:Landroid/content/res/ColorStateList;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mTrackTintMode:Landroid/graphics/PorterDuff$Mode;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mVelocityTracker:Landroid/view/VelocityTracker;
2019-07-24 11:27:29 +00:00
# direct methods
2019-12-06 03:29:40 +00:00
.method public static constructor <clinit>()V
2019-07-24 11:27:29 +00:00
.locals 3
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
sput-object v0, Landroidx/appcompat/widget/SwitchCompat;->CHECKED_STATE_SET:[I
return-void
.end method
.method public constructor <init>(Landroid/content/Context;)V
.locals 1
const/4 v0, 0x0
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
.locals 1
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
2019-11-15 02:21:15 +00:00
.locals 7
2019-07-24 11:27:29 +00:00
invoke-direct {p0, p1, p2, p3}, Landroid/widget/CompoundButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
const/4 v0, 0x0
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintList:Landroid/content/res/ColorStateList;
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintMode:Landroid/graphics/PorterDuff$Mode;
const/4 v1, 0x0
iput-boolean v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTint:Z
iput-boolean v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTintMode:Z
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintList:Landroid/content/res/ColorStateList;
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintMode:Landroid/graphics/PorterDuff$Mode;
iput-boolean v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTint:Z
iput-boolean v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTintMode:Z
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;
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;
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;
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getResources()Landroid/content/res/Resources;
2019-07-24 11:27:29 +00:00
move-result-object v2
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
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;
2019-11-15 02:21:15 +00:00
move-result-object v2
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_android_thumb:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v2, v4}, Landroidx/appcompat/widget/TintTypedArray;->getDrawable(I)Landroid/graphics/drawable/Drawable;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result-object v4
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iput-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iget-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
if-eqz v4, :cond_0
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v4, p0}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V
2019-07-24 11:27:29 +00:00
:cond_0
2019-11-15 02:21:15 +00:00
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_track:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v2, v4}, Landroidx/appcompat/widget/TintTypedArray;->getDrawable(I)Landroid/graphics/drawable/Drawable;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result-object v4
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iput-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iget-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
if-eqz v4, :cond_1
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v4, p0}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V
2019-07-24 11:27:29 +00:00
:cond_1
2019-11-15 02:21:15 +00:00
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_android_textOn:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v2, v4}, Landroidx/appcompat/widget/TintTypedArray;->getText(I)Ljava/lang/CharSequence;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result-object v4
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iput-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOn:Ljava/lang/CharSequence;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_android_textOff:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v2, v4}, Landroidx/appcompat/widget/TintTypedArray;->getText(I)Ljava/lang/CharSequence;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result-object v4
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iput-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOff:Ljava/lang/CharSequence;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_showText:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v2, v4, v3}, Landroidx/appcompat/widget/TintTypedArray;->getBoolean(IZ)Z
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result v4
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iput-boolean v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mShowText:Z
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_thumbTextPadding:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v2, v4, v1}, Landroidx/appcompat/widget/TintTypedArray;->getDimensionPixelSize(II)I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result v4
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iput v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTextPadding:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_switchMinWidth:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v2, v4, v1}, Landroidx/appcompat/widget/TintTypedArray;->getDimensionPixelSize(II)I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result v4
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iput v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchMinWidth:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_switchPadding:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v2, v4, v1}, Landroidx/appcompat/widget/TintTypedArray;->getDimensionPixelSize(II)I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result v4
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iput v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchPadding:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_splitTrack:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v2, v4, v1}, Landroidx/appcompat/widget/TintTypedArray;->getBoolean(IZ)Z
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result v4
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iput-boolean v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mSplitTrack:Z
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_thumbTint:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v2, v4}, Landroidx/appcompat/widget/TintTypedArray;->getColorStateList(I)Landroid/content/res/ColorStateList;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result-object v4
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
if-eqz v4, :cond_2
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iput-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintList:Landroid/content/res/ColorStateList;
2019-07-24 11:27:29 +00:00
iput-boolean v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTint:Z
:cond_2
2019-11-15 02:21:15 +00:00
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_thumbTintMode:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
const/4 v5, -0x1
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v2, v4, v5}, Landroidx/appcompat/widget/TintTypedArray;->getInt(II)I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result v4
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-static {v4, v0}, Landroidx/appcompat/widget/DrawableUtils;->parseTintMode(ILandroid/graphics/PorterDuff$Mode;)Landroid/graphics/PorterDuff$Mode;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result-object v4
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iget-object v6, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintMode:Landroid/graphics/PorterDuff$Mode;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
if-eq v6, v4, :cond_3
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iput-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintMode:Landroid/graphics/PorterDuff$Mode;
2019-07-24 11:27:29 +00:00
iput-boolean v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTintMode:Z
:cond_3
2019-11-15 02:21:15 +00:00
iget-boolean v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTint:Z
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
if-nez v4, :cond_4
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iget-boolean v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTintMode:Z
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
if-eqz v4, :cond_5
2019-07-24 11:27:29 +00:00
:cond_4
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->applyThumbTint()V
:cond_5
2019-11-15 02:21:15 +00:00
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_trackTint:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v2, v4}, Landroidx/appcompat/widget/TintTypedArray;->getColorStateList(I)Landroid/content/res/ColorStateList;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result-object v4
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
if-eqz v4, :cond_6
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iput-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintList:Landroid/content/res/ColorStateList;
2019-07-24 11:27:29 +00:00
iput-boolean v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTint:Z
:cond_6
2019-11-15 02:21:15 +00:00
sget v4, Landroidx/appcompat/R$styleable;->SwitchCompat_trackTintMode:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v2, v4, v5}, Landroidx/appcompat/widget/TintTypedArray;->getInt(II)I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result v4
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-static {v4, v0}, Landroidx/appcompat/widget/DrawableUtils;->parseTintMode(ILandroid/graphics/PorterDuff$Mode;)Landroid/graphics/PorterDuff$Mode;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result-object v0
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iget-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintMode:Landroid/graphics/PorterDuff$Mode;
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
if-eq v4, v0, :cond_7
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintMode:Landroid/graphics/PorterDuff$Mode;
2019-07-24 11:27:29 +00:00
iput-boolean v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTintMode:Z
:cond_7
2019-11-15 02:21:15 +00:00
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTint:Z
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
if-nez v0, :cond_8
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTintMode:Z
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
if-eqz v0, :cond_9
2019-07-24 11:27:29 +00:00
:cond_8
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->applyTrackTint()V
:cond_9
2019-11-15 02:21:15 +00:00
sget v0, Landroidx/appcompat/R$styleable;->SwitchCompat_switchTextAppearance:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v2, v0, v1}, Landroidx/appcompat/widget/TintTypedArray;->getResourceId(II)I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
move-result v0
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
if-eqz v0, :cond_a
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {p0, p1, v0}, Landroidx/appcompat/widget/SwitchCompat;->setSwitchTextAppearance(Landroid/content/Context;I)V
2019-07-24 11:27:29 +00:00
:cond_a
2019-11-15 02:21:15 +00:00
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;
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextHelper:Landroidx/appcompat/widget/AppCompatTextHelper;
invoke-virtual {v0, p2, p3}, Landroidx/appcompat/widget/AppCompatTextHelper;->loadFromAttributes(Landroid/util/AttributeSet;I)V
invoke-virtual {v2}, Landroidx/appcompat/widget/TintTypedArray;->recycle()V
2019-07-24 11:27:29 +00:00
invoke-static {p1}, Landroid/view/ViewConfiguration;->get(Landroid/content/Context;)Landroid/view/ViewConfiguration;
move-result-object p1
invoke-virtual {p1}, Landroid/view/ViewConfiguration;->getScaledTouchSlop()I
move-result p2
iput p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchSlop:I
invoke-virtual {p1}, Landroid/view/ViewConfiguration;->getScaledMinimumFlingVelocity()I
move-result p1
iput p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mMinFlingVelocity:I
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->refreshDrawableState()V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->isChecked()Z
2019-07-24 11:27:29 +00:00
move-result p1
invoke-virtual {p0, p1}, Landroidx/appcompat/widget/SwitchCompat;->setChecked(Z)V
return-void
.end method
.method private animateThumbToCheckedState(Z)V
.locals 4
if-eqz p1, :cond_0
const/high16 p1, 0x3f800000 # 1.0f
goto :goto_0
:cond_0
const/4 p1, 0x0
:goto_0
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;
iget-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mPositionAnimator:Landroid/animation/ObjectAnimator;
const-wide/16 v2, 0xfa
invoke-virtual {p1, v2, v3}, Landroid/animation/ObjectAnimator;->setDuration(J)Landroid/animation/ObjectAnimator;
sget p1, Landroid/os/Build$VERSION;->SDK_INT:I
iget-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mPositionAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {p1, v1}, Landroid/animation/ObjectAnimator;->setAutoCancel(Z)V
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
.locals 2
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_3
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTint:Z
if-nez v0, :cond_0
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTintMode:Z
if-eqz v0, :cond_3
:cond_0
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
2019-11-15 02:21:15 +00:00
invoke-static {v0}, Landroidx/core/graphics/drawable/DrawableCompat;->wrap(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;
move-result-object v0
2019-07-24 11:27:29 +00:00
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;
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTint:Z
if-eqz v0, :cond_1
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
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
:cond_1
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTintMode:Z
if-eqz v0, :cond_2
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
:cond_2
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_3
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getDrawableState()[I
2019-07-24 11:27:29 +00:00
move-result-object v1
invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->setState([I)Z
:cond_3
return-void
.end method
.method private applyTrackTint()V
.locals 2
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_3
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTint:Z
if-nez v0, :cond_0
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTintMode:Z
if-eqz v0, :cond_3
:cond_0
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
2019-11-15 02:21:15 +00:00
invoke-static {v0}, Landroidx/core/graphics/drawable/DrawableCompat;->wrap(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;
move-result-object v0
2019-07-24 11:27:29 +00:00
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;
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTint:Z
if-eqz v0, :cond_1
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
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
:cond_1
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTintMode:Z
if-eqz v0, :cond_2
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
:cond_2
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_3
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getDrawableState()[I
2019-07-24 11:27:29 +00:00
move-result-object v1
invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->setState([I)Z
:cond_3
return-void
.end method
.method private cancelPositionAnimator()V
.locals 1
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mPositionAnimator:Landroid/animation/ObjectAnimator;
if-eqz v0, :cond_0
invoke-virtual {v0}, Landroid/animation/ObjectAnimator;->cancel()V
:cond_0
return-void
.end method
.method private cancelSuperTouch(Landroid/view/MotionEvent;)V
.locals 1
invoke-static {p1}, Landroid/view/MotionEvent;->obtain(Landroid/view/MotionEvent;)Landroid/view/MotionEvent;
move-result-object p1
const/4 v0, 0x3
invoke-virtual {p1, v0}, Landroid/view/MotionEvent;->setAction(I)V
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onTouchEvent(Landroid/view/MotionEvent;)Z
invoke-virtual {p1}, Landroid/view/MotionEvent;->recycle()V
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public static constrain(FFF)F
2019-07-24 11:27:29 +00:00
.locals 1
cmpg-float v0, p0, p1
if-gez v0, :cond_0
2019-12-06 03:29:40 +00:00
move p0, p1
goto :goto_0
2019-07-24 11:27:29 +00:00
:cond_0
cmpl-float p1, p0, p2
if-lez p1, :cond_1
2019-12-06 03:29:40 +00:00
move p0, p2
2019-07-24 11:27:29 +00:00
:cond_1
2019-12-06 03:29:40 +00:00
:goto_0
2019-07-24 11:27:29 +00:00
return p0
.end method
.method private getTargetCheckedState()Z
.locals 2
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbPosition:F
const/high16 v1, 0x3f000000 # 0.5f
cmpl-float v0, v0, v1
if-lez v0, :cond_0
const/4 v0, 0x1
2019-12-06 03:29:40 +00:00
goto :goto_0
2019-07-24 11:27:29 +00:00
:cond_0
const/4 v0, 0x0
2019-12-06 03:29:40 +00:00
:goto_0
2019-07-24 11:27:29 +00:00
return v0
.end method
.method private getThumbOffset()I
.locals 2
invoke-static {p0}, Landroidx/appcompat/widget/ViewUtils;->isLayoutRtl(Landroid/view/View;)Z
move-result v0
if-eqz v0, :cond_0
const/high16 v0, 0x3f800000 # 1.0f
iget v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbPosition:F
sub-float/2addr v0, v1
goto :goto_0
:cond_0
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbPosition:F
:goto_0
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
.locals 4
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_1
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTempRect:Landroid/graphics/Rect;
invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_0
invoke-static {v0}, Landroidx/appcompat/widget/DrawableUtils;->getOpticalBounds(Landroid/graphics/drawable/Drawable;)Landroid/graphics/Rect;
move-result-object v0
goto :goto_0
:cond_0
sget-object v0, Landroidx/appcompat/widget/DrawableUtils;->INSETS_NONE:Landroid/graphics/Rect;
:goto_0
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_1
const/4 v0, 0x0
return v0
.end method
.method private hitThumb(FF)Z
2019-12-06 03:29:40 +00:00
.locals 7
2019-07-24 11:27:29 +00:00
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
const/4 v1, 0x0
if-nez v0, :cond_0
return v1
:cond_0
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->getThumbOffset()I
move-result v0
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
iget v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchTop:I
iget v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchSlop:I
sub-int/2addr v2, v3
iget v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchLeft:I
add-int/2addr v4, v0
sub-int/2addr v4, v3
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbWidth:I
add-int/2addr v0, v4
2019-12-06 03:29:40 +00:00
iget-object v5, p0, Landroidx/appcompat/widget/SwitchCompat;->mTempRect:Landroid/graphics/Rect;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget v6, v5, Landroid/graphics/Rect;->left:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-int/2addr v0, v6
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget v5, v5, Landroid/graphics/Rect;->right:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-int/2addr v0, v5
2019-07-24 11:27:29 +00:00
add-int/2addr v0, v3
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_1
int-to-float v0, v0
cmpg-float p1, p1, v0
if-gez p1, :cond_1
int-to-float p1, v2
cmpl-float p1, p2, p1
if-lez p1, :cond_1
int-to-float p1, v5
cmpg-float p1, p2, p1
if-gez p1, :cond_1
2019-12-06 03:29:40 +00:00
const/4 v1, 0x1
2019-07-24 11:27:29 +00:00
:cond_1
return v1
.end method
.method private makeLayout(Ljava/lang/CharSequence;)Landroid/text/Layout;
.locals 8
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchTransformationMethod:Landroid/text/method/TransformationMethod;
if-eqz v0, :cond_0
invoke-interface {v0, p1, p0}, Landroid/text/method/TransformationMethod;->getTransformation(Ljava/lang/CharSequence;Landroid/view/View;)Ljava/lang/CharSequence;
move-result-object p1
:cond_0
move-object v1, p1
new-instance p1, Landroid/text/StaticLayout;
iget-object v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
if-eqz v1, :cond_1
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_0
:cond_1
const/4 v0, 0x0
const/4 v3, 0x0
:goto_0
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
.locals 1
const/4 v0, 0x1
if-eq p1, v0, :cond_2
const/4 v0, 0x2
if-eq p1, v0, :cond_1
const/4 v0, 0x3
if-eq p1, v0, :cond_0
const/4 p1, 0x0
goto :goto_0
:cond_0
sget-object p1, Landroid/graphics/Typeface;->MONOSPACE:Landroid/graphics/Typeface;
goto :goto_0
:cond_1
sget-object p1, Landroid/graphics/Typeface;->SERIF:Landroid/graphics/Typeface;
goto :goto_0
:cond_2
sget-object p1, Landroid/graphics/Typeface;->SANS_SERIF:Landroid/graphics/Typeface;
:goto_0
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
.locals 6
const/4 v0, 0x0
iput v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchMode:I
invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I
move-result v1
const/4 v2, 0x1
if-ne v1, v2, :cond_0
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->isEnabled()Z
2019-07-24 11:27:29 +00:00
move-result v1
if-eqz v1, :cond_0
const/4 v1, 0x1
goto :goto_0
:cond_0
const/4 v1, 0x0
:goto_0
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->isChecked()Z
2019-07-24 11:27:29 +00:00
move-result v3
if-eqz v1, :cond_4
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
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mVelocityTracker:Landroid/view/VelocityTracker;
invoke-virtual {v1}, Landroid/view/VelocityTracker;->getXVelocity()F
move-result v1
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_3
invoke-static {p0}, Landroidx/appcompat/widget/ViewUtils;->isLayoutRtl(Landroid/view/View;)Z
move-result v4
const/4 v5, 0x0
if-eqz v4, :cond_1
cmpg-float v1, v1, v5
if-gez v1, :cond_2
goto :goto_1
:cond_1
cmpl-float v1, v1, v5
if-lez v1, :cond_2
goto :goto_1
:cond_2
const/4 v2, 0x0
:goto_1
move v1, v2
goto :goto_2
:cond_3
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->getTargetCheckedState()Z
move-result v1
goto :goto_2
:cond_4
move v1, v3
:goto_2
if-eq v1, v3, :cond_5
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, v0}, Landroid/widget/CompoundButton;->playSoundEffect(I)V
2019-07-24 11:27:29 +00:00
:cond_5
invoke-virtual {p0, v1}, Landroidx/appcompat/widget/SwitchCompat;->setChecked(Z)V
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
.locals 10
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTempRect:Landroid/graphics/Rect;
iget v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchLeft:I
iget v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchTop:I
iget v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchRight:I
iget v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchBottom:I
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->getThumbOffset()I
move-result v5
add-int/2addr v5, v1
iget-object v6, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v6, :cond_0
invoke-static {v6}, Landroidx/appcompat/widget/DrawableUtils;->getOpticalBounds(Landroid/graphics/drawable/Drawable;)Landroid/graphics/Rect;
move-result-object v6
goto :goto_0
:cond_0
sget-object v6, Landroidx/appcompat/widget/DrawableUtils;->INSETS_NONE:Landroid/graphics/Rect;
:goto_0
iget-object v7, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v7, :cond_6
invoke-virtual {v7, v0}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z
iget v7, v0, Landroid/graphics/Rect;->left:I
add-int/2addr v5, v7
if-eqz v6, :cond_4
2019-12-06 03:29:40 +00:00
iget v8, v6, Landroid/graphics/Rect;->left:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-le v8, v7, :cond_1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
sub-int/2addr v8, v7
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-int/2addr v1, v8
2019-07-24 11:27:29 +00:00
:cond_1
iget v7, v6, Landroid/graphics/Rect;->top:I
iget v8, v0, Landroid/graphics/Rect;->top:I
if-le v7, v8, :cond_2
sub-int/2addr v7, v8
add-int/2addr v7, v2
goto :goto_1
:cond_2
move v7, v2
:goto_1
iget v8, v6, Landroid/graphics/Rect;->right:I
iget v9, v0, Landroid/graphics/Rect;->right:I
if-le v8, v9, :cond_3
sub-int/2addr v8, v9
sub-int/2addr v3, v8
:cond_3
iget v6, v6, Landroid/graphics/Rect;->bottom:I
iget v8, v0, Landroid/graphics/Rect;->bottom:I
2019-12-06 03:29:40 +00:00
if-le v6, v8, :cond_5
2019-07-24 11:27:29 +00:00
sub-int/2addr v6, v8
sub-int v6, v4, v6
goto :goto_2
:cond_4
move v7, v2
:cond_5
move v6, v4
:goto_2
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
:cond_6
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v1, :cond_7
invoke-virtual {v1, v0}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z
iget v1, v0, Landroid/graphics/Rect;->left:I
sub-int v1, v5, v1
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
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
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getBackground()Landroid/graphics/drawable/Drawable;
2019-07-24 11:27:29 +00:00
move-result-object v0
if-eqz v0, :cond_7
invoke-static {v0, v1, v2, v5, v4}, Landroidx/core/graphics/drawable/DrawableCompat;->setHotspotBounds(Landroid/graphics/drawable/Drawable;IIII)V
:cond_7
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->draw(Landroid/graphics/Canvas;)V
return-void
.end method
.method public drawableHotspotChanged(FF)V
2019-12-06 03:29:40 +00:00
.locals 1
2019-07-24 11:27:29 +00:00
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
invoke-super {p0, p1, p2}, Landroid/widget/CompoundButton;->drawableHotspotChanged(FF)V
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
2019-12-06 03:29:40 +00:00
if-eqz v0, :cond_0
2019-07-24 11:27:29 +00:00
invoke-static {v0, p1, p2}, Landroidx/core/graphics/drawable/DrawableCompat;->setHotspot(Landroid/graphics/drawable/Drawable;FF)V
2019-12-06 03:29:40 +00:00
:cond_0
2019-07-24 11:27:29 +00:00
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
2019-12-06 03:29:40 +00:00
if-eqz v0, :cond_1
2019-07-24 11:27:29 +00:00
invoke-static {v0, p1, p2}, Landroidx/core/graphics/drawable/DrawableCompat;->setHotspot(Landroid/graphics/drawable/Drawable;FF)V
2019-12-06 03:29:40 +00:00
:cond_1
2019-07-24 11:27:29 +00:00
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public drawableStateChanged()V
2019-07-24 11:27:29 +00:00
.locals 4
invoke-super {p0}, Landroid/widget/CompoundButton;->drawableStateChanged()V
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getDrawableState()[I
2019-07-24 11:27:29 +00:00
move-result-object v0
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
const/4 v2, 0x0
if-eqz v1, :cond_0
invoke-virtual {v1}, Landroid/graphics/drawable/Drawable;->isStateful()Z
move-result v3
if-eqz v3, :cond_0
invoke-virtual {v1, v0}, Landroid/graphics/drawable/Drawable;->setState([I)Z
move-result v1
or-int/2addr v2, v1
:cond_0
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v1, :cond_1
invoke-virtual {v1}, Landroid/graphics/drawable/Drawable;->isStateful()Z
move-result v3
if-eqz v3, :cond_1
invoke-virtual {v1, v0}, Landroid/graphics/drawable/Drawable;->setState([I)Z
move-result v0
or-int/2addr v2, v0
:cond_1
if-eqz v2, :cond_2
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->invalidate()V
2019-07-24 11:27:29 +00:00
:cond_2
return-void
.end method
.method public getCompoundPaddingLeft()I
.locals 2
invoke-static {p0}, Landroidx/appcompat/widget/ViewUtils;->isLayoutRtl(Landroid/view/View;)Z
move-result v0
if-nez v0, :cond_0
invoke-super {p0}, Landroid/widget/CompoundButton;->getCompoundPaddingLeft()I
move-result v0
return v0
:cond_0
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
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getText()Ljava/lang/CharSequence;
2019-07-24 11:27:29 +00:00
move-result-object v1
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_1
iget v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchPadding:I
add-int/2addr v0, v1
:cond_1
return v0
.end method
.method public getCompoundPaddingRight()I
.locals 2
invoke-static {p0}, Landroidx/appcompat/widget/ViewUtils;->isLayoutRtl(Landroid/view/View;)Z
move-result v0
if-eqz v0, :cond_0
invoke-super {p0}, Landroid/widget/CompoundButton;->getCompoundPaddingRight()I
move-result v0
return v0
:cond_0
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
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getText()Ljava/lang/CharSequence;
2019-07-24 11:27:29 +00:00
move-result-object v1
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_1
iget v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchPadding:I
add-int/2addr v0, v1
:cond_1
return v0
.end method
.method public getShowText()Z
.locals 1
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mShowText:Z
return v0
.end method
.method public getSplitTrack()Z
.locals 1
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mSplitTrack:Z
return v0
.end method
.method public getSwitchMinWidth()I
.locals 1
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchMinWidth:I
return v0
.end method
.method public getSwitchPadding()I
.locals 1
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchPadding:I
return v0
.end method
.method public getTextOff()Ljava/lang/CharSequence;
.locals 1
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOff:Ljava/lang/CharSequence;
return-object v0
.end method
.method public getTextOn()Ljava/lang/CharSequence;
.locals 1
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOn:Ljava/lang/CharSequence;
return-object v0
.end method
.method public getThumbDrawable()Landroid/graphics/drawable/Drawable;
.locals 1
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
return-object v0
.end method
.method public getThumbTextPadding()I
.locals 1
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTextPadding:I
return v0
.end method
.method public getThumbTintList()Landroid/content/res/ColorStateList;
.locals 1
2019-12-06 03:29:40 +00:00
.annotation build Landroidx/annotation/Nullable;
.end annotation
2019-07-24 11:27:29 +00:00
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;
.locals 1
2019-12-06 03:29:40 +00:00
.annotation build Landroidx/annotation/Nullable;
.end annotation
2019-07-24 11:27:29 +00:00
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;
.locals 1
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;
.locals 1
2019-12-06 03:29:40 +00:00
.annotation build Landroidx/annotation/Nullable;
.end annotation
2019-07-24 11:27:29 +00:00
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;
.locals 1
2019-12-06 03:29:40 +00:00
.annotation build Landroidx/annotation/Nullable;
.end annotation
2019-07-24 11:27:29 +00:00
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintMode:Landroid/graphics/PorterDuff$Mode;
return-object v0
.end method
.method public jumpDrawablesToCurrentState()V
.locals 1
invoke-super {p0}, Landroid/widget/CompoundButton;->jumpDrawablesToCurrentState()V
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_0
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->jumpToCurrentState()V
:cond_0
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_1
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->jumpToCurrentState()V
:cond_1
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mPositionAnimator:Landroid/animation/ObjectAnimator;
if-eqz v0, :cond_2
invoke-virtual {v0}, Landroid/animation/ObjectAnimator;->isStarted()Z
move-result v0
if-eqz v0, :cond_2
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mPositionAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {v0}, Landroid/animation/ObjectAnimator;->end()V
const/4 v0, 0x0
iput-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mPositionAnimator:Landroid/animation/ObjectAnimator;
:cond_2
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public onCreateDrawableState(I)[I
2019-07-24 11:27:29 +00:00
.locals 1
add-int/lit8 p1, p1, 0x1
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onCreateDrawableState(I)[I
move-result-object p1
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->isChecked()Z
2019-07-24 11:27:29 +00:00
move-result v0
if-eqz v0, :cond_0
sget-object v0, Landroidx/appcompat/widget/SwitchCompat;->CHECKED_STATE_SET:[I
2019-12-06 03:29:40 +00:00
invoke-static {p1, v0}, Landroid/widget/CompoundButton;->mergeDrawableStates([I[I)[I
2019-07-24 11:27:29 +00:00
:cond_0
return-object p1
.end method
2019-12-06 03:29:40 +00:00
.method public onDraw(Landroid/graphics/Canvas;)V
2019-07-24 11:27:29 +00:00
.locals 9
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onDraw(Landroid/graphics/Canvas;)V
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTempRect:Landroid/graphics/Rect;
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v1, :cond_0
invoke-virtual {v1, v0}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z
goto :goto_0
:cond_0
invoke-virtual {v0}, Landroid/graphics/Rect;->setEmpty()V
:goto_0
iget v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchTop:I
iget v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchBottom:I
iget v4, v0, Landroid/graphics/Rect;->top:I
add-int/2addr v2, v4
iget v4, v0, Landroid/graphics/Rect;->bottom:I
sub-int/2addr v3, v4
iget-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v1, :cond_2
iget-boolean v5, p0, Landroidx/appcompat/widget/SwitchCompat;->mSplitTrack:Z
if-eqz v5, :cond_1
if-eqz v4, :cond_1
invoke-static {v4}, Landroidx/appcompat/widget/DrawableUtils;->getOpticalBounds(Landroid/graphics/drawable/Drawable;)Landroid/graphics/Rect;
move-result-object v5
invoke-virtual {v4, v0}, Landroid/graphics/drawable/Drawable;->copyBounds(Landroid/graphics/Rect;)V
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
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
invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I
move-result v5
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
invoke-virtual {v1, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V
invoke-virtual {p1, v5}, Landroid/graphics/Canvas;->restoreToCount(I)V
goto :goto_1
:cond_1
invoke-virtual {v1, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V
:cond_2
:goto_1
invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I
move-result v0
if-eqz v4, :cond_3
invoke-virtual {v4, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V
:cond_3
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->getTargetCheckedState()Z
move-result v1
if-eqz v1, :cond_4
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mOnLayout:Landroid/text/Layout;
goto :goto_2
:cond_4
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mOffLayout:Landroid/text/Layout;
:goto_2
if-eqz v1, :cond_7
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getDrawableState()[I
2019-07-24 11:27:29 +00:00
move-result-object v5
iget-object v6, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextColors:Landroid/content/res/ColorStateList;
if-eqz v6, :cond_5
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
:cond_5
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_6
invoke-virtual {v4}, Landroid/graphics/drawable/Drawable;->getBounds()Landroid/graphics/Rect;
move-result-object v4
iget v5, v4, Landroid/graphics/Rect;->left:I
iget v4, v4, Landroid/graphics/Rect;->right:I
add-int/2addr v5, v4
goto :goto_3
:cond_6
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getWidth()I
2019-07-24 11:27:29 +00:00
move-result v5
:goto_3
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
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
invoke-virtual {p1, v3, v2}, Landroid/graphics/Canvas;->translate(FF)V
invoke-virtual {v1, p1}, Landroid/text/Layout;->draw(Landroid/graphics/Canvas;)V
:cond_7
invoke-virtual {p1, v0}, Landroid/graphics/Canvas;->restoreToCount(I)V
return-void
.end method
.method public onInitializeAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)V
.locals 1
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onInitializeAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)V
const-string v0, "android.widget.Switch"
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
.locals 3
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onInitializeAccessibilityNodeInfo(Landroid/view/accessibility/AccessibilityNodeInfo;)V
const-string v0, "android.widget.Switch"
invoke-virtual {p1, v0}, Landroid/view/accessibility/AccessibilityNodeInfo;->setClassName(Ljava/lang/CharSequence;)V
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->isChecked()Z
2019-07-24 11:27:29 +00:00
move-result v0
if-eqz v0, :cond_0
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOn:Ljava/lang/CharSequence;
goto :goto_0
:cond_0
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOff:Ljava/lang/CharSequence;
:goto_0
invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_2
invoke-virtual {p1}, Landroid/view/accessibility/AccessibilityNodeInfo;->getText()Ljava/lang/CharSequence;
move-result-object v1
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v2
if-eqz v2, :cond_1
invoke-virtual {p1, v0}, Landroid/view/accessibility/AccessibilityNodeInfo;->setText(Ljava/lang/CharSequence;)V
2019-12-06 03:29:40 +00:00
goto :goto_1
2019-07-24 11:27:29 +00:00
:cond_1
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
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;
invoke-virtual {p1, v2}, Landroid/view/accessibility/AccessibilityNodeInfo;->setText(Ljava/lang/CharSequence;)V
:cond_2
2019-12-06 03:29:40 +00:00
:goto_1
2019-07-24 11:27:29 +00:00
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public onLayout(ZIIII)V
.locals 1
2019-07-24 11:27:29 +00:00
invoke-super/range {p0 .. p5}, Landroid/widget/CompoundButton;->onLayout(ZIIII)V
iget-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
const/4 p2, 0x0
if-eqz p1, :cond_1
iget-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTempRect:Landroid/graphics/Rect;
iget-object p3, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz p3, :cond_0
invoke-virtual {p3, p1}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z
goto :goto_0
:cond_0
invoke-virtual {p1}, Landroid/graphics/Rect;->setEmpty()V
:goto_0
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
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
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_1
:cond_1
const/4 p4, 0x0
:goto_1
invoke-static {p0}, Landroidx/appcompat/widget/ViewUtils;->isLayoutRtl(Landroid/view/View;)Z
move-result p1
if-eqz p1, :cond_2
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getPaddingLeft()I
2019-07-24 11:27:29 +00:00
move-result p1
add-int/2addr p1, p4
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_2
:cond_2
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getWidth()I
2019-07-24 11:27:29 +00:00
move-result p1
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getPaddingRight()I
2019-07-24 11:27:29 +00:00
move-result p3
sub-int/2addr p1, p3
sub-int p3, p1, p2
iget p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchWidth:I
sub-int p1, p3, p1
add-int/2addr p1, p4
add-int/2addr p1, p2
:goto_2
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getGravity()I
2019-07-24 11:27:29 +00:00
move-result p2
and-int/lit8 p2, p2, 0x70
const/16 p4, 0x10
if-eq p2, p4, :cond_4
const/16 p4, 0x50
if-eq p2, p4, :cond_3
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getPaddingTop()I
2019-07-24 11:27:29 +00:00
move-result p2
iget p4, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchHeight:I
add-int/2addr p4, p2
2019-12-06 03:29:40 +00:00
goto :goto_3
2019-07-24 11:27:29 +00:00
:cond_3
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getHeight()I
2019-07-24 11:27:29 +00:00
move-result p2
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getPaddingBottom()I
2019-07-24 11:27:29 +00:00
move-result p4
sub-int p4, p2, p4
iget p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchHeight:I
sub-int p2, p4, p2
2019-12-06 03:29:40 +00:00
goto :goto_3
2019-07-24 11:27:29 +00:00
:cond_4
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getPaddingTop()I
2019-07-24 11:27:29 +00:00
move-result p2
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getHeight()I
2019-07-24 11:27:29 +00:00
move-result p4
2019-12-06 03:29:40 +00:00
add-int/2addr p4, p2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getPaddingBottom()I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result p2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
sub-int/2addr p4, p2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
div-int/lit8 p4, p4, 0x2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchHeight:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
div-int/lit8 p5, p2, 0x2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
sub-int/2addr p4, p5
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-int/2addr p2, p4
move v0, p4
move p4, p2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move p2, v0
:goto_3
2019-07-24 11:27:29 +00:00
iput p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchLeft:I
iput p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchTop:I
iput p4, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchBottom:I
iput p3, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchRight:I
return-void
.end method
.method public onMeasure(II)V
.locals 6
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mShowText:Z
if-eqz v0, :cond_1
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mOnLayout:Landroid/text/Layout;
if-nez v0, :cond_0
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;
:cond_0
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mOffLayout:Landroid/text/Layout;
if-nez v0, :cond_1
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;
:cond_1
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTempRect:Landroid/graphics/Rect;
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
const/4 v2, 0x0
if-eqz v1, :cond_2
invoke-virtual {v1, v0}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z
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
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_0
:cond_2
const/4 v1, 0x0
const/4 v3, 0x0
:goto_0
iget-boolean v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mShowText:Z
if-eqz v4, :cond_3
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_1
:cond_3
const/4 v4, 0x0
:goto_1
invoke-static {v4, v1}, Ljava/lang/Math;->max(II)I
move-result v1
iput v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbWidth:I
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v1, :cond_4
invoke-virtual {v1, v0}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z
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_2
:cond_4
invoke-virtual {v0}, Landroid/graphics/Rect;->setEmpty()V
:goto_2
iget v1, v0, Landroid/graphics/Rect;->left:I
iget v0, v0, Landroid/graphics/Rect;->right:I
iget-object v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v4, :cond_5
invoke-static {v4}, Landroidx/appcompat/widget/DrawableUtils;->getOpticalBounds(Landroid/graphics/drawable/Drawable;)Landroid/graphics/Rect;
move-result-object v4
iget v5, v4, Landroid/graphics/Rect;->left:I
invoke-static {v1, v5}, Ljava/lang/Math;->max(II)I
move-result v1
iget v4, v4, Landroid/graphics/Rect;->right:I
invoke-static {v0, v4}, Ljava/lang/Math;->max(II)I
move-result v0
:cond_5
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
invoke-static {v2, v3}, Ljava/lang/Math;->max(II)I
move-result v1
iput v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchWidth:I
iput v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchHeight:I
invoke-super {p0, p1, p2}, Landroid/widget/CompoundButton;->onMeasure(II)V
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getMeasuredHeight()I
2019-07-24 11:27:29 +00:00
move-result p1
if-ge p1, v1, :cond_6
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getMeasuredWidthAndState()I
2019-07-24 11:27:29 +00:00
move-result p1
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p1, v1}, Landroid/widget/CompoundButton;->setMeasuredDimension(II)V
2019-07-24 11:27:29 +00:00
:cond_6
return-void
.end method
.method public onPopulateAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)V
.locals 1
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onPopulateAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)V
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->isChecked()Z
2019-07-24 11:27:29 +00:00
move-result v0
if-eqz v0, :cond_0
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOn:Ljava/lang/CharSequence;
goto :goto_0
:cond_0
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOff:Ljava/lang/CharSequence;
:goto_0
if-eqz v0, :cond_1
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_1
return-void
.end method
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
.locals 6
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mVelocityTracker:Landroid/view/VelocityTracker;
invoke-virtual {v0, p1}, Landroid/view/VelocityTracker;->addMovement(Landroid/view/MotionEvent;)V
invoke-virtual {p1}, Landroid/view/MotionEvent;->getActionMasked()I
move-result v0
const/4 v1, 0x1
if-eqz v0, :cond_a
const/4 v2, 0x2
if-eq v0, v1, :cond_8
if-eq v0, v2, :cond_0
const/4 v3, 0x3
if-eq v0, v3, :cond_8
goto/16 :goto_1
:cond_0
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchMode:I
if-eqz v0, :cond_b
if-eq v0, v1, :cond_6
if-eq v0, v2, :cond_1
goto/16 :goto_1
:cond_1
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result p1
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->getThumbScrollRange()I
move-result v0
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_2
int-to-float v0, v0
2019-12-06 03:29:40 +00:00
div-float/2addr v2, v0
2019-07-24 11:27:29 +00:00
goto :goto_0
:cond_2
cmpl-float v0, v2, v4
if-lez v0, :cond_3
2019-12-06 03:29:40 +00:00
const/high16 v2, 0x3f800000 # 1.0f
2019-07-24 11:27:29 +00:00
goto :goto_0
:cond_3
const/high16 v0, -0x40800000 # -1.0f
2019-12-06 03:29:40 +00:00
const/high16 v2, -0x40800000 # -1.0f
2019-07-24 11:27:29 +00:00
:goto_0
invoke-static {p0}, Landroidx/appcompat/widget/ViewUtils;->isLayoutRtl(Landroid/view/View;)Z
2019-12-06 03:29:40 +00:00
move-result v0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-eqz v0, :cond_4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
neg-float v2, v2
2019-07-24 11:27:29 +00:00
:cond_4
2019-12-06 03:29:40 +00:00
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbPosition:F
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-float/2addr v0, v2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {v0, v4, v3}, Landroidx/appcompat/widget/SwitchCompat;->constrain(FFF)F
2019-07-24 11:27:29 +00:00
move-result v0
iget v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbPosition:F
cmpl-float v2, v0, v2
if-eqz v2, :cond_5
iput p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchX:F
invoke-virtual {p0, v0}, Landroidx/appcompat/widget/SwitchCompat;->setThumbPosition(F)V
:cond_5
return v1
:cond_6
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result v0
invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F
move-result v3
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_7
iget v4, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchY:F
sub-float v4, v3, 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-lez v4, :cond_b
:cond_7
iput v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchMode:I
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getParent()Landroid/view/ViewParent;
2019-07-24 11:27:29 +00:00
move-result-object p1
invoke-interface {p1, v1}, Landroid/view/ViewParent;->requestDisallowInterceptTouchEvent(Z)V
iput v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchX:F
iput v3, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchY:F
return v1
:cond_8
iget v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchMode:I
if-ne v0, v2, :cond_9
invoke-direct {p0, p1}, Landroidx/appcompat/widget/SwitchCompat;->stopDrag(Landroid/view/MotionEvent;)V
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onTouchEvent(Landroid/view/MotionEvent;)Z
return v1
:cond_9
const/4 v0, 0x0
iput v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchMode:I
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mVelocityTracker:Landroid/view/VelocityTracker;
invoke-virtual {v0}, Landroid/view/VelocityTracker;->clear()V
goto :goto_1
:cond_a
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result v0
invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F
move-result v2
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->isEnabled()Z
2019-07-24 11:27:29 +00:00
move-result v3
if-eqz v3, :cond_b
invoke-direct {p0, v0, v2}, Landroidx/appcompat/widget/SwitchCompat;->hitThumb(FF)Z
move-result v3
if-eqz v3, :cond_b
iput v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchMode:I
iput v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchX:F
iput v2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTouchY:F
:cond_b
:goto_1
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onTouchEvent(Landroid/view/MotionEvent;)Z
move-result p1
return p1
.end method
.method public setChecked(Z)V
.locals 1
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->setChecked(Z)V
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->isChecked()Z
2019-07-24 11:27:29 +00:00
move-result p1
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getWindowToken()Landroid/os/IBinder;
2019-07-24 11:27:29 +00:00
move-result-object v0
if-eqz v0, :cond_0
invoke-static {p0}, Landroidx/core/view/ViewCompat;->isLaidOut(Landroid/view/View;)Z
move-result v0
if-eqz v0, :cond_0
invoke-direct {p0, p1}, Landroidx/appcompat/widget/SwitchCompat;->animateThumbToCheckedState(Z)V
2019-12-06 03:29:40 +00:00
goto :goto_1
2019-07-24 11:27:29 +00:00
:cond_0
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->cancelPositionAnimator()V
if-eqz p1, :cond_1
const/high16 p1, 0x3f800000 # 1.0f
goto :goto_0
:cond_1
const/4 p1, 0x0
:goto_0
invoke-virtual {p0, p1}, Landroidx/appcompat/widget/SwitchCompat;->setThumbPosition(F)V
2019-12-06 03:29:40 +00:00
:goto_1
2019-07-24 11:27:29 +00:00
return-void
.end method
.method public setCustomSelectionActionModeCallback(Landroid/view/ActionMode$Callback;)V
.locals 0
invoke-static {p0, p1}, Landroidx/core/widget/TextViewCompat;->wrapCustomSelectionActionModeCallback(Landroid/widget/TextView;Landroid/view/ActionMode$Callback;)Landroid/view/ActionMode$Callback;
move-result-object p1
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->setCustomSelectionActionModeCallback(Landroid/view/ActionMode$Callback;)V
return-void
.end method
.method public setShowText(Z)V
.locals 1
iget-boolean v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mShowText:Z
if-eq v0, p1, :cond_0
iput-boolean p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mShowText:Z
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->requestLayout()V
2019-07-24 11:27:29 +00:00
:cond_0
return-void
.end method
.method public setSplitTrack(Z)V
.locals 0
iput-boolean p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSplitTrack:Z
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->invalidate()V
2019-07-24 11:27:29 +00:00
return-void
.end method
.method public setSwitchMinWidth(I)V
.locals 0
iput p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchMinWidth:I
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->requestLayout()V
2019-07-24 11:27:29 +00:00
return-void
.end method
.method public setSwitchPadding(I)V
.locals 0
iput p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchPadding:I
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->requestLayout()V
2019-07-24 11:27:29 +00:00
return-void
.end method
.method public setSwitchTextAppearance(Landroid/content/Context;I)V
.locals 3
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
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_0
iput-object p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextColors:Landroid/content/res/ColorStateList;
goto :goto_0
:cond_0
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getTextColors()Landroid/content/res/ColorStateList;
2019-07-24 11:27:29 +00:00
move-result-object p2
iput-object p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextColors:Landroid/content/res/ColorStateList;
:goto_0
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_1
int-to-float p2, p2
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_1
iget-object v1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
invoke-virtual {v1, p2}, Landroid/text/TextPaint;->setTextSize(F)V
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->requestLayout()V
2019-07-24 11:27:29 +00:00
:cond_1
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
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
invoke-direct {p0, p2, v1}, Landroidx/appcompat/widget/SwitchCompat;->setSwitchTypefaceByIndex(II)V
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_2
new-instance p2, Landroidx/appcompat/text/AllCapsTransformationMethod;
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getContext()Landroid/content/Context;
2019-07-24 11:27:29 +00:00
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_1
:cond_2
const/4 p2, 0x0
iput-object p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mSwitchTransformationMethod:Landroid/text/method/TransformationMethod;
:goto_1
invoke-virtual {p1}, Landroidx/appcompat/widget/TintTypedArray;->recycle()V
return-void
.end method
.method public setSwitchTypeface(Landroid/graphics/Typeface;)V
.locals 1
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_0
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_1
:cond_0
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-nez v0, :cond_2
if-eqz p1, :cond_2
:cond_1
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;
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->requestLayout()V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->invalidate()V
2019-07-24 11:27:29 +00:00
:cond_2
return-void
.end method
.method public setSwitchTypeface(Landroid/graphics/Typeface;I)V
.locals 3
const/4 v0, 0x0
const/4 v1, 0x0
if-lez p2, :cond_4
if-nez p1, :cond_0
invoke-static {p2}, Landroid/graphics/Typeface;->defaultFromStyle(I)Landroid/graphics/Typeface;
move-result-object p1
goto :goto_0
:cond_0
invoke-static {p1, p2}, Landroid/graphics/Typeface;->create(Landroid/graphics/Typeface;I)Landroid/graphics/Typeface;
move-result-object p1
:goto_0
invoke-virtual {p0, p1}, Landroidx/appcompat/widget/SwitchCompat;->setSwitchTypeface(Landroid/graphics/Typeface;)V
if-eqz p1, :cond_1
invoke-virtual {p1}, Landroid/graphics/Typeface;->getStyle()I
move-result p1
goto :goto_1
:cond_1
const/4 p1, 0x0
:goto_1
2019-11-20 22:09:14 +00:00
not-int p1, p1
2019-07-24 11:27:29 +00:00
and-int/2addr p1, p2
iget-object p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
and-int/lit8 v2, p1, 0x1
if-eqz v2, :cond_2
const/4 v1, 0x1
:cond_2
invoke-virtual {p2, v1}, Landroid/text/TextPaint;->setFakeBoldText(Z)V
iget-object p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
and-int/lit8 p1, p1, 0x2
if-eqz p1, :cond_3
const/high16 v0, -0x41800000 # -0.25f
:cond_3
invoke-virtual {p2, v0}, Landroid/text/TextPaint;->setTextSkewX(F)V
2019-12-06 03:29:40 +00:00
goto :goto_2
2019-07-24 11:27:29 +00:00
:cond_4
iget-object p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
invoke-virtual {p2, v1}, Landroid/text/TextPaint;->setFakeBoldText(Z)V
iget-object p2, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextPaint:Landroid/text/TextPaint;
invoke-virtual {p2, v0}, Landroid/text/TextPaint;->setTextSkewX(F)V
invoke-virtual {p0, p1}, Landroidx/appcompat/widget/SwitchCompat;->setSwitchTypeface(Landroid/graphics/Typeface;)V
2019-12-06 03:29:40 +00:00
:goto_2
2019-07-24 11:27:29 +00:00
return-void
.end method
.method public setTextOff(Ljava/lang/CharSequence;)V
.locals 0
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOff:Ljava/lang/CharSequence;
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->requestLayout()V
2019-07-24 11:27:29 +00:00
return-void
.end method
.method public setTextOn(Ljava/lang/CharSequence;)V
.locals 0
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTextOn:Ljava/lang/CharSequence;
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->requestLayout()V
2019-07-24 11:27:29 +00:00
return-void
.end method
.method public setThumbDrawable(Landroid/graphics/drawable/Drawable;)V
.locals 2
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_0
const/4 v1, 0x0
invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V
:cond_0
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eqz p1, :cond_1
invoke-virtual {p1, p0}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V
:cond_1
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->requestLayout()V
2019-07-24 11:27:29 +00:00
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public setThumbPosition(F)V
2019-07-24 11:27:29 +00:00
.locals 0
iput p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbPosition:F
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->invalidate()V
2019-07-24 11:27:29 +00:00
return-void
.end method
.method public setThumbResource(I)V
.locals 1
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getContext()Landroid/content/Context;
2019-07-24 11:27:29 +00:00
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
.locals 0
iput p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTextPadding:I
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->requestLayout()V
2019-07-24 11:27:29 +00:00
return-void
.end method
.method public setThumbTintList(Landroid/content/res/ColorStateList;)V
.locals 0
2019-12-06 03:29:40 +00:00
.param p1 # Landroid/content/res/ColorStateList;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
2019-07-24 11:27:29 +00:00
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintList:Landroid/content/res/ColorStateList;
const/4 p1, 0x1
iput-boolean p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTint:Z
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->applyThumbTint()V
return-void
.end method
.method public setThumbTintMode(Landroid/graphics/PorterDuff$Mode;)V
.locals 0
2019-12-06 03:29:40 +00:00
.param p1 # Landroid/graphics/PorterDuff$Mode;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
2019-07-24 11:27:29 +00:00
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbTintMode:Landroid/graphics/PorterDuff$Mode;
const/4 p1, 0x1
iput-boolean p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasThumbTintMode:Z
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->applyThumbTint()V
return-void
.end method
.method public setTrackDrawable(Landroid/graphics/drawable/Drawable;)V
.locals 2
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz v0, :cond_0
const/4 v1, 0x0
invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V
:cond_0
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-eqz p1, :cond_1
invoke-virtual {p1, p0}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V
:cond_1
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->requestLayout()V
2019-07-24 11:27:29 +00:00
return-void
.end method
.method public setTrackResource(I)V
.locals 1
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->getContext()Landroid/content/Context;
2019-07-24 11:27:29 +00:00
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
.locals 0
2019-12-06 03:29:40 +00:00
.param p1 # Landroid/content/res/ColorStateList;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
2019-07-24 11:27:29 +00:00
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintList:Landroid/content/res/ColorStateList;
const/4 p1, 0x1
iput-boolean p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTint:Z
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->applyTrackTint()V
return-void
.end method
.method public setTrackTintMode(Landroid/graphics/PorterDuff$Mode;)V
.locals 0
2019-12-06 03:29:40 +00:00
.param p1 # Landroid/graphics/PorterDuff$Mode;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
2019-07-24 11:27:29 +00:00
iput-object p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackTintMode:Landroid/graphics/PorterDuff$Mode;
const/4 p1, 0x1
iput-boolean p1, p0, Landroidx/appcompat/widget/SwitchCompat;->mHasTrackTintMode:Z
invoke-direct {p0}, Landroidx/appcompat/widget/SwitchCompat;->applyTrackTint()V
return-void
.end method
.method public toggle()V
.locals 1
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/CompoundButton;->isChecked()Z
2019-07-24 11:27:29 +00:00
move-result v0
xor-int/lit8 v0, v0, 0x1
invoke-virtual {p0, v0}, Landroidx/appcompat/widget/SwitchCompat;->setChecked(Z)V
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public verifyDrawable(Landroid/graphics/drawable/Drawable;)Z
2019-07-24 11:27:29 +00:00
.locals 1
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->verifyDrawable(Landroid/graphics/drawable/Drawable;)Z
move-result v0
if-nez v0, :cond_1
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
if-eq p1, v0, :cond_1
iget-object v0, p0, Landroidx/appcompat/widget/SwitchCompat;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
if-ne p1, v0, :cond_0
goto :goto_0
:cond_0
const/4 p1, 0x0
2019-12-06 03:29:40 +00:00
goto :goto_1
2019-07-24 11:27:29 +00:00
:cond_1
:goto_0
const/4 p1, 0x1
2019-12-06 03:29:40 +00:00
:goto_1
2019-07-24 11:27:29 +00:00
return p1
.end method