Permalink
Browse files

Dialer: We want consistents....change CheckBoxes to Switches

Like in settings it is on other places often switches and here and there a checkbox
Change all CheckBoxes to Switches like sugested by google for new LP Ui.

Thanks for our users which point us to this small visual changes.
  • Loading branch information...
kufikugel authored and zephiK committed Dec 1, 2014
1 parent c362aac commit 80f2ba5d57256ac7501336ab375b94914993c661
Showing with 12 additions and 12 deletions.
  1. +3 −3 res/xml/general_settings.xml
  2. +9 −9 src/com/android/dialer/settings/GeneralSettingsFragment.java
@@ -47,13 +47,13 @@
android:persistent="false"
android:ringtoneType="ringtone" />
<CheckBoxPreference
<SwitchPreference
android:key="button_play_dtmf_tone"
android:title="@string/dtmf_tone_enable_title"
android:persistent="false"
android:defaultValue="true" />
<CheckBoxPreference
<SwitchPreference
android:key="button_vibrate_on_ring"
android:title="@string/vibrate_on_ring_title"
android:persistent="false"
@@ -80,4 +80,4 @@
</PreferenceCategory>
</PreferenceScreen>
</PreferenceScreen>
@@ -22,11 +22,11 @@
import android.os.Handler;
import android.os.Message;
import android.os.Vibrator;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.preference.PreferenceCategory;
import android.preference.PreferenceFragment;
import android.preference.PreferenceScreen;
import android.preference.SwitchPreference;
import android.provider.Settings;
import com.android.dialer.R;
@@ -53,8 +53,8 @@
private Context mContext;
private Preference mRingtonePreference;
private CheckBoxPreference mVibrateWhenRinging;
private CheckBoxPreference mPlayDtmfTone;
private SwitchPreference mVibrateWhenRinging;
private SwitchPreference mPlayDtmfTone;
private Preference mRespondViaSms;
private Runnable mRingtoneLookupRunnable;
@@ -78,8 +78,8 @@ public void onCreate(Bundle savedInstanceState) {
addPreferencesFromResource(R.xml.general_settings);
mRingtonePreference = findPreference(BUTTON_RINGTONE_KEY);
mVibrateWhenRinging = (CheckBoxPreference) findPreference(BUTTON_VIBRATE_ON_RING);
mPlayDtmfTone = (CheckBoxPreference) findPreference(BUTTON_PLAY_DTMF_TONE);
mVibrateWhenRinging = (SwitchPreference) findPreference(BUTTON_VIBRATE_ON_RING);
mPlayDtmfTone = (SwitchPreference) findPreference(BUTTON_PLAY_DTMF_TONE);
mRespondViaSms = findPreference(BUTTON_RESPOND_VIA_SMS_KEY);
PreferenceCategory soundCategory = (PreferenceCategory) findPreference(CATEGORY_SOUNDS_KEY);
@@ -126,6 +126,9 @@ public boolean onPreferenceChange(Preference preference, Object objValue) {
boolean doVibrate = (Boolean) objValue;
Settings.System.putInt(mContext.getContentResolver(),
Settings.System.VIBRATE_WHEN_RINGING, doVibrate ? 1 : 0);
} else if (preference == mPlayDtmfTone) {
Settings.System.putInt(mContext.getContentResolver(),
Settings.System.DTMF_TONE_WHEN_DIALING, (Boolean) objValue ? 1 : 0);
}
return true;
}
@@ -135,10 +138,7 @@ public boolean onPreferenceChange(Preference preference, Object objValue) {
*/
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
if (preference == mPlayDtmfTone) {
Settings.System.putInt(mContext.getContentResolver(),
Settings.System.DTMF_TONE_WHEN_DIALING, mPlayDtmfTone.isChecked() ? 1 : 0);
} else if (preference == mRespondViaSms) {
if (preference == mRespondViaSms) {
// Needs to return false for the intent to launch.
return false;
}

0 comments on commit 80f2ba5

Please sign in to comment.