summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/settings
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2018-12-03 18:11:39 -0800
committerTony Wickham <twickham@google.com>2018-12-04 10:46:40 -0800
commitf34bee819c8fd88cfa0df8608e336b93aaf2e6ff (patch)
tree985ad9488b1f6b45bbbd3c8e539235f26bfb45f0 /src/com/android/launcher3/settings
parentde78d7ca78b457c057f91ba838ea5c7c0f14c2dd (diff)
downloadandroid_packages_apps_Trebuchet-f34bee819c8fd88cfa0df8608e336b93aaf2e6ff.tar.gz
android_packages_apps_Trebuchet-f34bee819c8fd88cfa0df8608e336b93aaf2e6ff.tar.bz2
android_packages_apps_Trebuchet-f34bee819c8fd88cfa0df8608e336b93aaf2e6ff.zip
Rename "badges" to "dots" where appropriate
This will reduce confusion with the other "badging" concept we use for, e.g. work profiles. It is also consistent with the external name "notification dots". Change-Id: I2a2c9d96dc0d6284eb0c48adc78a856271caad4d
Diffstat (limited to 'src/com/android/launcher3/settings')
-rw-r--r--src/com/android/launcher3/settings/NotificationDotsPreference.java (renamed from src/com/android/launcher3/settings/IconBadgingPreference.java)18
-rw-r--r--src/com/android/launcher3/settings/SettingsActivity.java28
2 files changed, 24 insertions, 22 deletions
diff --git a/src/com/android/launcher3/settings/IconBadgingPreference.java b/src/com/android/launcher3/settings/NotificationDotsPreference.java
index 7c97b38d2..f30470a44 100644
--- a/src/com/android/launcher3/settings/IconBadgingPreference.java
+++ b/src/com/android/launcher3/settings/NotificationDotsPreference.java
@@ -38,10 +38,10 @@ import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
/**
- * A {@link Preference} for indicating icon badging status.
- * Also has utility methods for updating UI based on badging status changes.
+ * A {@link Preference} for indicating notification dots status.
+ * Also has utility methods for updating UI based on dots status changes.
*/
-public class IconBadgingPreference extends Preference
+public class NotificationDotsPreference extends Preference
implements SecureSettingsObserver.OnChangeListener {
private boolean mWidgetFrameVisible = false;
@@ -49,20 +49,20 @@ public class IconBadgingPreference extends Preference
/** Hidden field Settings.Secure.ENABLED_NOTIFICATION_LISTENERS */
private static final String NOTIFICATION_ENABLED_LISTENERS = "enabled_notification_listeners";
- public IconBadgingPreference(
+ public NotificationDotsPreference(
Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
- public IconBadgingPreference(Context context, AttributeSet attrs, int defStyleAttr) {
+ public NotificationDotsPreference(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
- public IconBadgingPreference(Context context, AttributeSet attrs) {
+ public NotificationDotsPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}
- public IconBadgingPreference(Context context) {
+ public NotificationDotsPreference(Context context) {
super(context);
}
@@ -85,7 +85,9 @@ public class IconBadgingPreference extends Preference
@Override
public void onSettingsChanged(boolean enabled) {
- int summary = enabled ? R.string.icon_badging_desc_on : R.string.icon_badging_desc_off;
+ int summary = enabled
+ ? R.string.notification_dots_desc_on
+ : R.string.notification_dots_desc_off;
boolean serviceEnabled = true;
if (enabled) {
diff --git a/src/com/android/launcher3/settings/SettingsActivity.java b/src/com/android/launcher3/settings/SettingsActivity.java
index 7c158d9f7..77682e55e 100644
--- a/src/com/android/launcher3/settings/SettingsActivity.java
+++ b/src/com/android/launcher3/settings/SettingsActivity.java
@@ -54,7 +54,7 @@ public class SettingsActivity extends Activity
private static final String DEVELOPER_OPTIONS_KEY = "pref_developer_options";
private static final String FLAGS_PREFERENCE_KEY = "flag_toggler";
- private static final String ICON_BADGING_PREFERENCE_KEY = "pref_icon_badging";
+ private static final String NOTIFICATION_DOTS_PREFERENCE_KEY = "pref_icon_badging";
/** Hidden field Settings.Secure.ENABLED_NOTIFICATION_LISTENERS */
private static final String NOTIFICATION_ENABLED_LISTENERS = "enabled_notification_listeners";
@@ -120,7 +120,7 @@ public class SettingsActivity extends Activity
*/
public static class LauncherSettingsFragment extends PreferenceFragment {
- private SecureSettingsObserver mIconBadgingObserver;
+ private SecureSettingsObserver mNotificationDotsObserver;
private String mHighLightKey;
private boolean mPreferenceHighlighted = false;
@@ -165,21 +165,21 @@ public class SettingsActivity extends Activity
*/
protected boolean initPreference(Preference preference) {
switch (preference.getKey()) {
- case ICON_BADGING_PREFERENCE_KEY:
+ case NOTIFICATION_DOTS_PREFERENCE_KEY:
if (!Utilities.ATLEAST_OREO ||
- !getResources().getBoolean(R.bool.notification_badging_enabled)) {
+ !getResources().getBoolean(R.bool.notification_dots_enabled)) {
return false;
}
- // Listen to system notification badge settings while this UI is active.
- mIconBadgingObserver = newNotificationSettingsObserver(
- getActivity(), (IconBadgingPreference) preference);
- mIconBadgingObserver.register();
+ // Listen to system notification dot settings while this UI is active.
+ mNotificationDotsObserver = newNotificationSettingsObserver(
+ getActivity(), (NotificationDotsPreference) preference);
+ mNotificationDotsObserver.register();
// Also listen if notification permission changes
- mIconBadgingObserver.getResolver().registerContentObserver(
+ mNotificationDotsObserver.getResolver().registerContentObserver(
Settings.Secure.getUriFor(NOTIFICATION_ENABLED_LISTENERS), false,
- mIconBadgingObserver);
- mIconBadgingObserver.dispatchOnChange();
+ mNotificationDotsObserver);
+ mNotificationDotsObserver.dispatchOnChange();
return true;
case ADD_ICON_PREFERENCE_KEY:
@@ -245,9 +245,9 @@ public class SettingsActivity extends Activity
@Override
public void onDestroy() {
- if (mIconBadgingObserver != null) {
- mIconBadgingObserver.unregister();
- mIconBadgingObserver = null;
+ if (mNotificationDotsObserver != null) {
+ mNotificationDotsObserver.unregister();
+ mNotificationDotsObserver = null;
}
super.onDestroy();
}