From: Michael W Date: Wed, 6 Apr 2016 22:59:38 +0000 (+0200) Subject: Add explanation for customizing apps X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=467fae0d11044f3642779ae8dfdd1172c8ea3161;p=android-x86%2Fpackages-apps-Settings.git Add explanation for customizing apps Settings->Display & LEDs->Notification light->Apps Currently this is header only if no apps are added yet. Populate it with an explanation when it's empty. Change-Id: I83193dfdd01f05bcd1d597033ef710a1b0eb7e82 --- diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml index 44c7548e27..a390a9afac 100644 --- a/res/values/cm_strings.xml +++ b/res/values/cm_strings.xml @@ -310,6 +310,7 @@ Light settings LED light enabled by settings + To add per app control, activate \'%1$s\' and press \'\u002b\' on the menu bar Android debugging diff --git a/src/com/android/settings/notificationlight/NotificationLightSettings.java b/src/com/android/settings/notificationlight/NotificationLightSettings.java index 95a354d261..c4b55d440a 100644 --- a/src/com/android/settings/notificationlight/NotificationLightSettings.java +++ b/src/com/android/settings/notificationlight/NotificationLightSettings.java @@ -284,6 +284,18 @@ public class NotificationLightSettings extends SettingsPreferenceFragment implem // Do nothing } } + + /* Display a pref explaining how to add apps */ + if (mPackages.size() == 0) { + String summary = getResources().getString( + R.string.notification_light_no_apps_summary); + String useCustom = getResources().getString( + R.string.notification_light_use_custom); + Preference pref = new Preference(context); + pref.setSummary(String.format(summary, useCustom)); + pref.setEnabled(false); + mApplicationPrefList.addPreference(pref); + } } }