Limit non-Samsung notification style options

This commit is contained in:
ajp_anton
2026-07-08 02:38:30 +00:00
parent 66f3c2e206
commit 352b7ab443
4 changed files with 35 additions and 1 deletions
+1 -1
View File
@@ -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 |
@@ -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);
}
@@ -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);
+1
View File
@@ -201,6 +201,7 @@
<string name="layout_chip_height_steps">Chip height (% of statusbar)</string>
<string name="layout_locked_notifications_title">Locked notifications mode</string>
<string name="layout_locked_notifications_hint">Mirrors the Samsung notification display style for AOD and lockscreen.</string>
<string name="layout_locked_notifications_hint_icons_only">This SystemUI exposes notification icons only.</string>
<string name="layout_misc_title">Misc</string>
<string name="label_max_unlocked_icons_per_row">Max unlocked icons per row</string>
<string name="layout_padding_title">Padding</string>