Modern Apps git

← Modern-Apps.git

email: use a dedicated status-bar notification icon

Commit
cf48a516f8b8a02436acd2f19d975cf278ad92ad
Author
Vayun Mathur <[email protected]>
When
2026-05-29 22:19 UTC (6 months ago)
Parents
830cc3f

Diff

email/src/main/java/com/vayunmathur/email/data/ImapIdleService.kt
diff --git a/email/src/main/java/com/vayunmathur/email/data/ImapIdleService.kt b/email/src/main/java/com/vayunmathur/email/data/ImapIdleService.ktindex d7970fd749..eeef3027cb 100644--- a/email/src/main/java/com/vayunmathur/email/data/ImapIdleService.kt+++ b/email/src/main/java/com/vayunmathur/email/data/ImapIdleService.kt@@ -199,7 +199,7 @@ class ImapIdleService : Service() {     private fun buildOngoingNotification(): Notification {         ensureChannel(applicationContext)         return NotificationCompat.Builder(applicationContext, CHANNEL_ID)-            .setSmallIcon(R.drawable.ic_launcher_foreground)+            .setSmallIcon(R.drawable.ic_notification_mail)             .setContentTitle("Email")             .setContentText("Listening for new mail")             .setPriority(NotificationCompat.PRIORITY_LOW)
email/src/main/java/com/vayunmathur/email/util/EmailNotifications.kt
diff --git a/email/src/main/java/com/vayunmathur/email/util/EmailNotifications.kt b/email/src/main/java/com/vayunmathur/email/util/EmailNotifications.ktindex 99f0eb2c54..0da175aea2 100644--- a/email/src/main/java/com/vayunmathur/email/util/EmailNotifications.kt+++ b/email/src/main/java/com/vayunmathur/email/util/EmailNotifications.kt@@ -60,7 +60,7 @@ object EmailNotifications {                 PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,             )             val notif: Notification = NotificationCompat.Builder(context, CHANNEL_ID)-                .setSmallIcon(R.drawable.ic_launcher_foreground)+                .setSmallIcon(R.drawable.ic_notification_mail)                 .setContentTitle(msg.from.substringBefore("<").trim().ifEmpty { msg.from })                 .setContentText(msg.subject.ifBlank { "(no subject)" })                 .setSubText(accountEmail)
email/src/main/res/drawable/ic_notification_mail.xml
diff --git a/email/src/main/res/drawable/ic_notification_mail.xml b/email/src/main/res/drawable/ic_notification_mail.xmlnew file mode 100644index 0000000000..a22f4b2fff--- /dev/null+++ b/email/src/main/res/drawable/ic_notification_mail.xml@@ -0,0 +1,21 @@+<!--+  ~ Status-bar notification icon. MUST be a flat 24dp viewport with white+  ~ shapes on transparent background — Android tints notification small+  ~ icons to the current status-bar color and any non-white pixels get+  ~ flattened, while sub-24dp content gets dwarfed in the cutout.+  ~+  ~ The previous use of `ic_launcher_foreground` here looked tiny because+  ~ that drawable is an adaptive-icon foreground (108dp viewport with the+  ~ glyph scaled to ~58% and centered) — perfectly fine for the launcher+  ~ but way too small once rebounded into the status bar's ~24dp slot.+  -->+<vector xmlns:android="http://schemas.android.com/apk/res/android"+    android:width="24dp"+    android:height="24dp"+    android:viewportWidth="24"+    android:viewportHeight="24"+    android:tint="?attr/colorControlNormal">+  <path+      android:fillColor="@android:color/white"+      android:pathData="M20,4H4C2.9,4 2.01,4.9 2.01,6L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2zM20,8l-8,5 -8,-5V6l8,5 8,-5v2z"/>+</vector>