mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Show message/post count in notifications. Dev task #77.
This commit is contained in:
@@ -76,8 +76,14 @@
|
||||
<string name="add_button">Add</string>
|
||||
<string name="cancel_button">Cancel</string>
|
||||
<string name="post_sent_toast">Post sent</string>
|
||||
<string name="private_message_notification_text">New private message.</string>
|
||||
<string name="group_post_notification_text">New forum post.</string>
|
||||
<plurals name="private_message_notification_text">
|
||||
<item quantity="one">New private message.</item>
|
||||
<item quantity="other">%d new private messages.</item>
|
||||
</plurals>
|
||||
<plurals name="group_post_notification_text">
|
||||
<item quantity="one">New forum post.</item>
|
||||
<item quantity="other">%d new forum posts.</item>
|
||||
</plurals>
|
||||
<string name="settings_title">Settings</string>
|
||||
<string name="activate_bluetooth_option">Activate Bluetooth while signed in</string>
|
||||
<string name="activate_bluetooth_explanation">Briar uses Bluetooth to communicate with nearby contacts</string>
|
||||
|
||||
@@ -68,8 +68,9 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager {
|
||||
new NotificationCompat.Builder(appContext);
|
||||
b.setSmallIcon(R.drawable.message_notification_icon);
|
||||
b.setContentTitle(appContext.getText(R.string.app_name));
|
||||
b.setContentText(appContext.getText(
|
||||
R.string.private_message_notification_text));
|
||||
b.setContentText(appContext.getResources().getQuantityString(
|
||||
R.plurals.private_message_notification_text, privateTotal,
|
||||
privateTotal));
|
||||
b.setDefaults(DEFAULT_ALL);
|
||||
b.setOnlyAlertOnce(true);
|
||||
if(contactCounts.size() == 1) {
|
||||
@@ -126,8 +127,9 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager {
|
||||
new NotificationCompat.Builder(appContext);
|
||||
b.setSmallIcon(R.drawable.message_notification_icon);
|
||||
b.setContentTitle(appContext.getText(R.string.app_name));
|
||||
b.setContentText(appContext.getText(
|
||||
R.string.group_post_notification_text));
|
||||
b.setContentText(appContext.getResources().getQuantityString(
|
||||
R.plurals.group_post_notification_text, groupTotal,
|
||||
groupTotal));
|
||||
b.setDefaults(DEFAULT_ALL);
|
||||
b.setOnlyAlertOnce(true);
|
||||
if(groupCounts.size() == 1) {
|
||||
|
||||
@@ -223,9 +223,9 @@ implements EventListener, OnClickListener, OnItemClickListener {
|
||||
available.setVisibility(GONE);
|
||||
} else {
|
||||
available.setVisibility(VISIBLE);
|
||||
String format = getResources().getQuantityString(
|
||||
R.plurals.forums_available, availableCount);
|
||||
available.setText(String.format(format, availableCount));
|
||||
available.setText(getResources().getQuantityString(
|
||||
R.plurals.forums_available, availableCount,
|
||||
availableCount));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user