Add empty icon if no network speed

This commit is contained in:
CactiChameleon9 2024-08-31 17:09:04 +01:00
parent 8dcf9cc39a
commit 6b1ab1500b
6 changed files with 3 additions and 3 deletions

View File

@ -337,8 +337,8 @@ public class TrafficService extends Service {
try { try {
if (lngSpeed < 1024) { if (lngSpeed < 1024) {
TrafficService.notBuilder.setSmallIcon(R.drawable.wkb000); TrafficService.notBuilder.setSmallIcon(R.drawable.empty);
updateIcon(R.drawable.wkb000); updateIcon(R.drawable.empty);
} else if (lngSpeed < 1048576L) { } else if (lngSpeed < 1048576L) {
TrafficService.notBuilder.setSmallIcon(R.drawable.wkb000 + (int) (lngSpeed / 1024L)); 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) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
CharSequence name = getString(R.string.channel_name); CharSequence name = getString(R.string.channel_name);
String description = getString(R.string.channel_description); 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); NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);
channel.setDescription(description); channel.setDescription(description);
// Register the channel with the system. You can't change the importance // Register the channel with the system. You can't change the importance

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B