mirror of
https://github.com/moparisthebest/Yaaic
synced 2025-01-08 12:18:07 -05:00
Display "Not connected" in notification instead of no text when not connected
This commit is contained in:
parent
4396e66954
commit
fafbe1ca4a
@ -122,6 +122,7 @@
|
|||||||
<string name="command_desc_whois">Get information about a user</string>
|
<string name="command_desc_whois">Get information about a user</string>
|
||||||
|
|
||||||
<string name="notification_running">Yaaic is running</string>
|
<string name="notification_running">Yaaic is running</string>
|
||||||
|
<string name="notification_not_connected">Not connected</string>
|
||||||
<string name="notification_connected">Connected to %1$s</string>
|
<string name="notification_connected">Connected to %1$s</string>
|
||||||
<string name="notification_disconnected">Disconnected from %1$s</string>
|
<string name="notification_disconnected">Disconnected from %1$s</string>
|
||||||
<string name="notification_mentions">New messages in: %1$s</string>
|
<string name="notification_mentions">New messages in: %1$s</string>
|
||||||
|
@ -197,7 +197,7 @@ public class IRCService extends Service
|
|||||||
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notifyIntent, 0);
|
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notifyIntent, 0);
|
||||||
|
|
||||||
// Set the info for the views that show in the notification panel.
|
// Set the info for the views that show in the notification panel.
|
||||||
notification.setLatestEventInfo(this, getText(R.string.app_name), "", contentIntent);
|
notification.setLatestEventInfo(this, getText(R.string.app_name), getText(R.string.notification_not_connected), contentIntent);
|
||||||
|
|
||||||
startForegroundCompat(FOREGROUND_NOTIFICATION, notification);
|
startForegroundCompat(FOREGROUND_NOTIFICATION, notification);
|
||||||
} else if (ACTION_BACKGROUND.equals(intent.getAction()) && !foreground) {
|
} else if (ACTION_BACKGROUND.equals(intent.getAction()) && !foreground) {
|
||||||
@ -237,7 +237,7 @@ public class IRCService extends Service
|
|||||||
}
|
}
|
||||||
contentText = getString(R.string.notification_connected, sb.substring(0, sb.length()-2));
|
contentText = getString(R.string.notification_connected, sb.substring(0, sb.length()-2));
|
||||||
} else {
|
} else {
|
||||||
contentText = "";
|
contentText = getString(R.string.notification_not_connected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user