From 579597aa89cfc6b419d45fb60a441024e94ff8e0 Mon Sep 17 00:00:00 2001 From: CactiChameleon9 <51231053+CactiChameleon9@users.noreply.github.com> Date: Sat, 31 Aug 2024 17:39:20 +0100 Subject: [PATCH] Show 0kb/s if non-zero small transfer --- app/src/main/java/com/mridang/speedo/TrafficService.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/mridang/speedo/TrafficService.java b/app/src/main/java/com/mridang/speedo/TrafficService.java index 1420e90..69b9559 100644 --- a/app/src/main/java/com/mridang/speedo/TrafficService.java +++ b/app/src/main/java/com/mridang/speedo/TrafficService.java @@ -99,7 +99,7 @@ public class TrafficService extends Service { ittSettings.setComponent(new ComponentName("com.android.settings", CMP)); PendingIntent pitSettings = PendingIntent.getActivity(getApplicationContext(), 0, ittSettings, PendingIntent.FLAG_IMMUTABLE); notBuilder = new NotificationCompat.Builder(getApplicationContext(), CHANNEL_ID); - notBuilder.setSmallIcon(R.drawable.wkb000); + notBuilder.setSmallIcon(R.drawable.empty); notBuilder.setContentIntent(pitSettings); notBuilder.setOngoing(true); notBuilder.setWhen(0); @@ -296,10 +296,12 @@ public class TrafficService extends Service { lngPrevious = lngCurrent; try { - - if (lngSpeed < 1024) { + if (lngSpeed == 0) { TrafficService.notBuilder.setSmallIcon(R.drawable.empty); updateIcon(R.drawable.empty); + } else if (lngSpeed < 1024) { + TrafficService.notBuilder.setSmallIcon(R.drawable.wkb000); + updateIcon(R.drawable.wkb000); } else if (lngSpeed < 1048576L) { TrafficService.notBuilder.setSmallIcon(R.drawable.wkb000 + (int) (lngSpeed / 1024L));