apkfuckery/com.discord/smali/androidx/preference/SeekBarPreference.smali
2019-11-15 03:21:15 +01:00

674 lines
18 KiB
Smali

.class public Landroidx/preference/SeekBarPreference;
.super Landroidx/preference/Preference;
.source "SeekBarPreference.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/preference/SeekBarPreference$SavedState;
}
.end annotation
# static fields
.field private static final TAG:Ljava/lang/String; = "SeekBarPreference"
# instance fields
.field mAdjustable:Z
.field private mMax:I
.field mMin:I
.field mSeekBar:Landroid/widget/SeekBar;
.field private mSeekBarChangeListener:Landroid/widget/SeekBar$OnSeekBarChangeListener;
.field private mSeekBarIncrement:I
.field private mSeekBarKeyListener:Landroid/view/View$OnKeyListener;
.field mSeekBarValue:I
.field private mSeekBarValueTextView:Landroid/widget/TextView;
.field private mShowSeekBarValue:Z
.field mTrackingTouch:Z
.field mUpdatesContinuously:Z
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 1
const/4 v0, 0x0
invoke-direct {p0, p1, v0}, Landroidx/preference/SeekBarPreference;-><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/preference/R$attr;->seekBarPreferenceStyle:I
invoke-direct {p0, p1, p2, v0}, Landroidx/preference/SeekBarPreference;-><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
.locals 1
const/4 v0, 0x0
invoke-direct {p0, p1, p2, p3, v0}, Landroidx/preference/SeekBarPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
.locals 1
invoke-direct {p0, p1, p2, p3, p4}, Landroidx/preference/Preference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
new-instance v0, Landroidx/preference/SeekBarPreference$1;
invoke-direct {v0, p0}, Landroidx/preference/SeekBarPreference$1;-><init>(Landroidx/preference/SeekBarPreference;)V
iput-object v0, p0, Landroidx/preference/SeekBarPreference;->mSeekBarChangeListener:Landroid/widget/SeekBar$OnSeekBarChangeListener;
new-instance v0, Landroidx/preference/SeekBarPreference$2;
invoke-direct {v0, p0}, Landroidx/preference/SeekBarPreference$2;-><init>(Landroidx/preference/SeekBarPreference;)V
iput-object v0, p0, Landroidx/preference/SeekBarPreference;->mSeekBarKeyListener:Landroid/view/View$OnKeyListener;
sget-object v0, Landroidx/preference/R$styleable;->SeekBarPreference:[I
invoke-virtual {p1, p2, v0, p3, p4}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;
move-result-object p1
sget p2, Landroidx/preference/R$styleable;->SeekBarPreference_min:I
const/4 p3, 0x0
invoke-virtual {p1, p2, p3}, Landroid/content/res/TypedArray;->getInt(II)I
move-result p2
iput p2, p0, Landroidx/preference/SeekBarPreference;->mMin:I
sget p2, Landroidx/preference/R$styleable;->SeekBarPreference_android_max:I
const/16 p4, 0x64
invoke-virtual {p1, p2, p4}, Landroid/content/res/TypedArray;->getInt(II)I
move-result p2
invoke-virtual {p0, p2}, Landroidx/preference/SeekBarPreference;->setMax(I)V
sget p2, Landroidx/preference/R$styleable;->SeekBarPreference_seekBarIncrement:I
invoke-virtual {p1, p2, p3}, Landroid/content/res/TypedArray;->getInt(II)I
move-result p2
invoke-virtual {p0, p2}, Landroidx/preference/SeekBarPreference;->setSeekBarIncrement(I)V
sget p2, Landroidx/preference/R$styleable;->SeekBarPreference_adjustable:I
const/4 p4, 0x1
invoke-virtual {p1, p2, p4}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
move-result p2
iput-boolean p2, p0, Landroidx/preference/SeekBarPreference;->mAdjustable:Z
sget p2, Landroidx/preference/R$styleable;->SeekBarPreference_showSeekBarValue:I
invoke-virtual {p1, p2, p3}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
move-result p2
iput-boolean p2, p0, Landroidx/preference/SeekBarPreference;->mShowSeekBarValue:Z
sget p2, Landroidx/preference/R$styleable;->SeekBarPreference_updatesContinuously:I
invoke-virtual {p1, p2, p3}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
move-result p2
iput-boolean p2, p0, Landroidx/preference/SeekBarPreference;->mUpdatesContinuously:Z
invoke-virtual {p1}, Landroid/content/res/TypedArray;->recycle()V
return-void
.end method
.method private setValueInternal(IZ)V
.locals 1
iget v0, p0, Landroidx/preference/SeekBarPreference;->mMin:I
if-ge p1, v0, :cond_0
move p1, v0
:cond_0
iget v0, p0, Landroidx/preference/SeekBarPreference;->mMax:I
if-le p1, v0, :cond_1
move p1, v0
:cond_1
iget v0, p0, Landroidx/preference/SeekBarPreference;->mSeekBarValue:I
if-eq p1, v0, :cond_2
iput p1, p0, Landroidx/preference/SeekBarPreference;->mSeekBarValue:I
iget v0, p0, Landroidx/preference/SeekBarPreference;->mSeekBarValue:I
invoke-virtual {p0, v0}, Landroidx/preference/SeekBarPreference;->updateLabelValue(I)V
invoke-virtual {p0, p1}, Landroidx/preference/SeekBarPreference;->persistInt(I)Z
if-eqz p2, :cond_2
invoke-virtual {p0}, Landroidx/preference/SeekBarPreference;->notifyChanged()V
:cond_2
return-void
.end method
# virtual methods
.method public getMax()I
.locals 1
iget v0, p0, Landroidx/preference/SeekBarPreference;->mMax:I
return v0
.end method
.method public getMin()I
.locals 1
iget v0, p0, Landroidx/preference/SeekBarPreference;->mMin:I
return v0
.end method
.method public final getSeekBarIncrement()I
.locals 1
iget v0, p0, Landroidx/preference/SeekBarPreference;->mSeekBarIncrement:I
return v0
.end method
.method public getShowSeekBarValue()Z
.locals 1
iget-boolean v0, p0, Landroidx/preference/SeekBarPreference;->mShowSeekBarValue:Z
return v0
.end method
.method public getUpdatesContinuously()Z
.locals 1
iget-boolean v0, p0, Landroidx/preference/SeekBarPreference;->mUpdatesContinuously:Z
return v0
.end method
.method public getValue()I
.locals 1
iget v0, p0, Landroidx/preference/SeekBarPreference;->mSeekBarValue:I
return v0
.end method
.method public isAdjustable()Z
.locals 1
iget-boolean v0, p0, Landroidx/preference/SeekBarPreference;->mAdjustable:Z
return v0
.end method
.method public onBindViewHolder(Landroidx/preference/PreferenceViewHolder;)V
.locals 2
invoke-super {p0, p1}, Landroidx/preference/Preference;->onBindViewHolder(Landroidx/preference/PreferenceViewHolder;)V
iget-object v0, p1, Landroidx/preference/PreferenceViewHolder;->itemView:Landroid/view/View;
iget-object v1, p0, Landroidx/preference/SeekBarPreference;->mSeekBarKeyListener:Landroid/view/View$OnKeyListener;
invoke-virtual {v0, v1}, Landroid/view/View;->setOnKeyListener(Landroid/view/View$OnKeyListener;)V
sget v0, Landroidx/preference/R$id;->seekbar:I
invoke-virtual {p1, v0}, Landroidx/preference/PreferenceViewHolder;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/SeekBar;
iput-object v0, p0, Landroidx/preference/SeekBarPreference;->mSeekBar:Landroid/widget/SeekBar;
sget v0, Landroidx/preference/R$id;->seekbar_value:I
invoke-virtual {p1, v0}, Landroidx/preference/PreferenceViewHolder;->findViewById(I)Landroid/view/View;
move-result-object p1
check-cast p1, Landroid/widget/TextView;
iput-object p1, p0, Landroidx/preference/SeekBarPreference;->mSeekBarValueTextView:Landroid/widget/TextView;
iget-boolean p1, p0, Landroidx/preference/SeekBarPreference;->mShowSeekBarValue:Z
if-eqz p1, :cond_0
iget-object p1, p0, Landroidx/preference/SeekBarPreference;->mSeekBarValueTextView:Landroid/widget/TextView;
const/4 v0, 0x0
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setVisibility(I)V
goto :goto_0
:cond_0
iget-object p1, p0, Landroidx/preference/SeekBarPreference;->mSeekBarValueTextView:Landroid/widget/TextView;
const/16 v0, 0x8
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setVisibility(I)V
const/4 p1, 0x0
iput-object p1, p0, Landroidx/preference/SeekBarPreference;->mSeekBarValueTextView:Landroid/widget/TextView;
:goto_0
iget-object p1, p0, Landroidx/preference/SeekBarPreference;->mSeekBar:Landroid/widget/SeekBar;
if-nez p1, :cond_1
const-string p1, "SeekBarPreference"
const-string v0, "SeekBar view is null in onBindViewHolder."
invoke-static {p1, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
return-void
:cond_1
iget-object v0, p0, Landroidx/preference/SeekBarPreference;->mSeekBarChangeListener:Landroid/widget/SeekBar$OnSeekBarChangeListener;
invoke-virtual {p1, v0}, Landroid/widget/SeekBar;->setOnSeekBarChangeListener(Landroid/widget/SeekBar$OnSeekBarChangeListener;)V
iget-object p1, p0, Landroidx/preference/SeekBarPreference;->mSeekBar:Landroid/widget/SeekBar;
iget v0, p0, Landroidx/preference/SeekBarPreference;->mMax:I
iget v1, p0, Landroidx/preference/SeekBarPreference;->mMin:I
sub-int/2addr v0, v1
invoke-virtual {p1, v0}, Landroid/widget/SeekBar;->setMax(I)V
iget p1, p0, Landroidx/preference/SeekBarPreference;->mSeekBarIncrement:I
if-eqz p1, :cond_2
iget-object v0, p0, Landroidx/preference/SeekBarPreference;->mSeekBar:Landroid/widget/SeekBar;
invoke-virtual {v0, p1}, Landroid/widget/SeekBar;->setKeyProgressIncrement(I)V
goto :goto_1
:cond_2
iget-object p1, p0, Landroidx/preference/SeekBarPreference;->mSeekBar:Landroid/widget/SeekBar;
invoke-virtual {p1}, Landroid/widget/SeekBar;->getKeyProgressIncrement()I
move-result p1
iput p1, p0, Landroidx/preference/SeekBarPreference;->mSeekBarIncrement:I
:goto_1
iget-object p1, p0, Landroidx/preference/SeekBarPreference;->mSeekBar:Landroid/widget/SeekBar;
iget v0, p0, Landroidx/preference/SeekBarPreference;->mSeekBarValue:I
iget v1, p0, Landroidx/preference/SeekBarPreference;->mMin:I
sub-int/2addr v0, v1
invoke-virtual {p1, v0}, Landroid/widget/SeekBar;->setProgress(I)V
iget p1, p0, Landroidx/preference/SeekBarPreference;->mSeekBarValue:I
invoke-virtual {p0, p1}, Landroidx/preference/SeekBarPreference;->updateLabelValue(I)V
iget-object p1, p0, Landroidx/preference/SeekBarPreference;->mSeekBar:Landroid/widget/SeekBar;
invoke-virtual {p0}, Landroidx/preference/SeekBarPreference;->isEnabled()Z
move-result v0
invoke-virtual {p1, v0}, Landroid/widget/SeekBar;->setEnabled(Z)V
return-void
.end method
.method protected onGetDefaultValue(Landroid/content/res/TypedArray;I)Ljava/lang/Object;
.locals 1
const/4 v0, 0x0
invoke-virtual {p1, p2, v0}, Landroid/content/res/TypedArray;->getInt(II)I
move-result p1
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p1
return-object p1
.end method
.method protected onRestoreInstanceState(Landroid/os/Parcelable;)V
.locals 2
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v0
const-class v1, Landroidx/preference/SeekBarPreference$SavedState;
invoke-virtual {v0, v1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-nez v0, :cond_0
invoke-super {p0, p1}, Landroidx/preference/Preference;->onRestoreInstanceState(Landroid/os/Parcelable;)V
return-void
:cond_0
check-cast p1, Landroidx/preference/SeekBarPreference$SavedState;
invoke-virtual {p1}, Landroidx/preference/SeekBarPreference$SavedState;->getSuperState()Landroid/os/Parcelable;
move-result-object v0
invoke-super {p0, v0}, Landroidx/preference/Preference;->onRestoreInstanceState(Landroid/os/Parcelable;)V
iget v0, p1, Landroidx/preference/SeekBarPreference$SavedState;->mSeekBarValue:I
iput v0, p0, Landroidx/preference/SeekBarPreference;->mSeekBarValue:I
iget v0, p1, Landroidx/preference/SeekBarPreference$SavedState;->mMin:I
iput v0, p0, Landroidx/preference/SeekBarPreference;->mMin:I
iget p1, p1, Landroidx/preference/SeekBarPreference$SavedState;->mMax:I
iput p1, p0, Landroidx/preference/SeekBarPreference;->mMax:I
invoke-virtual {p0}, Landroidx/preference/SeekBarPreference;->notifyChanged()V
return-void
.end method
.method protected onSaveInstanceState()Landroid/os/Parcelable;
.locals 2
invoke-super {p0}, Landroidx/preference/Preference;->onSaveInstanceState()Landroid/os/Parcelable;
move-result-object v0
invoke-virtual {p0}, Landroidx/preference/SeekBarPreference;->isPersistent()Z
move-result v1
if-eqz v1, :cond_0
return-object v0
:cond_0
new-instance v1, Landroidx/preference/SeekBarPreference$SavedState;
invoke-direct {v1, v0}, Landroidx/preference/SeekBarPreference$SavedState;-><init>(Landroid/os/Parcelable;)V
iget v0, p0, Landroidx/preference/SeekBarPreference;->mSeekBarValue:I
iput v0, v1, Landroidx/preference/SeekBarPreference$SavedState;->mSeekBarValue:I
iget v0, p0, Landroidx/preference/SeekBarPreference;->mMin:I
iput v0, v1, Landroidx/preference/SeekBarPreference$SavedState;->mMin:I
iget v0, p0, Landroidx/preference/SeekBarPreference;->mMax:I
iput v0, v1, Landroidx/preference/SeekBarPreference$SavedState;->mMax:I
return-object v1
.end method
.method protected onSetInitialValue(Ljava/lang/Object;)V
.locals 0
if-nez p1, :cond_0
const/4 p1, 0x0
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p1
:cond_0
check-cast p1, Ljava/lang/Integer;
invoke-virtual {p1}, Ljava/lang/Integer;->intValue()I
move-result p1
invoke-virtual {p0, p1}, Landroidx/preference/SeekBarPreference;->getPersistedInt(I)I
move-result p1
invoke-virtual {p0, p1}, Landroidx/preference/SeekBarPreference;->setValue(I)V
return-void
.end method
.method public setAdjustable(Z)V
.locals 0
iput-boolean p1, p0, Landroidx/preference/SeekBarPreference;->mAdjustable:Z
return-void
.end method
.method public final setMax(I)V
.locals 1
iget v0, p0, Landroidx/preference/SeekBarPreference;->mMin:I
if-ge p1, v0, :cond_0
move p1, v0
:cond_0
iget v0, p0, Landroidx/preference/SeekBarPreference;->mMax:I
if-eq p1, v0, :cond_1
iput p1, p0, Landroidx/preference/SeekBarPreference;->mMax:I
invoke-virtual {p0}, Landroidx/preference/SeekBarPreference;->notifyChanged()V
:cond_1
return-void
.end method
.method public setMin(I)V
.locals 1
iget v0, p0, Landroidx/preference/SeekBarPreference;->mMax:I
if-le p1, v0, :cond_0
move p1, v0
:cond_0
iget v0, p0, Landroidx/preference/SeekBarPreference;->mMin:I
if-eq p1, v0, :cond_1
iput p1, p0, Landroidx/preference/SeekBarPreference;->mMin:I
invoke-virtual {p0}, Landroidx/preference/SeekBarPreference;->notifyChanged()V
:cond_1
return-void
.end method
.method public final setSeekBarIncrement(I)V
.locals 2
iget v0, p0, Landroidx/preference/SeekBarPreference;->mSeekBarIncrement:I
if-eq p1, v0, :cond_0
iget v0, p0, Landroidx/preference/SeekBarPreference;->mMax:I
iget v1, p0, Landroidx/preference/SeekBarPreference;->mMin:I
sub-int/2addr v0, v1
invoke-static {p1}, Ljava/lang/Math;->abs(I)I
move-result p1
invoke-static {v0, p1}, Ljava/lang/Math;->min(II)I
move-result p1
iput p1, p0, Landroidx/preference/SeekBarPreference;->mSeekBarIncrement:I
invoke-virtual {p0}, Landroidx/preference/SeekBarPreference;->notifyChanged()V
:cond_0
return-void
.end method
.method public setShowSeekBarValue(Z)V
.locals 0
iput-boolean p1, p0, Landroidx/preference/SeekBarPreference;->mShowSeekBarValue:Z
invoke-virtual {p0}, Landroidx/preference/SeekBarPreference;->notifyChanged()V
return-void
.end method
.method public setUpdatesContinuously(Z)V
.locals 0
iput-boolean p1, p0, Landroidx/preference/SeekBarPreference;->mUpdatesContinuously:Z
return-void
.end method
.method public setValue(I)V
.locals 1
const/4 v0, 0x1
invoke-direct {p0, p1, v0}, Landroidx/preference/SeekBarPreference;->setValueInternal(IZ)V
return-void
.end method
.method syncValueInternal(Landroid/widget/SeekBar;)V
.locals 2
iget v0, p0, Landroidx/preference/SeekBarPreference;->mMin:I
invoke-virtual {p1}, Landroid/widget/SeekBar;->getProgress()I
move-result v1
add-int/2addr v0, v1
iget v1, p0, Landroidx/preference/SeekBarPreference;->mSeekBarValue:I
if-eq v0, v1, :cond_1
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
invoke-virtual {p0, v1}, Landroidx/preference/SeekBarPreference;->callChangeListener(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
const/4 p1, 0x0
invoke-direct {p0, v0, p1}, Landroidx/preference/SeekBarPreference;->setValueInternal(IZ)V
return-void
:cond_0
iget v0, p0, Landroidx/preference/SeekBarPreference;->mSeekBarValue:I
iget v1, p0, Landroidx/preference/SeekBarPreference;->mMin:I
sub-int/2addr v0, v1
invoke-virtual {p1, v0}, Landroid/widget/SeekBar;->setProgress(I)V
iget p1, p0, Landroidx/preference/SeekBarPreference;->mSeekBarValue:I
invoke-virtual {p0, p1}, Landroidx/preference/SeekBarPreference;->updateLabelValue(I)V
:cond_1
return-void
.end method
.method updateLabelValue(I)V
.locals 1
iget-object v0, p0, Landroidx/preference/SeekBarPreference;->mSeekBarValueTextView:Landroid/widget/TextView;
if-eqz v0, :cond_0
invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object p1
invoke-virtual {v0, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
:cond_0
return-void
.end method