Badge count for Xiaomi

This commit is contained in:
M66B 2021-05-29 15:36:22 +02:00
parent 21e3673632
commit 0f14c94735
2 changed files with 3 additions and 1 deletions

View File

@ -3889,6 +3889,7 @@ class Core {
DB db = DB.getInstance(context);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean badge = prefs.getBoolean("badge", true);
boolean notify_background_only = prefs.getBoolean("notify_background_only", false);
boolean notify_summary = prefs.getBoolean("notify_summary", false);
boolean notify_preview = prefs.getBoolean("notify_preview", true);
@ -4075,7 +4076,7 @@ class Core {
try {
nm.notify(tag, 1, notification);
// https://github.com/leolin310148/ShortcutBadger/wiki/Xiaomi-Device-Support
if (id == 0 && Helper.isXiaomi())
if (id == 0 && badge && Helper.isXiaomi())
ShortcutBadger.applyNotification(context, notification, current);
} catch (Throwable ex) {
Log.w(ex);

View File

@ -480,6 +480,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
: R.color.lightColorBackground_cards));
}
swUnseenIgnored.setVisibility(Helper.isXiaomi() ? View.GONE : View.VISIBLE);
swAlertOnce.setVisibility(Helper.isXiaomi() || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
// https://developer.android.com/training/notify-user/group