diff --git a/app/src/main/java/awais/instagrabber/repositories/responses/notification/NotificationCounts.kt b/app/src/main/java/awais/instagrabber/repositories/responses/notification/NotificationCounts.kt index d989dc0c..9e491168 100644 --- a/app/src/main/java/awais/instagrabber/repositories/responses/notification/NotificationCounts.kt +++ b/app/src/main/java/awais/instagrabber/repositories/responses/notification/NotificationCounts.kt @@ -1,9 +1,9 @@ package awais.instagrabber.repositories.responses.notification -class NotificationCounts(val commentLikesCount: Int, - val userTagsCount: Int, - val likesCount: Int, - val commentsCount: Int, - val relationshipsCount: Int, - val pOYCount: Int, - val requestsCount: Int) \ No newline at end of file +class NotificationCounts(val commentLikes: Int, + val usertags: Int, + val likes: Int, + val comments: Int, + val relationships: Int, + val photosOfYou: Int, + val requests: Int) \ No newline at end of file diff --git a/app/src/main/java/awais/instagrabber/services/ActivityCheckerService.java b/app/src/main/java/awais/instagrabber/services/ActivityCheckerService.java index 1845188e..8de02753 100644 --- a/app/src/main/java/awais/instagrabber/services/ActivityCheckerService.java +++ b/app/src/main/java/awais/instagrabber/services/ActivityCheckerService.java @@ -54,10 +54,9 @@ public class ActivityCheckerService extends Service { public void onSuccess(final NotificationCounts result) { try { if (result == null) return; - final String notification = getNotificationString(result); + final List notification = getNotificationString(result); if (notification == null) return; - final String notificationString = getString(R.string.activity_count_prefix) + " " + notification + "."; - showNotification(notificationString); + showNotification(notification); } finally { handler.postDelayed(runnable, DELAY_MILLIS); } @@ -88,42 +87,54 @@ public class ActivityCheckerService extends Service { handler.removeCallbacks(runnable); } - private String getNotificationString(final NotificationCounts result) { + private List getNotificationString(final NotificationCounts result) { + final List toReturn = new ArrayList<>(2); final List list = new ArrayList<>(); - if (result.getRelationshipsCount() != 0) { - list.add(getString(R.string.activity_count_relationship, result.getRelationshipsCount())); + int count = 0; + if (result.getRelationships() != 0) { + list.add(getString(R.string.activity_count_relationship, result.getRelationships())); + count += result.getRelationships(); } - if (result.getRequestsCount() != 0) { - list.add(getString(R.string.activity_count_requests, result.getRequestsCount())); + if (result.getRequests() != 0) { + list.add(getString(R.string.activity_count_requests, result.getRequests())); + count += result.getRequests(); } - if (result.getUserTagsCount() != 0) { - list.add(getString(R.string.activity_count_usertags, result.getUserTagsCount())); + if (result.getUsertags() != 0) { + list.add(getString(R.string.activity_count_usertags, result.getUsertags())); + count += result.getUsertags(); } - if (result.getPOYCount() != 0) { - list.add(getString(R.string.activity_count_poy, result.getPOYCount())); + if (result.getPhotosOfYou() != 0) { + list.add(getString(R.string.activity_count_poy, result.getPhotosOfYou())); + count += result.getPhotosOfYou(); } - if (result.getCommentsCount() != 0) { - list.add(getString(R.string.activity_count_comments, result.getCommentsCount())); + if (result.getComments() != 0) { + list.add(getString(R.string.activity_count_comments, result.getComments())); + count += result.getComments(); } - if (result.getCommentLikesCount() != 0) { - list.add(getString(R.string.activity_count_commentlikes, result.getCommentLikesCount())); + if (result.getCommentLikes() != 0) { + list.add(getString(R.string.activity_count_commentlikes, result.getCommentLikes())); + count += result.getCommentLikes(); } - if (result.getLikesCount() != 0) { - list.add(getString(R.string.activity_count_likes, result.getLikesCount())); + if (result.getLikes() != 0) { + list.add(getString(R.string.activity_count_likes, result.getLikes())); + count += result.getLikes(); } if (list.isEmpty()) return null; - return TextUtils.join(", ", list); + toReturn.add(TextUtils.join(", ", list)); + toReturn.add(getResources().getQuantityString(R.plurals.activity_count_total, count, count)); + return toReturn; } - private void showNotification(final String notificationString) { + private void showNotification(final List notificationString) { final Notification notification = new NotificationCompat.Builder(this, Constants.ACTIVITY_CHANNEL_ID) .setCategory(NotificationCompat.CATEGORY_STATUS) .setSmallIcon(R.drawable.ic_notif) .setAutoCancel(true) .setOnlyAlertOnce(true) .setPriority(NotificationCompat.PRIORITY_DEFAULT) - .setContentTitle(getString(R.string.action_notif)) - .setContentText(notificationString) + .setContentTitle(notificationString.get(1)) + .setContentText(notificationString.get(0)) + .setStyle(new NotificationCompat.BigTextStyle().bigText(notificationString.get(0))) .setContentIntent(getPendingIntent()) .build(); notificationManager.notify(Constants.ACTIVITY_NOTIFICATION_ID, notification); diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 6561c224..3b29f623 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -253,7 +253,6 @@ Suggested users Select Picture Uploading… - You have: %d follows %d comments %d comment likes diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 8bf7a8fe..e3c0f4ab 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -237,7 +237,6 @@ Usuaris suggerits Seleccionar imatge S\'està pujant… - Tens: %d seguidors %d comentaris %d m\'agrades al comentari diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index be7f21b0..2ef83896 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -245,7 +245,6 @@ Navrhovaní uživatelé Vybrat obrázek Nahrávání… - Máte: %d sleduje %d komentářů %d lajků komentáře diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 4b602693..4da61562 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -237,7 +237,6 @@ Vorgeschlagene Benutzer Bild auswählen Hochladen… - Du hast: %d Abonnenten %d Kommentare %d gelikte Kommentare diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index e05c7782..096bcbf2 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -237,7 +237,6 @@ Προτεινόμενοι χρήστες Επιλογή εικόνας Μεταφόρτωση… - Έχετε: %d ακόλουθοι %d σχόλια Το σχόλιο αρέσει σε %d diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 89e41e58..b16a341b 100755 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -237,7 +237,6 @@ Usuarios sugeridos Seleccionar imagen Subiendo… - Tienes: %d sigue %d comentarios %d me gustas en comentarios diff --git a/app/src/main/res/values-eu/strings.xml b/app/src/main/res/values-eu/strings.xml index d26f7b3b..2f8e6281 100644 --- a/app/src/main/res/values-eu/strings.xml +++ b/app/src/main/res/values-eu/strings.xml @@ -237,7 +237,6 @@ Iradokitutako erabiltzaileak Hautatu irudia Igotzen… - Duzuna: %d jarraitzaile %d iruzkin %d iruzkin-atsegite diff --git a/app/src/main/res/values-fa/strings.xml b/app/src/main/res/values-fa/strings.xml index 40c4a314..37654b7f 100644 --- a/app/src/main/res/values-fa/strings.xml +++ b/app/src/main/res/values-fa/strings.xml @@ -238,7 +238,6 @@ Suggested users انتخاب تصویر Uploading… - شما باید: %d دنبال کننده‌ %d دیدگاه %d پسند دیدگاه diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 0402c466..87d8c124 100755 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -237,7 +237,6 @@ Utilisateurs suggérés Sélectionnez une image Envoi en cours… - Vous avez : %d abonné(e)s %d commentaires %d j\'aime(s) sur le commentaire diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index e3ae4576..b7676cdb 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -238,7 +238,6 @@ सुझायें ऊपयोगकर्ता चित्र का चयन करें अपलोड हो रहा है... - आपके पास है: %d अनुगामी %d टिप्पणियाँ %d टिप्पणीयाँ पसन्दीत diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 5fc2a9fb..07dcc475 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -233,7 +233,6 @@ Pengguna yang disarankan Pilih Gambar Mengunggah… - Anda memiliki: %d mengikuti %d komentar %d suka komentar diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index e6600907..76f0a941 100755 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -237,7 +237,6 @@ Utenti suggeriti Seleziona Immagine Caricamento… - Hai: %d seguaci %d commenti %d mi piace al commento diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 68c201db..4c14f8f5 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -233,7 +233,6 @@ おすすめのユーザー 画像を選択 アップロード中… - あなたのステータス: %d 人のフォロワー %d コメント %d 個のコメントへのいいね! diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 4de78257..4367851a 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -233,7 +233,6 @@ 프로필 추천 사진 선택 업로드 중… - You have: %d follows %d comments %d comment likes diff --git a/app/src/main/res/values-mk/strings.xml b/app/src/main/res/values-mk/strings.xml index 5da6575f..cb8abc1c 100644 --- a/app/src/main/res/values-mk/strings.xml +++ b/app/src/main/res/values-mk/strings.xml @@ -237,7 +237,6 @@ Препорачани кориснчки сметки Селектирај слика Се Прикачува… - Вие имате: %d следачи %d коментари %d лајкови на коментари diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 689de451..4264eacf 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -237,7 +237,6 @@ Voorgestelde gebruikers Selecteer Afbeelding Bezig met uploaden… - Je hebt: %d volgers %d opmerkingen %d opmerking-likes diff --git a/app/src/main/res/values-or/strings.xml b/app/src/main/res/values-or/strings.xml index 5119d3ec..2ae5c0bd 100644 --- a/app/src/main/res/values-or/strings.xml +++ b/app/src/main/res/values-or/strings.xml @@ -237,7 +237,6 @@ Suggested users Select Picture Uploading… - You have: %d follows %d comments %d comment likes diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 9a157ce7..466deeca 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -245,7 +245,6 @@ Proponowani użytkownicy Wybierz obraz Przesyłanie… - Masz: %d obserwujących %d komentarzy %d polubionych komentarzy diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 1f9a39eb..44b57c37 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -237,7 +237,6 @@ Usuários sugeridos Selecionar imagem Enviando… - Você tem: %d seguidores %d comentários %d comentários curtidos diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 07b10200..f8a192e9 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -245,7 +245,6 @@ Предлагаемые пользователи Выберите изображение Загрузка… - У вас есть: %d подписано %d комментариев %d симпатий к комментарию diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 5164bf75..9d58c57f 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -245,7 +245,6 @@ Používatelia ktorých možno poznáte Vybrať fotografiu Nahráva sa… - Máš: %d sledovaní %d komentárov %d komentárov ktoré sa niekomu páčia diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 0114f7d3..e3f8c081 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -237,7 +237,6 @@ Suggested users Välj bild Laddar upp… - Du har: %d följer %d kommentarer %d gillade kommentarer diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index c146b1d2..7006a9d0 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -237,7 +237,6 @@ Önerilen kullanıcılar Resim Seç Yükleniyor… - Sahip olduğun: %d takip %d yorum %d yorum beğenisi diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index e23ab8f0..57c967d9 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -233,7 +233,6 @@ Người dùng được đề xuất Chọn hình ảnh Đang tải lên… - Bạn có: %d người theo dõi %d bình luận %d lượt thích bình luận diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 0a3d00b6..7ff31c0f 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -233,7 +233,6 @@ 推荐用户 选择图片 上传中... - 您有: %d 位新粉丝 %d 个评论回复 %d 个评论点赞 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index e4c6bbb4..412c67ce 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -233,7 +233,6 @@ 推薦用戶 選擇圖片 上傳中… - 您有 %d 個追蹤者 %d 個評論 %d 個評論的讚 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9c601e7f..ece231cb 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -242,7 +242,10 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Select Picture Uploading… - You have: + + You have %d notification + You have %d notifications + %d follows %d comments %d comment likes