Add empty icon if no network speed
This commit is contained in:
parent
8dcf9cc39a
commit
6b1ab1500b
@ -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
|
||||||
|
BIN
app/src/main/res/drawable-hdpi/empty.png
Normal file
BIN
app/src/main/res/drawable-hdpi/empty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 562 B |
BIN
app/src/main/res/drawable-mdpi/empty.png
Normal file
BIN
app/src/main/res/drawable-mdpi/empty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 562 B |
BIN
app/src/main/res/drawable-xhdpi/empty.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/empty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 562 B |
BIN
app/src/main/res/drawable-xxhdpi/empty.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/empty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 562 B |
BIN
app/src/main/res/drawable-xxxhdpi/empty.png
Normal file
BIN
app/src/main/res/drawable-xxxhdpi/empty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 562 B |
Loading…
Reference in New Issue
Block a user