Cherish: Incall vibration options [3/3]
* allow setting vibration when call is connected * allow setting vibration when call is disconnected * allow setting vibration for call waiting * this works with google and aosp dialer :) SuperDroidBond-: Make it default on Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
@@ -1073,4 +1073,10 @@
|
||||
<!-- Show old style mobile data icon -->
|
||||
<string name="use_old_mobiletype_title">Use old style mobile data icons</string>
|
||||
<string name="use_old_mobiletype_summary">Use pre-p mobiletype icons for signal</string>
|
||||
|
||||
<!-- Incall vibrate options -->
|
||||
<string name="incall_vibration_category">In-call vibration options</string>
|
||||
<string name="incall_vibrate_connect_title">Vibrate on connect</string>
|
||||
<string name="incall_vibrate_call_wait_title">Vibrate on call waiting</string>
|
||||
<string name="incall_vibrate_disconnect_title">Vibrate on disconnect</string>
|
||||
</resources>
|
||||
|
||||
@@ -17,6 +17,30 @@
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:title="@string/notifications_title"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="incall_vib_options"
|
||||
android:title="@string/incall_vibration_category">
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="vibrate_on_connect"
|
||||
android:icon="@drawable/ic_vibrate"
|
||||
android:title="@string/incall_vibrate_connect_title"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="vibrate_on_callwaiting"
|
||||
android:icon="@drawable/ic_vibrate"
|
||||
android:title="@string/incall_vibrate_call_wait_title"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="vibrate_on_disconnect"
|
||||
android:icon="@drawable/ic_vibrate"
|
||||
android:title="@string/incall_vibrate_disconnect_title"
|
||||
android:defaultValue="true" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<!-- Heads up -->
|
||||
<Preference
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.cherish.settings.preferences.CustomSeekBarPreference;
|
||||
import com.cherish.settings.preferences.SystemSettingListPreference;
|
||||
import com.cherish.settings.preferences.SystemSettingSwitchPreference;
|
||||
import net.margaritov.preference.colorpicker.ColorPickerPreference;
|
||||
import com.android.internal.util.cherish.CherishUtils;
|
||||
|
||||
public class NotificationSettings extends SettingsPreferenceFragment implements Preference.OnPreferenceChangeListener{
|
||||
|
||||
@@ -27,6 +28,7 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
|
||||
private static final String AMBIENT_LIGHT_DURATION = "ambient_light_duration";
|
||||
private static final String AMBIENT_LIGHT_REPEAT_COUNT = "ambient_light_repeat_count";
|
||||
private static final String PULSE_COLOR_MODE_PREF = "ambient_notification_light_color_mode";
|
||||
private static final String INCALL_VIB_OPTIONS = "incall_vib_options";
|
||||
|
||||
private Preference mChargingLeds;
|
||||
private ColorPickerPreference mEdgeLightColorPreference;
|
||||
@@ -48,6 +50,11 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
|
||||
com.android.internal.R.bool.config_intrusiveBatteryLed)) {
|
||||
prefScreen.removePreference(mChargingLeds);
|
||||
}
|
||||
|
||||
PreferenceCategory incallVibCategory = (PreferenceCategory) findPreference(INCALL_VIB_OPTIONS);
|
||||
if (!CherishUtils.isVoiceCapable(getActivity())) {
|
||||
prefScreen.removePreference(incallVibCategory);
|
||||
}
|
||||
|
||||
mEdgeLightRepeatCountPreference = (SystemSettingSeekBarPreference) findPreference(AMBIENT_LIGHT_REPEAT_COUNT);
|
||||
mEdgeLightRepeatCountPreference.setOnPreferenceChangeListener(this);
|
||||
|
||||
Reference in New Issue
Block a user