Make SeekBarPreference to be selectable

Fixes: 132983200
Test: make RunSettingsRoboTests, manual
Change-Id: I3d4bc59d948236ff2482945a4fc976ee61c37c27
This commit is contained in:
Raff Tsai
2019-05-21 11:30:13 +08:00
parent fa5aaf9212
commit 81b9f5083d
4 changed files with 100 additions and 4 deletions

View File

@@ -69,6 +69,13 @@ public class SeekBarPreference extends RestrictedPreference
com.android.internal.R.layout.preference_widget_seekbar);
a.recycle();
a = context.obtainStyledAttributes(
attrs, com.android.internal.R.styleable.Preference, defStyleAttr, defStyleRes);
final boolean isSelectable = a.getBoolean(
com.android.settings.R.styleable.Preference_android_selectable, false);
setSelectable(isSelectable);
a.recycle();
setLayoutResource(layoutResId);
}
@@ -93,7 +100,11 @@ public class SeekBarPreference extends RestrictedPreference
@Override
public boolean isSelectable() {
return isDisabledByAdmin();
if(isDisabledByAdmin()) {
return true;
} else {
return super.isSelectable();
}
}
@Override