apkfuckery/com.discord/smali/androidx/preference/TwoStatePreference.smali

514 lines
12 KiB
Smali
Raw Normal View History

2020-05-17 12:40:10 +00:00
.class public abstract Landroidx/preference/TwoStatePreference;
.super Landroidx/preference/Preference;
.source "TwoStatePreference.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/preference/TwoStatePreference$SavedState;
}
.end annotation
# instance fields
.field public mChecked:Z
.field public mCheckedSet:Z
.field public mDisableDependentsState:Z
.field public mSummaryOff:Ljava/lang/CharSequence;
.field public mSummaryOn:Ljava/lang/CharSequence;
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 1
const/4 v0, 0x0
invoke-direct {p0, p1, v0}, Landroidx/preference/TwoStatePreference;-><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
const/4 v0, 0x0
invoke-direct {p0, p1, p2, v0}, Landroidx/preference/TwoStatePreference;-><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/TwoStatePreference;-><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 0
invoke-direct {p0, p1, p2, p3, p4}, Landroidx/preference/Preference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
return-void
.end method
# virtual methods
.method public getDisableDependentsState()Z
.locals 1
iget-boolean v0, p0, Landroidx/preference/TwoStatePreference;->mDisableDependentsState:Z
return v0
.end method
.method public getSummaryOff()Ljava/lang/CharSequence;
.locals 1
iget-object v0, p0, Landroidx/preference/TwoStatePreference;->mSummaryOff:Ljava/lang/CharSequence;
return-object v0
.end method
.method public getSummaryOn()Ljava/lang/CharSequence;
.locals 1
iget-object v0, p0, Landroidx/preference/TwoStatePreference;->mSummaryOn:Ljava/lang/CharSequence;
return-object v0
.end method
.method public isChecked()Z
.locals 1
iget-boolean v0, p0, Landroidx/preference/TwoStatePreference;->mChecked:Z
return v0
.end method
.method public onClick()V
.locals 2
invoke-super {p0}, Landroidx/preference/Preference;->onClick()V
invoke-virtual {p0}, Landroidx/preference/TwoStatePreference;->isChecked()Z
move-result v0
xor-int/lit8 v0, v0, 0x1
invoke-static {v0}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v1
invoke-virtual {p0, v1}, Landroidx/preference/Preference;->callChangeListener(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
invoke-virtual {p0, v0}, Landroidx/preference/TwoStatePreference;->setChecked(Z)V
:cond_0
return-void
.end method
.method public onGetDefaultValue(Landroid/content/res/TypedArray;I)Ljava/lang/Object;
.locals 1
const/4 v0, 0x0
invoke-virtual {p1, p2, v0}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
move-result p1
invoke-static {p1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object p1
return-object p1
.end method
.method public onRestoreInstanceState(Landroid/os/Parcelable;)V
.locals 2
if-eqz p1, :cond_1
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v0
const-class v1, Landroidx/preference/TwoStatePreference$SavedState;
invoke-virtual {v0, v1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-nez v0, :cond_0
goto :goto_0
:cond_0
check-cast p1, Landroidx/preference/TwoStatePreference$SavedState;
invoke-virtual {p1}, Landroid/view/AbsSavedState;->getSuperState()Landroid/os/Parcelable;
move-result-object v0
invoke-super {p0, v0}, Landroidx/preference/Preference;->onRestoreInstanceState(Landroid/os/Parcelable;)V
iget-boolean p1, p1, Landroidx/preference/TwoStatePreference$SavedState;->mChecked:Z
invoke-virtual {p0, p1}, Landroidx/preference/TwoStatePreference;->setChecked(Z)V
return-void
:cond_1
:goto_0
invoke-super {p0, p1}, Landroidx/preference/Preference;->onRestoreInstanceState(Landroid/os/Parcelable;)V
return-void
.end method
.method public 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/Preference;->isPersistent()Z
move-result v1
if-eqz v1, :cond_0
return-object v0
:cond_0
new-instance v1, Landroidx/preference/TwoStatePreference$SavedState;
invoke-direct {v1, v0}, Landroidx/preference/TwoStatePreference$SavedState;-><init>(Landroid/os/Parcelable;)V
invoke-virtual {p0}, Landroidx/preference/TwoStatePreference;->isChecked()Z
move-result v0
iput-boolean v0, v1, Landroidx/preference/TwoStatePreference$SavedState;->mChecked:Z
return-object v1
.end method
.method public onSetInitialValue(Ljava/lang/Object;)V
.locals 0
if-nez p1, :cond_0
2020-07-08 16:44:49 +00:00
sget-object p1, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean;
2020-05-17 12:40:10 +00:00
:cond_0
check-cast p1, Ljava/lang/Boolean;
invoke-virtual {p1}, Ljava/lang/Boolean;->booleanValue()Z
move-result p1
invoke-virtual {p0, p1}, Landroidx/preference/Preference;->getPersistedBoolean(Z)Z
move-result p1
invoke-virtual {p0, p1}, Landroidx/preference/TwoStatePreference;->setChecked(Z)V
return-void
.end method
.method public setChecked(Z)V
.locals 3
iget-boolean v0, p0, Landroidx/preference/TwoStatePreference;->mChecked:Z
const/4 v1, 0x1
if-eq v0, p1, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
if-nez v0, :cond_1
iget-boolean v2, p0, Landroidx/preference/TwoStatePreference;->mCheckedSet:Z
if-nez v2, :cond_2
:cond_1
iput-boolean p1, p0, Landroidx/preference/TwoStatePreference;->mChecked:Z
iput-boolean v1, p0, Landroidx/preference/TwoStatePreference;->mCheckedSet:Z
invoke-virtual {p0, p1}, Landroidx/preference/Preference;->persistBoolean(Z)Z
if-eqz v0, :cond_2
invoke-virtual {p0}, Landroidx/preference/TwoStatePreference;->shouldDisableDependents()Z
move-result p1
invoke-virtual {p0, p1}, Landroidx/preference/Preference;->notifyDependencyChange(Z)V
invoke-virtual {p0}, Landroidx/preference/Preference;->notifyChanged()V
:cond_2
return-void
.end method
.method public setDisableDependentsState(Z)V
.locals 0
iput-boolean p1, p0, Landroidx/preference/TwoStatePreference;->mDisableDependentsState:Z
return-void
.end method
.method public setSummaryOff(I)V
.locals 1
invoke-virtual {p0}, Landroidx/preference/Preference;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0, p1}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object p1
invoke-virtual {p0, p1}, Landroidx/preference/TwoStatePreference;->setSummaryOff(Ljava/lang/CharSequence;)V
return-void
.end method
.method public setSummaryOff(Ljava/lang/CharSequence;)V
.locals 0
iput-object p1, p0, Landroidx/preference/TwoStatePreference;->mSummaryOff:Ljava/lang/CharSequence;
invoke-virtual {p0}, Landroidx/preference/TwoStatePreference;->isChecked()Z
move-result p1
if-nez p1, :cond_0
invoke-virtual {p0}, Landroidx/preference/Preference;->notifyChanged()V
:cond_0
return-void
.end method
.method public setSummaryOn(I)V
.locals 1
invoke-virtual {p0}, Landroidx/preference/Preference;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0, p1}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object p1
invoke-virtual {p0, p1}, Landroidx/preference/TwoStatePreference;->setSummaryOn(Ljava/lang/CharSequence;)V
return-void
.end method
.method public setSummaryOn(Ljava/lang/CharSequence;)V
.locals 0
iput-object p1, p0, Landroidx/preference/TwoStatePreference;->mSummaryOn:Ljava/lang/CharSequence;
invoke-virtual {p0}, Landroidx/preference/TwoStatePreference;->isChecked()Z
move-result p1
if-eqz p1, :cond_0
invoke-virtual {p0}, Landroidx/preference/Preference;->notifyChanged()V
:cond_0
return-void
.end method
.method public shouldDisableDependents()Z
.locals 3
iget-boolean v0, p0, Landroidx/preference/TwoStatePreference;->mDisableDependentsState:Z
const/4 v1, 0x1
const/4 v2, 0x0
if-eqz v0, :cond_0
iget-boolean v0, p0, Landroidx/preference/TwoStatePreference;->mChecked:Z
goto :goto_0
:cond_0
iget-boolean v0, p0, Landroidx/preference/TwoStatePreference;->mChecked:Z
if-nez v0, :cond_1
const/4 v0, 0x1
goto :goto_0
:cond_1
const/4 v0, 0x0
:goto_0
if-nez v0, :cond_3
invoke-super {p0}, Landroidx/preference/Preference;->shouldDisableDependents()Z
move-result v0
if-eqz v0, :cond_2
goto :goto_1
:cond_2
const/4 v1, 0x0
:cond_3
:goto_1
return v1
.end method
.method public syncSummaryView(Landroid/view/View;)V
.locals 4
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
instance-of v0, p1, Landroid/widget/TextView;
if-nez v0, :cond_0
return-void
:cond_0
check-cast p1, Landroid/widget/TextView;
const/4 v0, 0x1
iget-boolean v1, p0, Landroidx/preference/TwoStatePreference;->mChecked:Z
const/4 v2, 0x0
if-eqz v1, :cond_1
iget-object v1, p0, Landroidx/preference/TwoStatePreference;->mSummaryOn:Ljava/lang/CharSequence;
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_1
iget-object v0, p0, Landroidx/preference/TwoStatePreference;->mSummaryOn:Ljava/lang/CharSequence;
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
:goto_0
const/4 v0, 0x0
goto :goto_1
:cond_1
iget-boolean v1, p0, Landroidx/preference/TwoStatePreference;->mChecked:Z
if-nez v1, :cond_2
iget-object v1, p0, Landroidx/preference/TwoStatePreference;->mSummaryOff:Ljava/lang/CharSequence;
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_2
iget-object v0, p0, Landroidx/preference/TwoStatePreference;->mSummaryOff:Ljava/lang/CharSequence;
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
goto :goto_0
:cond_2
:goto_1
if-eqz v0, :cond_3
invoke-virtual {p0}, Landroidx/preference/Preference;->getSummary()Ljava/lang/CharSequence;
move-result-object v1
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v3
if-nez v3, :cond_3
invoke-virtual {p1, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
const/4 v0, 0x0
:cond_3
const/16 v1, 0x8
if-nez v0, :cond_4
2020-07-08 16:44:49 +00:00
goto :goto_2
2020-05-17 12:40:10 +00:00
:cond_4
2020-07-08 16:44:49 +00:00
const/16 v2, 0x8
:goto_2
2020-05-17 12:40:10 +00:00
invoke-virtual {p1}, Landroid/widget/TextView;->getVisibility()I
move-result v0
2020-07-08 16:44:49 +00:00
if-eq v2, v0, :cond_5
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-virtual {p1, v2}, Landroid/widget/TextView;->setVisibility(I)V
2020-05-17 12:40:10 +00:00
:cond_5
return-void
.end method
.method public syncSummaryView(Landroidx/preference/PreferenceViewHolder;)V
.locals 1
const v0, 0x1020010
invoke-virtual {p1, v0}, Landroidx/preference/PreferenceViewHolder;->findViewById(I)Landroid/view/View;
move-result-object p1
invoke-virtual {p0, p1}, Landroidx/preference/TwoStatePreference;->syncSummaryView(Landroid/view/View;)V
return-void
.end method