diff --git a/app/src/main/java/ch/dissem/apps/abit/MainActivity.kt b/app/src/main/java/ch/dissem/apps/abit/MainActivity.kt index 82fe544..33d1bf5 100644 --- a/app/src/main/java/ch/dissem/apps/abit/MainActivity.kt +++ b/app/src/main/java/ch/dissem/apps/abit/MainActivity.kt @@ -449,7 +449,9 @@ class MainActivity : AppCompatActivity(), ListSelectionListener { } else { (item as PrimaryDrawerItem).withBadge(null as String?) } - drawer.updateItem(item) + runOnUiThread { + drawer.updateItem(item) + } } } } diff --git a/app/src/main/java/ch/dissem/apps/abit/notification/NetworkNotification.kt b/app/src/main/java/ch/dissem/apps/abit/notification/NetworkNotification.kt index 1baebb4..abc024e 100644 --- a/app/src/main/java/ch/dissem/apps/abit/notification/NetworkNotification.kt +++ b/app/src/main/java/ch/dissem/apps/abit/notification/NetworkNotification.kt @@ -42,7 +42,7 @@ class NetworkNotification(ctx: Context) : AbstractNotification(ctx) { val showAppIntent = Intent(ctx, MainActivity::class.java) val pendingIntent = PendingIntent.getActivity(ctx, 1, showAppIntent, 0) builder - .setSmallIcon(R.drawable.ic_notification_full_node) + .setSmallIcon(R.drawable.ic_notification_full_node_connecting) .setContentTitle(ctx.getString(R.string.bitmessage_full_node)) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setShowWhen(false) @@ -55,10 +55,13 @@ class NetworkNotification(ctx: Context) : AbstractNotification(ctx) { builder.setOngoing(running) val connections = BitmessageService.status.getProperty("network", "connections") if (!running) { + builder.setSmallIcon(R.drawable.ic_notification_full_node_disconnected) builder.setContentText(ctx.getString(R.string.connection_info_disconnected)) } else if (connections == null || connections.properties.isEmpty()) { + builder.setSmallIcon(R.drawable.ic_notification_full_node_connecting) builder.setContentText(ctx.getString(R.string.connection_info_pending)) } else { + builder.setSmallIcon(R.drawable.ic_notification_full_node) val info = StringBuilder() for (stream in connections.properties) { val streamNumber = Integer.parseInt(stream.name.substring("stream ".length)) diff --git a/app/src/main/res/drawable/ic_notification_full_node_connecting.xml b/app/src/main/res/drawable/ic_notification_full_node_connecting.xml new file mode 100644 index 0000000..9b26ca7 --- /dev/null +++ b/app/src/main/res/drawable/ic_notification_full_node_connecting.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_notification_full_node_disconnected.xml b/app/src/main/res/drawable/ic_notification_full_node_disconnected.xml new file mode 100644 index 0000000..2c45daf --- /dev/null +++ b/app/src/main/res/drawable/ic_notification_full_node_disconnected.xml @@ -0,0 +1,9 @@ + + +