am 37af28dd: Enable vibrate on keypress by default

* commit '37af28dd234b64773c0038ac587cac5f99236bd2':
  Enable vibrate on keypress by default
This commit is contained in:
Ken Wakasa 2011-09-20 14:14:27 -07:00 committed by Android Git Automerger
commit 30881753c8
4 changed files with 5 additions and 2 deletions

View file

@ -39,6 +39,7 @@
<bool name="config_default_bigram_prediction">false</bool> <bool name="config_default_bigram_prediction">false</bool>
<bool name="config_default_compat_recorrection_enabled">true</bool> <bool name="config_default_compat_recorrection_enabled">true</bool>
<bool name="config_default_sound_enabled">false</bool> <bool name="config_default_sound_enabled">false</bool>
<bool name="config_default_vibration_enabled">true</bool>
<bool name="config_auto_correction_spacebar_led_enabled">true</bool> <bool name="config_auto_correction_spacebar_led_enabled">true</bool>
<!-- Showing mini keyboard, just above the touched point if true, aligned to the key if false --> <!-- Showing mini keyboard, just above the touched point if true, aligned to the key if false -->
<bool name="config_show_mini_keyboard_at_touched_point">false</bool> <bool name="config_show_mini_keyboard_at_touched_point">false</bool>

View file

@ -20,7 +20,7 @@
<resources> <resources>
<string-array name="keypress_vibration_durations" translatable="false"> <string-array name="keypress_vibration_durations" translatable="false">
<!-- Build.HARDWARE,duration_in_milliseconds --> <!-- Build.HARDWARE,duration_in_milliseconds -->
<item>herring,4</item> <item>herring,5</item>
<item>tuna,5</item> <item>tuna,5</item>
</string-array> </string-array>
</resources> </resources>

View file

@ -32,6 +32,7 @@
<CheckBoxPreference <CheckBoxPreference
android:key="vibrate_on" android:key="vibrate_on"
android:title="@string/vibrate_on_keypress" android:title="@string/vibrate_on_keypress"
android:defaultValue="@bool/config_default_vibration_enabled"
android:persistent="true" /> android:persistent="true" />
<CheckBoxPreference <CheckBoxPreference
android:key="sound_on" android:key="sound_on"

View file

@ -171,7 +171,8 @@ public class Settings extends InputMethodSettingsActivity
// Get the settings preferences // Get the settings preferences
final boolean hasVibrator = VibratorCompatWrapper.getInstance(context).hasVibrator(); final boolean hasVibrator = VibratorCompatWrapper.getInstance(context).hasVibrator();
mVibrateOn = hasVibrator && prefs.getBoolean(Settings.PREF_VIBRATE_ON, false); mVibrateOn = hasVibrator && prefs.getBoolean(Settings.PREF_VIBRATE_ON,
res.getBoolean(R.bool.config_default_vibration_enabled));
mSoundOn = prefs.getBoolean(Settings.PREF_SOUND_ON, mSoundOn = prefs.getBoolean(Settings.PREF_SOUND_ON,
res.getBoolean(R.bool.config_default_sound_enabled)); res.getBoolean(R.bool.config_default_sound_enabled));
mKeyPreviewPopupOn = isKeyPreviewPopupEnabled(prefs, res); mKeyPreviewPopupOn = isKeyPreviewPopupEnabled(prefs, res);