559 lines
15 KiB
Smali
559 lines
15 KiB
Smali
|
.class public Landroidx/preference/ListPreference;
|
||
|
.super Landroidx/preference/DialogPreference;
|
||
|
.source "ListPreference.java"
|
||
|
|
||
|
|
||
|
# annotations
|
||
|
.annotation system Ldalvik/annotation/MemberClasses;
|
||
|
value = {
|
||
|
Landroidx/preference/ListPreference$SimpleSummaryProvider;,
|
||
|
Landroidx/preference/ListPreference$SavedState;
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
|
||
|
# static fields
|
||
|
.field public static final TAG:Ljava/lang/String; = "ListPreference"
|
||
|
|
||
|
|
||
|
# instance fields
|
||
|
.field public mEntries:[Ljava/lang/CharSequence;
|
||
|
|
||
|
.field public mEntryValues:[Ljava/lang/CharSequence;
|
||
|
|
||
|
.field public mSummary:Ljava/lang/String;
|
||
|
|
||
|
.field public mValue:Ljava/lang/String;
|
||
|
|
||
|
.field public mValueSet:Z
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method public constructor <init>(Landroid/content/Context;)V
|
||
|
.locals 1
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
invoke-direct {p0, p1, v0}, Landroidx/preference/ListPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
||
|
.locals 2
|
||
|
|
||
|
sget v0, Landroidx/preference/R$attr;->dialogPreferenceStyle:I
|
||
|
|
||
|
const v1, 0x1010091
|
||
|
|
||
|
invoke-static {p1, v0, v1}, Landroidx/core/content/res/TypedArrayUtils;->getAttr(Landroid/content/Context;II)I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
invoke-direct {p0, p1, p2, v0}, Landroidx/preference/ListPreference;-><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/ListPreference;-><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 3
|
||
|
|
||
|
invoke-direct {p0, p1, p2, p3, p4}, Landroidx/preference/DialogPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
|
||
|
|
||
|
sget-object v0, Landroidx/preference/R$styleable;->ListPreference:[I
|
||
|
|
||
|
invoke-virtual {p1, p2, v0, p3, p4}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
sget v1, Landroidx/preference/R$styleable;->ListPreference_entries:I
|
||
|
|
||
|
sget v2, Landroidx/preference/R$styleable;->ListPreference_android_entries:I
|
||
|
|
||
|
invoke-static {v0, v1, v2}, Landroidx/core/content/res/TypedArrayUtils;->getTextArray(Landroid/content/res/TypedArray;II)[Ljava/lang/CharSequence;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
iput-object v1, p0, Landroidx/preference/ListPreference;->mEntries:[Ljava/lang/CharSequence;
|
||
|
|
||
|
sget v1, Landroidx/preference/R$styleable;->ListPreference_entryValues:I
|
||
|
|
||
|
sget v2, Landroidx/preference/R$styleable;->ListPreference_android_entryValues:I
|
||
|
|
||
|
invoke-static {v0, v1, v2}, Landroidx/core/content/res/TypedArrayUtils;->getTextArray(Landroid/content/res/TypedArray;II)[Ljava/lang/CharSequence;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
iput-object v1, p0, Landroidx/preference/ListPreference;->mEntryValues:[Ljava/lang/CharSequence;
|
||
|
|
||
|
sget v1, Landroidx/preference/R$styleable;->ListPreference_useSimpleSummaryProvider:I
|
||
|
|
||
|
const/4 v2, 0x0
|
||
|
|
||
|
invoke-static {v0, v1, v1, v2}, Landroidx/core/content/res/TypedArrayUtils;->getBoolean(Landroid/content/res/TypedArray;IIZ)Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-eqz v1, :cond_0
|
||
|
|
||
|
invoke-static {}, Landroidx/preference/ListPreference$SimpleSummaryProvider;->getInstance()Landroidx/preference/ListPreference$SimpleSummaryProvider;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {p0, v1}, Landroidx/preference/Preference;->setSummaryProvider(Landroidx/preference/Preference$SummaryProvider;)V
|
||
|
|
||
|
:cond_0
|
||
|
invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V
|
||
|
|
||
|
sget-object v0, Landroidx/preference/R$styleable;->Preference:[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;->Preference_summary:I
|
||
|
|
||
|
sget p3, Landroidx/preference/R$styleable;->Preference_android_summary:I
|
||
|
|
||
|
invoke-static {p1, p2, p3}, Landroidx/core/content/res/TypedArrayUtils;->getString(Landroid/content/res/TypedArray;II)Ljava/lang/String;
|
||
|
|
||
|
move-result-object p2
|
||
|
|
||
|
iput-object p2, p0, Landroidx/preference/ListPreference;->mSummary:Ljava/lang/String;
|
||
|
|
||
|
invoke-virtual {p1}, Landroid/content/res/TypedArray;->recycle()V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method private getValueIndex()I
|
||
|
.locals 1
|
||
|
|
||
|
iget-object v0, p0, Landroidx/preference/ListPreference;->mValue:Ljava/lang/String;
|
||
|
|
||
|
invoke-virtual {p0, v0}, Landroidx/preference/ListPreference;->findIndexOfValue(Ljava/lang/String;)I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
return v0
|
||
|
.end method
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method public findIndexOfValue(Ljava/lang/String;)I
|
||
|
.locals 2
|
||
|
|
||
|
if-eqz p1, :cond_1
|
||
|
|
||
|
iget-object v0, p0, Landroidx/preference/ListPreference;->mEntryValues:[Ljava/lang/CharSequence;
|
||
|
|
||
|
if-eqz v0, :cond_1
|
||
|
|
||
|
array-length v0, v0
|
||
|
|
||
|
add-int/lit8 v0, v0, -0x1
|
||
|
|
||
|
:goto_0
|
||
|
if-ltz v0, :cond_1
|
||
|
|
||
|
iget-object v1, p0, Landroidx/preference/ListPreference;->mEntryValues:[Ljava/lang/CharSequence;
|
||
|
|
||
|
aget-object v1, v1, v0
|
||
|
|
||
|
invoke-virtual {v1, p1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-eqz v1, :cond_0
|
||
|
|
||
|
return v0
|
||
|
|
||
|
:cond_0
|
||
|
add-int/lit8 v0, v0, -0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_1
|
||
|
const/4 p1, -0x1
|
||
|
|
||
|
return p1
|
||
|
.end method
|
||
|
|
||
|
.method public getEntries()[Ljava/lang/CharSequence;
|
||
|
.locals 1
|
||
|
|
||
|
iget-object v0, p0, Landroidx/preference/ListPreference;->mEntries:[Ljava/lang/CharSequence;
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public getEntry()Ljava/lang/CharSequence;
|
||
|
.locals 2
|
||
|
|
||
|
invoke-direct {p0}, Landroidx/preference/ListPreference;->getValueIndex()I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-ltz v0, :cond_0
|
||
|
|
||
|
iget-object v1, p0, Landroidx/preference/ListPreference;->mEntries:[Ljava/lang/CharSequence;
|
||
|
|
||
|
if-eqz v1, :cond_0
|
||
|
|
||
|
aget-object v0, v1, v0
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_0
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
:goto_0
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public getEntryValues()[Ljava/lang/CharSequence;
|
||
|
.locals 1
|
||
|
|
||
|
iget-object v0, p0, Landroidx/preference/ListPreference;->mEntryValues:[Ljava/lang/CharSequence;
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public getSummary()Ljava/lang/CharSequence;
|
||
|
.locals 5
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/preference/Preference;->getSummaryProvider()Landroidx/preference/Preference$SummaryProvider;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/preference/Preference;->getSummaryProvider()Landroidx/preference/Preference$SummaryProvider;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-interface {v0, p0}, Landroidx/preference/Preference$SummaryProvider;->provideSummary(Landroidx/preference/Preference;)Ljava/lang/CharSequence;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
return-object v0
|
||
|
|
||
|
:cond_0
|
||
|
invoke-virtual {p0}, Landroidx/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-super {p0}, Landroidx/preference/Preference;->getSummary()Ljava/lang/CharSequence;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
iget-object v2, p0, Landroidx/preference/ListPreference;->mSummary:Ljava/lang/String;
|
||
|
|
||
|
if-nez v2, :cond_1
|
||
|
|
||
|
return-object v1
|
||
|
|
||
|
:cond_1
|
||
|
const/4 v3, 0x1
|
||
|
|
||
|
new-array v3, v3, [Ljava/lang/Object;
|
||
|
|
||
|
const/4 v4, 0x0
|
||
|
|
||
|
if-nez v0, :cond_2
|
||
|
|
||
|
const-string v0, ""
|
||
|
|
||
|
:cond_2
|
||
|
aput-object v0, v3, v4
|
||
|
|
||
|
invoke-static {v2, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-static {v0, v1}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z
|
||
|
|
||
|
move-result v2
|
||
|
|
||
|
if-eqz v2, :cond_3
|
||
|
|
||
|
return-object v1
|
||
|
|
||
|
:cond_3
|
||
|
const-string v1, "ListPreference"
|
||
|
|
||
|
const-string v2, "Setting a summary with a String formatting marker is no longer supported. You should use a SummaryProvider instead."
|
||
|
|
||
|
invoke-static {v1, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public getValue()Ljava/lang/String;
|
||
|
.locals 1
|
||
|
|
||
|
iget-object v0, p0, Landroidx/preference/ListPreference;->mValue:Ljava/lang/String;
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public onGetDefaultValue(Landroid/content/res/TypedArray;I)Ljava/lang/Object;
|
||
|
.locals 0
|
||
|
|
||
|
invoke-virtual {p1, p2}, Landroid/content/res/TypedArray;->getString(I)Ljava/lang/String;
|
||
|
|
||
|
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/ListPreference$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/ListPreference$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-object p1, p1, Landroidx/preference/ListPreference$SavedState;->mValue:Ljava/lang/String;
|
||
|
|
||
|
invoke-virtual {p0, p1}, Landroidx/preference/ListPreference;->setValue(Ljava/lang/String;)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/ListPreference$SavedState;
|
||
|
|
||
|
invoke-direct {v1, v0}, Landroidx/preference/ListPreference$SavedState;-><init>(Landroid/os/Parcelable;)V
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/preference/ListPreference;->getValue()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
iput-object v0, v1, Landroidx/preference/ListPreference$SavedState;->mValue:Ljava/lang/String;
|
||
|
|
||
|
return-object v1
|
||
|
.end method
|
||
|
|
||
|
.method public onSetInitialValue(Ljava/lang/Object;)V
|
||
|
.locals 0
|
||
|
|
||
|
check-cast p1, Ljava/lang/String;
|
||
|
|
||
|
invoke-virtual {p0, p1}, Landroidx/preference/Preference;->getPersistedString(Ljava/lang/String;)Ljava/lang/String;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-virtual {p0, p1}, Landroidx/preference/ListPreference;->setValue(Ljava/lang/String;)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public setEntries(I)V
|
||
|
.locals 1
|
||
|
.param p1 # I
|
||
|
.annotation build Landroidx/annotation/ArrayRes;
|
||
|
.end annotation
|
||
|
.end param
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/preference/Preference;->getContext()Landroid/content/Context;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0, p1}, Landroid/content/res/Resources;->getTextArray(I)[Ljava/lang/CharSequence;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-virtual {p0, p1}, Landroidx/preference/ListPreference;->setEntries([Ljava/lang/CharSequence;)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public setEntries([Ljava/lang/CharSequence;)V
|
||
|
.locals 0
|
||
|
|
||
|
iput-object p1, p0, Landroidx/preference/ListPreference;->mEntries:[Ljava/lang/CharSequence;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public setEntryValues(I)V
|
||
|
.locals 1
|
||
|
.param p1 # I
|
||
|
.annotation build Landroidx/annotation/ArrayRes;
|
||
|
.end annotation
|
||
|
.end param
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/preference/Preference;->getContext()Landroid/content/Context;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0, p1}, Landroid/content/res/Resources;->getTextArray(I)[Ljava/lang/CharSequence;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-virtual {p0, p1}, Landroidx/preference/ListPreference;->setEntryValues([Ljava/lang/CharSequence;)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public setEntryValues([Ljava/lang/CharSequence;)V
|
||
|
.locals 0
|
||
|
|
||
|
iput-object p1, p0, Landroidx/preference/ListPreference;->mEntryValues:[Ljava/lang/CharSequence;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public setSummary(Ljava/lang/CharSequence;)V
|
||
|
.locals 1
|
||
|
|
||
|
invoke-super {p0, p1}, Landroidx/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V
|
||
|
|
||
|
if-nez p1, :cond_0
|
||
|
|
||
|
iget-object v0, p0, Landroidx/preference/ListPreference;->mSummary:Ljava/lang/String;
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
const/4 p1, 0x0
|
||
|
|
||
|
iput-object p1, p0, Landroidx/preference/ListPreference;->mSummary:Ljava/lang/String;
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_0
|
||
|
if-eqz p1, :cond_1
|
||
|
|
||
|
iget-object v0, p0, Landroidx/preference/ListPreference;->mSummary:Ljava/lang/String;
|
||
|
|
||
|
invoke-virtual {p1, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-nez v0, :cond_1
|
||
|
|
||
|
invoke-interface {p1}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
iput-object p1, p0, Landroidx/preference/ListPreference;->mSummary:Ljava/lang/String;
|
||
|
|
||
|
:cond_1
|
||
|
:goto_0
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public setValue(Ljava/lang/String;)V
|
||
|
.locals 3
|
||
|
|
||
|
iget-object v0, p0, Landroidx/preference/ListPreference;->mValue:Ljava/lang/String;
|
||
|
|
||
|
invoke-static {v0, p1}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
const/4 v1, 0x1
|
||
|
|
||
|
xor-int/2addr v0, v1
|
||
|
|
||
|
if-nez v0, :cond_0
|
||
|
|
||
|
iget-boolean v2, p0, Landroidx/preference/ListPreference;->mValueSet:Z
|
||
|
|
||
|
if-nez v2, :cond_1
|
||
|
|
||
|
:cond_0
|
||
|
iput-object p1, p0, Landroidx/preference/ListPreference;->mValue:Ljava/lang/String;
|
||
|
|
||
|
iput-boolean v1, p0, Landroidx/preference/ListPreference;->mValueSet:Z
|
||
|
|
||
|
invoke-virtual {p0, p1}, Landroidx/preference/Preference;->persistString(Ljava/lang/String;)Z
|
||
|
|
||
|
if-eqz v0, :cond_1
|
||
|
|
||
|
invoke-virtual {p0}, Landroidx/preference/Preference;->notifyChanged()V
|
||
|
|
||
|
:cond_1
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public setValueIndex(I)V
|
||
|
.locals 1
|
||
|
|
||
|
iget-object v0, p0, Landroidx/preference/ListPreference;->mEntryValues:[Ljava/lang/CharSequence;
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
aget-object p1, v0, p1
|
||
|
|
||
|
invoke-interface {p1}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-virtual {p0, p1}, Landroidx/preference/ListPreference;->setValue(Ljava/lang/String;)V
|
||
|
|
||
|
:cond_0
|
||
|
return-void
|
||
|
.end method
|