Override getDefaultValueType with values based on the preference (#167)

This commit is contained in:
Syer10
2021-08-01 08:43:29 -04:00
committed by GitHub
parent fb862e23e5
commit 5a3621fe39
5 changed files with 20 additions and 1 deletions

View File

@@ -44,4 +44,9 @@ public class EditTextPreference extends DialogPreference {
public interface OnBindEditTextListener {
void onBindEditText(@NonNull EditText editText);
}
@Override
public String getDefaultValueType() {
return "String";
}
}

View File

@@ -42,4 +42,9 @@ public class ListPreference extends Preference {
public String getValue() { throw new RuntimeException("Stub!"); }
public void setValue(String value) { throw new RuntimeException("Stub!"); }
@Override
public String getDefaultValueType() {
return "String";
}
}

View File

@@ -29,4 +29,9 @@ public class MultiSelectListPreference extends DialogPreference {
public Set<String> getValues() { throw new RuntimeException("Stub!"); }
public int findIndexOfValue(String value) { throw new RuntimeException("Stub!"); }
@Override
public String getDefaultValueType() {
return "Set";
}
}

View File

@@ -9,7 +9,7 @@ package androidx.preference;
import android.content.Context;
public class SwitchPreferenceCompat extends Preference {
public class SwitchPreferenceCompat extends TwoStatePreference {
// reference: https://android.googlesource.com/platform/frameworks/support/+/996971f962fcd554339a7cb2859cef9ca89dbcb7/preference/preference/src/main/java/androidx/preference/CheckBoxPreference.java
public SwitchPreferenceCompat(Context context) {

View File

@@ -29,4 +29,8 @@ public class TwoStatePreference extends Preference {
public void setDisableDependentsState(boolean disableDependentsState) { throw new RuntimeException("Stub!"); }
@Override
public String getDefaultValueType() {
return "Boolean";
}
}