mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 05:39:53 +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="add_button">Add</string>
|
||||||
<string name="cancel_button">Cancel</string>
|
<string name="cancel_button">Cancel</string>
|
||||||
<string name="post_sent_toast">Post sent</string>
|
<string name="post_sent_toast">Post sent</string>
|
||||||
<string name="private_message_notification_text">New private message.</string>
|
<plurals name="private_message_notification_text">
|
||||||
<string name="group_post_notification_text">New forum post.</string>
|
<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="settings_title">Settings</string>
|
||||||
<string name="activate_bluetooth_option">Activate Bluetooth while signed in</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>
|
<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);
|
new NotificationCompat.Builder(appContext);
|
||||||
b.setSmallIcon(R.drawable.message_notification_icon);
|
b.setSmallIcon(R.drawable.message_notification_icon);
|
||||||
b.setContentTitle(appContext.getText(R.string.app_name));
|
b.setContentTitle(appContext.getText(R.string.app_name));
|
||||||
b.setContentText(appContext.getText(
|
b.setContentText(appContext.getResources().getQuantityString(
|
||||||
R.string.private_message_notification_text));
|
R.plurals.private_message_notification_text, privateTotal,
|
||||||
|
privateTotal));
|
||||||
b.setDefaults(DEFAULT_ALL);
|
b.setDefaults(DEFAULT_ALL);
|
||||||
b.setOnlyAlertOnce(true);
|
b.setOnlyAlertOnce(true);
|
||||||
if(contactCounts.size() == 1) {
|
if(contactCounts.size() == 1) {
|
||||||
@@ -126,8 +127,9 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager {
|
|||||||
new NotificationCompat.Builder(appContext);
|
new NotificationCompat.Builder(appContext);
|
||||||
b.setSmallIcon(R.drawable.message_notification_icon);
|
b.setSmallIcon(R.drawable.message_notification_icon);
|
||||||
b.setContentTitle(appContext.getText(R.string.app_name));
|
b.setContentTitle(appContext.getText(R.string.app_name));
|
||||||
b.setContentText(appContext.getText(
|
b.setContentText(appContext.getResources().getQuantityString(
|
||||||
R.string.group_post_notification_text));
|
R.plurals.group_post_notification_text, groupTotal,
|
||||||
|
groupTotal));
|
||||||
b.setDefaults(DEFAULT_ALL);
|
b.setDefaults(DEFAULT_ALL);
|
||||||
b.setOnlyAlertOnce(true);
|
b.setOnlyAlertOnce(true);
|
||||||
if(groupCounts.size() == 1) {
|
if(groupCounts.size() == 1) {
|
||||||
|
|||||||
@@ -223,9 +223,9 @@ implements EventListener, OnClickListener, OnItemClickListener {
|
|||||||
available.setVisibility(GONE);
|
available.setVisibility(GONE);
|
||||||
} else {
|
} else {
|
||||||
available.setVisibility(VISIBLE);
|
available.setVisibility(VISIBLE);
|
||||||
String format = getResources().getQuantityString(
|
available.setText(getResources().getQuantityString(
|
||||||
R.plurals.forums_available, availableCount);
|
R.plurals.forums_available, availableCount,
|
||||||
available.setText(String.format(format, availableCount));
|
availableCount));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user