diff --git a/res/values/cherish_strings.xml b/res/values/cherish_strings.xml index f6583b7..0a0765b 100644 --- a/res/values/cherish_strings.xml +++ b/res/values/cherish_strings.xml @@ -398,7 +398,7 @@ Disable hardware buttons Use the device hardware keys for navigation Volume rocker - + default app @@ -467,4 +467,8 @@ Swap volume buttons when the screen is rotated Show volume panel on left Display volume panel on the left side of the screen + + + Alert slider notifications + Display notification when changing alert slider position diff --git a/res/xml/cherish_settings_notifications.xml b/res/xml/cherish_settings_notifications.xml index 0728ae9..fb0747a 100644 --- a/res/xml/cherish_settings_notifications.xml +++ b/res/xml/cherish_settings_notifications.xml @@ -62,6 +62,13 @@ android:title="@string/notification_sound_vib_screen_on_title" android:summary="@string/notification_sound_vib_screen_on_summary" android:defaultValue="true" /> + + + diff --git a/src/com/cherish/settings/fragments/NotificationSettings.java b/src/com/cherish/settings/fragments/NotificationSettings.java index 1a72afb..1dd2519 100644 --- a/src/com/cherish/settings/fragments/NotificationSettings.java +++ b/src/com/cherish/settings/fragments/NotificationSettings.java @@ -38,7 +38,10 @@ import java.util.List; public class NotificationSettings extends SettingsPreferenceFragment implements Preference.OnPreferenceChangeListener{ private static final String INCALL_VIB_OPTIONS = "incall_vib_options"; - private Preference mChargingLeds; + private static final String ALERT_SLIDER_PREF = "alert_slider_notifications"; + + private Preference mChargingLeds; + private Preference mAlertSlider; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); @@ -47,7 +50,13 @@ public class NotificationSettings extends SettingsPreferenceFragment implements ContentResolver resolver = getActivity().getContentResolver(); final PreferenceScreen prefScreen = getPreferenceScreen(); final Resources res = getResources(); - + + mAlertSlider = (Preference) prefScreen.findPreference(ALERT_SLIDER_PREF); + boolean mAlertSliderAvailable = res.getBoolean( + com.android.internal.R.bool.config_hasAlertSlider); + if (!mAlertSliderAvailable) + prefScreen.removePreference(mAlertSlider); + mChargingLeds = (Preference) findPreference("charging_light"); if (mChargingLeds != null && !getResources().getBoolean( @@ -94,6 +103,10 @@ public class NotificationSettings extends SettingsPreferenceFragment implements public List getNonIndexableKeys(Context context) { List keys = super.getNonIndexableKeys(context); final Resources res = context.getResources(); + boolean mAlertSliderAvailable = res.getBoolean( + com.android.internal.R.bool.config_hasAlertSlider); + if (!mAlertSliderAvailable) + keys.add(ALERT_SLIDER_PREF); return keys; } };