From 6b1ab1500bfd53319d506ff2ed601d063694e14c Mon Sep 17 00:00:00 2001 From: CactiChameleon9 <51231053+CactiChameleon9@users.noreply.github.com> Date: Sat, 31 Aug 2024 17:09:04 +0100 Subject: [PATCH] Add empty icon if no network speed --- .../java/com/mridang/speedo/TrafficService.java | 6 +++--- app/src/main/res/drawable-hdpi/empty.png | Bin 0 -> 562 bytes app/src/main/res/drawable-mdpi/empty.png | Bin 0 -> 562 bytes app/src/main/res/drawable-xhdpi/empty.png | Bin 0 -> 562 bytes app/src/main/res/drawable-xxhdpi/empty.png | Bin 0 -> 562 bytes app/src/main/res/drawable-xxxhdpi/empty.png | Bin 0 -> 562 bytes 6 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 app/src/main/res/drawable-hdpi/empty.png create mode 100644 app/src/main/res/drawable-mdpi/empty.png create mode 100644 app/src/main/res/drawable-xhdpi/empty.png create mode 100644 app/src/main/res/drawable-xxhdpi/empty.png create mode 100644 app/src/main/res/drawable-xxxhdpi/empty.png diff --git a/app/src/main/java/com/mridang/speedo/TrafficService.java b/app/src/main/java/com/mridang/speedo/TrafficService.java index 78f27db..c01dfce 100644 --- a/app/src/main/java/com/mridang/speedo/TrafficService.java +++ b/app/src/main/java/com/mridang/speedo/TrafficService.java @@ -337,8 +337,8 @@ public class TrafficService extends Service { try { if (lngSpeed < 1024) { - TrafficService.notBuilder.setSmallIcon(R.drawable.wkb000); - updateIcon(R.drawable.wkb000); + TrafficService.notBuilder.setSmallIcon(R.drawable.empty); + updateIcon(R.drawable.empty); } else if (lngSpeed < 1048576L) { TrafficService.notBuilder.setSmallIcon(R.drawable.wkb000 + (int) (lngSpeed / 1024L)); @@ -394,7 +394,7 @@ public class TrafficService extends Service { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { CharSequence name = getString(R.string.channel_name); String description = getString(R.string.channel_description); - int importance = NotificationManager.IMPORTANCE_DEFAULT; + int importance = NotificationManager.IMPORTANCE_LOW; NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance); channel.setDescription(description); // Register the channel with the system. You can't change the importance diff --git a/app/src/main/res/drawable-hdpi/empty.png b/app/src/main/res/drawable-hdpi/empty.png new file mode 100644 index 0000000000000000000000000000000000000000..7c3ab95a9d24304dd6c13380f16042c4f1917b2d GIT binary patch literal 562 zcmV-20?qx2P)EX>4Tx04R}tkv&MmKpe$iQ^g_`1v`icW~fefQ4z;lg(6f4wL+^7CYOFelZGV4 z#ZhoAIQX$xb#QUk)xlK|1V2EW9h?+hq{ROvg%&X$9QWhhy~o`li&xt2Yx*+i**AEX>4Tx04R}tkv&MmKpe$iQ^g_`1v`icW~fefQ4z;lg(6f4wL+^7CYOFelZGV4 z#ZhoAIQX$xb#QUk)xlK|1V2EW9h?+hq{ROvg%&X$9QWhhy~o`li&xt2Yx*+i**AEX>4Tx04R}tkv&MmKpe$iQ^g_`1v`icW~fefQ4z;lg(6f4wL+^7CYOFelZGV4 z#ZhoAIQX$xb#QUk)xlK|1V2EW9h?+hq{ROvg%&X$9QWhhy~o`li&xt2Yx*+i**AEX>4Tx04R}tkv&MmKpe$iQ^g_`1v`icW~fefQ4z;lg(6f4wL+^7CYOFelZGV4 z#ZhoAIQX$xb#QUk)xlK|1V2EW9h?+hq{ROvg%&X$9QWhhy~o`li&xt2Yx*+i**AEX>4Tx04R}tkv&MmKpe$iQ^g_`1v`icW~fefQ4z;lg(6f4wL+^7CYOFelZGV4 z#ZhoAIQX$xb#QUk)xlK|1V2EW9h?+hq{ROvg%&X$9QWhhy~o`li&xt2Yx*+i**A