use of androidx.preference.PreferenceCategory in project android_packages_apps_Settings by omnirom.
the class ToggleFeaturePreferenceFragment method initSettingsPreference.
protected void initSettingsPreference() {
if (mSettingsTitle == null || mSettingsIntent == null) {
return;
}
// Show the "Settings" menu as if it were a preference screen.
mSettingsPreference = new Preference(getPrefContext());
mSettingsPreference.setTitle(mSettingsTitle);
mSettingsPreference.setIconSpaceReserved(false);
mSettingsPreference.setIntent(mSettingsIntent);
final PreferenceCategory generalCategory = findPreference(KEY_GENERAL_CATEGORY);
generalCategory.addPreference(mSettingsPreference);
}
use of androidx.preference.PreferenceCategory in project android_packages_apps_Settings by omnirom.
the class ToggleFeaturePreferenceFragment method initGeneralCategory.
private void initGeneralCategory() {
final PreferenceCategory generalCategory = new PreferenceCategory(getPrefContext());
generalCategory.setKey(KEY_GENERAL_CATEGORY);
generalCategory.setTitle(R.string.accessibility_screen_option);
getPreferenceScreen().addPreference(generalCategory);
}
use of androidx.preference.PreferenceCategory in project android_packages_apps_Settings by omnirom.
the class ToggleReduceBrightColorsPreferenceFragment method updateGeneralCategoryOrder.
private void updateGeneralCategoryOrder() {
final PreferenceCategory generalCategory = findPreference(KEY_GENERAL_CATEGORY);
final SeekBarPreference intensity = findPreference(KEY_INTENSITY);
getPreferenceScreen().removePreference(intensity);
intensity.setOrder(mShortcutPreference.getOrder() - 2);
generalCategory.addPreference(intensity);
final SwitchPreference persist = findPreference(KEY_PERSIST);
getPreferenceScreen().removePreference(persist);
persist.setOrder(mShortcutPreference.getOrder() - 1);
generalCategory.addPreference(persist);
}
use of androidx.preference.PreferenceCategory in project android_packages_apps_Settings by omnirom.
the class SimStatusPreferenceController method displayPreference.
@Override
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
final Preference preference = screen.findPreference(getPreferenceKey());
if (!isAvailable() || preference == null || !preference.isVisible()) {
return;
}
final PreferenceCategory category = screen.findPreference(KEY_PREFERENCE_CATEGORY);
mPreferenceList.add(preference);
final int simStatusOrder = preference.getOrder();
// Add additional preferences for each sim in the device
for (int simSlotNumber = 1; simSlotNumber < mTelephonyManager.getPhoneCount(); simSlotNumber++) {
final Preference multiSimPreference = createNewPreference(screen.getContext());
multiSimPreference.setOrder(simStatusOrder + simSlotNumber);
multiSimPreference.setKey(KEY_SIM_STATUS + simSlotNumber);
category.addPreference(multiSimPreference);
mPreferenceList.add(multiSimPreference);
}
}
use of androidx.preference.PreferenceCategory in project android_packages_apps_Settings by omnirom.
the class ImeiInfoPreferenceController method displayPreference.
@Override
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
final Preference preference = screen.findPreference(getPreferenceKey());
final PreferenceCategory category = screen.findPreference(KEY_PREFERENCE_CATEGORY);
mPreferenceList.add(preference);
updatePreference(preference, 0);
final int imeiPreferenceOrder = preference.getOrder();
// Add additional preferences for each sim in the device
for (int simSlotNumber = 1; simSlotNumber < mTelephonyManager.getPhoneCount(); simSlotNumber++) {
final Preference multiSimPreference = createNewPreference(screen.getContext());
multiSimPreference.setOrder(imeiPreferenceOrder + simSlotNumber);
multiSimPreference.setKey(getPreferenceKey() + simSlotNumber);
category.addPreference(multiSimPreference);
mPreferenceList.add(multiSimPreference);
updatePreference(multiSimPreference, simSlotNumber);
}
}
Aggregations