Mi Band: Prepare preferences for vibration count, use number as input type for numeric field

live-sensor-data
Andreas Shimokawa 2015-05-14 13:04:21 +02:00
parent 562840a7c5
commit 2b98620ee0
4 changed files with 42 additions and 4 deletions

View File

@ -7,4 +7,8 @@ public interface MiBandConst {
String PREF_USER_HEIGHT_CM = "mi_user_height_cm";
String PREF_USER_WEIGHT_KG = "mi_user_weight_kg";
String PREF_MIBAND_ADDRESS = "development_miaddr"; // FIXME: should be prefixed mi_
String PREF_VIBRATION_COUNT_SMS = "mi_vibration_count_sms";
String PREF_VIBRATION_COUNT_K9MAIL = "mi_vibration_count_k9mail";
String PREF_VIBRATION_COUNT_PEBBLEMSG = "mi_vibration_count_pebblemsg";
String PREF_VIBRATION_COUNT_GENERIC = "mi_vibration_count_generic";
}

View File

@ -38,7 +38,11 @@ public class MiBandPreferencesActivity extends AbstractSettingsActivity {
MiBandConst.PREF_USER_GENDER,
MiBandConst.PREF_USER_HEIGHT_CM,
MiBandConst.PREF_USER_WEIGHT_KG,
MiBandConst.PREF_MIBAND_ADDRESS
MiBandConst.PREF_MIBAND_ADDRESS,
MiBandConst.PREF_VIBRATION_COUNT_SMS,
MiBandConst.PREF_VIBRATION_COUNT_K9MAIL,
MiBandConst.PREF_VIBRATION_COUNT_PEBBLEMSG,
MiBandConst.PREF_VIBRATION_COUNT_GENERIC,
};
}
}

View File

@ -98,5 +98,6 @@
<string name="miband_prefs_gender">Gender</string>
<string name="miband_prefs_height_cm">Height in cm</string>
<string name="miband_prefs_weight_kg">Weight in kg</string>
<string name="pref_header_vibration_count">Vibration Count</string>
</resources>

View File

@ -9,7 +9,7 @@
android:title="@string/miband_prefs_alias" />
<EditTextPreference
android:digits="0123456789"
android:inputType="number"
android:key="mi_user_year_of_birth"
android:maxLength="4"
android:title="@string/miband_prefs_year_birth" />
@ -23,13 +23,13 @@
<!--TODO: support localized heights and weights -->
<EditTextPreference
android:digits="0123456789"
android:inputType="number"
android:key="mi_user_height_cm"
android:maxLength="3"
android:title="@string/miband_prefs_height_cm" />
<EditTextPreference
android:digits="0123456789"
android:inputType="number"
android:key="mi_user_weight_kg"
android:maxLength="3"
android:title="@string/miband_prefs_weight_kg" />
@ -46,4 +46,33 @@
android:title="@string/pref_title_development_miaddr" />
</PreferenceCategory>
<PreferenceCategory
android:key="pref_category_miband_notification"
android:title="@string/pref_header_vibration_count">
<EditTextPreference
android:defaultValue="3"
android:inputType="number"
android:key="mi_vibration_count_sms"
android:maxLength="1"
android:title="@string/pref_title_notifications_sms" />
<EditTextPreference
android:defaultValue="3"
android:inputType="number"
android:key="mi_vibration_count_k9mail"
android:maxLength="1"
android:title="@string/pref_title_notifications_k9mail" />
<EditTextPreference
android:defaultValue="3"
android:inputType="number"
android:key="mi_vibration_count_pebblemsg"
android:maxLength="1"
android:title="@string/pref_title_notifications_pebblemsg" />
<EditTextPreference
android:defaultValue="3"
android:inputType="number"
android:key="mi_vibration_count_generic"
android:maxLength="1"
android:title="@string/pref_title_notifications_generic" />
</PreferenceCategory>
</PreferenceScreen>