From faa6a9d9063c413cfcea7aef0d0c91db80baa2f5 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Thu, 14 Apr 2016 16:44:44 +0200 Subject: [PATCH] use android:summary="%s" for ListPreferences --- .../gadgetbridge/GBApplication.java | 2 +- .../activities/SettingsActivity.java | 6 ------ .../miband/MiBandPreferencesActivity.java | 6 ------ app/src/main/res/xml/miband_preferences.xml | 18 ++++++++++++------ app/src/main/res/xml/preferences.xml | 18 ++++++++++++------ 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java index 1aa62200..f292133a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java @@ -195,7 +195,7 @@ public class GBApplication extends Application { public static void releaseDB() { dbLock.unlock(); } - + public static boolean isRunningLollipopOrLater() { return VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP; } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/SettingsActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/SettingsActivity.java index 34942ef2..d541af9c 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/SettingsActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/SettingsActivity.java @@ -133,11 +133,6 @@ public class SettingsActivity extends AbstractSettingsActivity { @Override protected String[] getPreferenceKeysWithSummary() { return new String[]{ - "audio_player", - "notification_mode_calls", - "notification_mode_sms", - "notification_mode_k9mail", - "pebble_activitytracker", "pebble_emu_addr", "pebble_emu_port", "pebble_reconnect_attempts", @@ -159,7 +154,6 @@ public class SettingsActivity extends AbstractSettingsActivity { "canned_reply_15", "canned_reply_16", PREF_USER_YEAR_OF_BIRTH, - PREF_USER_GENDER, PREF_USER_HEIGHT_CM, PREF_USER_WEIGHT_KG, PREF_USER_SLEEP_DURATION, diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandPreferencesActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandPreferencesActivity.java index 7ef19b80..919e7d2c 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandPreferencesActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandPreferencesActivity.java @@ -59,20 +59,14 @@ public class MiBandPreferencesActivity extends AbstractSettingsActivity { protected String[] getPreferenceKeysWithSummary() { return new String[]{ PREF_USER_ALIAS, - PREF_MIBAND_WEARSIDE, PREF_MIBAND_ADDRESS, PREF_MIBAND_FITNESS_GOAL, PREF_MIBAND_DONT_ACK_TRANSFER, PREF_MIBAND_RESERVE_ALARM_FOR_CALENDAR, - getNotificationPrefKey(VIBRATION_PROFILE, ORIGIN_SMS), getNotificationPrefKey(VIBRATION_COUNT, ORIGIN_SMS), - getNotificationPrefKey(VIBRATION_PROFILE, ORIGIN_INCOMING_CALL), getNotificationPrefKey(VIBRATION_COUNT, ORIGIN_INCOMING_CALL), - getNotificationPrefKey(VIBRATION_PROFILE, ORIGIN_K9MAIL), getNotificationPrefKey(VIBRATION_COUNT, ORIGIN_K9MAIL), - getNotificationPrefKey(VIBRATION_PROFILE, ORIGIN_PEBBLEMSG), getNotificationPrefKey(VIBRATION_COUNT, ORIGIN_PEBBLEMSG), - getNotificationPrefKey(VIBRATION_PROFILE, ORIGIN_GENERIC), getNotificationPrefKey(VIBRATION_COUNT, ORIGIN_GENERIC), }; } diff --git a/app/src/main/res/xml/miband_preferences.xml b/app/src/main/res/xml/miband_preferences.xml index 042cd8e1..c544d254 100644 --- a/app/src/main/res/xml/miband_preferences.xml +++ b/app/src/main/res/xml/miband_preferences.xml @@ -14,7 +14,8 @@ android:entries="@array/wearside" android:entryValues="@array/wearside_values" android:key="mi_wearside" - android:title="@string/miband_prefs_wearside" /> + android:title="@string/miband_prefs_wearside" + android:summary="%s" /> + android:title="@string/miband_prefs_vibration" + android:summary="%s" /> + android:title="@string/miband_prefs_vibration" + android:summary="%s" /> + android:title="@string/miband_prefs_vibration" + android:summary="%s" /> + android:title="@string/miband_prefs_vibration" + android:summary="%s" /> + android:title="@string/miband_prefs_vibration" + android:summary="%s" /> + android:title="@string/pref_title_audo_player" + android:summary="%s" /> + android:title="@string/pref_title_notifications_call" + android:summary="%s" /> + android:title="@string/pref_title_notifications_sms" + android:summary="%s" /> + android:title="@string/pref_title_notifications_k9mail" + android:summary="%s" /> + android:title="@string/activity_prefs_gender" + android:summary="%s" /> + android:title="@string/pref_title_pebble_activitytracker" + android:summary="%s" />