use of android.support.v7.preference.TwoStatePreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SoundSettings method initIncreasingRing.
// === Increasing ringtone ===
private void initIncreasingRing() {
PreferenceScreen root = getPreferenceScreen();
mIncreasingRing = (TwoStatePreference) root.findPreference(CMSettings.System.INCREASING_RING);
mIncreasingRingVolume = (IncreasingRingVolumePreference) root.findPreference(KEY_INCREASING_RING_VOLUME);
if (mIncreasingRing == null || mIncreasingRingVolume == null || !mVoiceCapable) {
if (mIncreasingRing != null) {
root.removePreference(mIncreasingRing);
mIncreasingRing = null;
}
if (mIncreasingRingVolume != null) {
root.removePreference(mIncreasingRingVolume);
mIncreasingRingVolume = null;
}
} else {
mIncreasingRingVolume.setCallback(mIncreasingRingVolumeCallback);
}
}
use of android.support.v7.preference.TwoStatePreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class InputMethodAndSubtypeEnabler method updateImplicitlyEnabledSubtypes.
private void updateImplicitlyEnabledSubtypes(final String targetImiId, final boolean check) {
// When targetImiId is null, apply to all subtypes of all IMEs
for (final InputMethodInfo imi : mInputMethodInfoList) {
final String imiId = imi.getId();
final TwoStatePreference autoSelectionPref = mAutoSelectionPrefsMap.get(imiId);
// "subtype auto selection".
if (autoSelectionPref == null || !autoSelectionPref.isChecked()) {
continue;
}
if (imiId.equals(targetImiId) || targetImiId == null) {
updateImplicitlyEnabledSubtypesOf(imi, check);
}
}
}
use of android.support.v7.preference.TwoStatePreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class InputMethodAndSubtypeUtil method setSubtypesPreferenceEnabled.
static void setSubtypesPreferenceEnabled(final SettingsPreferenceFragment context, final List<InputMethodInfo> inputMethodProperties, final String id, final boolean enabled) {
final PreferenceScreen preferenceScreen = context.getPreferenceScreen();
for (final InputMethodInfo imi : inputMethodProperties) {
if (id.equals(imi.getId())) {
final int subtypeCount = imi.getSubtypeCount();
for (int i = 0; i < subtypeCount; ++i) {
final InputMethodSubtype subtype = imi.getSubtypeAt(i);
final TwoStatePreference pref = (TwoStatePreference) preferenceScreen.findPreference(id + subtype.hashCode());
if (pref != null) {
pref.setEnabled(enabled);
}
}
}
}
}
Aggregations