diff --git a/README.md b/README.md index 4078f44..d08c0bf 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ expose the required hardware or state for real verification. | Battery bar: curved top-edge geometry | ✅ | Untested | Untested | ⚠️ Experimental | Untested | Untested | Untested | Untested | | Battery bar threshold colours and colour math | ✅ | Untested | Untested | ✅ | Untested | Untested | Untested | Untested | | Camera cutout and under-display-camera handling | ✅ | Untested | Untested | ⚠️ Experimental | Untested | Untested | Untested | Untested | -| Rotation and fold/unfold handling | ✅ | Untested | Untested | ✅ rotation verified; fold/unfold not applicable to this emulator | Untested | Untested | Untested | Untested | +| Rotation and fold/unfold handling | ✅ | Untested | Untested | ✅ rotation verified | Untested | Untested | Untested | Untested | | Drawer scrolling and background-work performance | ✅ | Untested | Untested | ✅ | Untested | Untested | Untested | Untested | | Debug visualizers and debug notifications | ✅ | Untested | Untested | ✅ | Untested | Untested | Untested | Untested | diff --git a/app/src/main/java/se/ajpanton/statusbartweak/platform/SystemUiCapabilities.java b/app/src/main/java/se/ajpanton/statusbartweak/platform/SystemUiCapabilities.java index db8ac1c..31a1b2f 100644 --- a/app/src/main/java/se/ajpanton/statusbartweak/platform/SystemUiCapabilities.java +++ b/app/src/main/java/se/ajpanton/statusbartweak/platform/SystemUiCapabilities.java @@ -33,6 +33,10 @@ public final class SystemUiCapabilities { return isSamsungOneUi(); } + public static boolean supportsSamsungNotificationDisplayStyles() { + return isSamsungOneUi(); + } + public static boolean isSystemUiPackageName(String packageName) { return PACKAGE_SYSTEMUI.equals(packageName); } diff --git a/app/src/main/java/se/ajpanton/statusbartweak/shell/ui/LockedNotificationModeUi.java b/app/src/main/java/se/ajpanton/statusbartweak/shell/ui/LockedNotificationModeUi.java index c57201a..df2616b 100644 --- a/app/src/main/java/se/ajpanton/statusbartweak/shell/ui/LockedNotificationModeUi.java +++ b/app/src/main/java/se/ajpanton/statusbartweak/shell/ui/LockedNotificationModeUi.java @@ -9,6 +9,7 @@ import android.widget.TextView; import android.widget.Toast; import se.ajpanton.statusbartweak.R; +import se.ajpanton.statusbartweak.platform.SystemUiCapabilities; import se.ajpanton.statusbartweak.shell.debug.NotificationDisplayStyleSettings; import se.ajpanton.statusbartweak.shell.settings.SbtSettings; @@ -40,6 +41,10 @@ final class LockedNotificationModeUi { return; } group.setOnCheckedChangeListener(null); + if (!SystemUiCapabilities.supportsSamsungNotificationDisplayStyles()) { + bindIconsOnly(context, prefs, group, hint); + return; + } RadioButton cards = button(context, R.string.debug_notification_style_cards, MODE_CARDS); RadioButton icons = button(context, R.string.debug_notification_style_icons, MODE_ICONS); RadioButton dot = button(context, R.string.debug_notification_style_dot, MODE_DOT); @@ -76,7 +81,31 @@ final class LockedNotificationModeUi { }); } + private static void bindIconsOnly( + Context context, + SharedPreferences prefs, + RadioGroup group, + TextView hint + ) { + RadioButton icons = button(context, R.string.debug_notification_style_icons, MODE_ICONS); + group.removeAllViews(); + group.addView(icons); + group.check(icons.getId()); + group.setEnabled(false); + icons.setEnabled(false); + if (hint != null) { + hint.setText(R.string.layout_locked_notifications_hint_icons_only); + } + if (!MODE_ICONS.equals(prefs.getString(SbtSettings.KEY_LOCKED_NOTIFICATION_MODE, MODE_ICONS))) { + prefs.edit().putString(SbtSettings.KEY_LOCKED_NOTIFICATION_MODE, MODE_ICONS).apply(); + SbtSettings.ensureReadable(context); + } + } + static String currentMode(Context context) { + if (!SystemUiCapabilities.supportsSamsungNotificationDisplayStyles()) { + return MODE_ICONS; + } NotificationDisplayStyleSettings.Style style = NotificationDisplayStyleSettings.read(context).style(); return currentMode(style); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 724961f..7977c3e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -201,6 +201,7 @@ Chip height (% of statusbar) Locked notifications mode Mirrors the Samsung notification display style for AOD and lockscreen. + This SystemUI exposes notification icons only. Misc Max unlocked icons per row Padding