use of android.support.v7.preference.PreferenceGroup in project markor by gsantner.
the class GsPreferenceFragmentCompat method removePreference.
protected void removePreference(@Nullable Preference preference) {
if (preference == null) {
return;
}
PreferenceGroup parent = getPreferenceParent(getPreferenceScreen(), preference);
if (parent == null) {
return;
}
parent.removePreference(preference);
}
use of android.support.v7.preference.PreferenceGroup in project memetastic by gsantner.
the class GsPreferenceFragmentCompat method getPreferenceParent.
protected PreferenceGroup getPreferenceParent(PreferenceGroup prefGroup, Preference pref) {
for (int i = 0; i < prefGroup.getPreferenceCount(); ++i) {
Preference prefChild = prefGroup.getPreference(i);
if (prefChild == pref) {
return prefGroup;
}
if (prefChild instanceof PreferenceGroup) {
PreferenceGroup childGroup = (PreferenceGroup) prefChild;
PreferenceGroup result = getPreferenceParent(childGroup, pref);
if (result != null) {
return result;
}
}
}
return null;
}
use of android.support.v7.preference.PreferenceGroup in project memetastic by gsantner.
the class GsPreferenceFragmentCompat method removePreference.
protected void removePreference(@Nullable Preference preference) {
if (preference == null) {
return;
}
PreferenceGroup parent = getPreferenceParent(getPreferenceScreen(), preference);
if (parent == null) {
return;
}
parent.removePreference(preference);
}
use of android.support.v7.preference.PreferenceGroup in project platform_packages_apps_Galaxy by Cosmic-OS.
the class GamingMode method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Get launch-able applications
addPreferencesFromResource(R.xml.gaming_mode_settings);
final PreferenceScreen prefScreen = getPreferenceScreen();
mHardwareKeysDisable = (SwitchPreference) findPreference(GAMING_MODE_HW_KEYS);
mGamingModeEnabled = (SwitchPreference) findPreference(GAMING_MODE_ENABLED);
if (!haveHWkeys()) {
prefScreen.removePreference(mHardwareKeysDisable);
}
mPackageManager = getPackageManager();
mPackageAdapter = new PackageListAdapter(getActivity());
mGamingPrefList = (PreferenceGroup) findPreference("gamingmode_applications");
mGamingPrefList.setOrderingAsAdded(false);
mGamingPackages = new HashMap<String, Package>();
mAddGamingPref = findPreference("add_gamingmode_packages");
mAddGamingPref.setOnPreferenceClickListener(this);
mContext = getActivity().getApplicationContext();
SettingsObserver observer = new SettingsObserver(new Handler(Looper.getMainLooper()));
observer.observe();
}
use of android.support.v7.preference.PreferenceGroup in project wire-android by wireapp.
the class DevicesPreferences method addDeviceWarning.
private void addDeviceWarning(PreferenceGroup preferenceGroup) {
Preference preference = new Preference(getActivity());
preference.setSummary(getString(R.string.pref_devices_warning_summary));
preferenceGroup.addPreference(preference);
}
Aggregations