From 43deae2d38554772a66826df2729e51eb994f5d7 Mon Sep 17 00:00:00 2001 From: Ezerous Date: Sat, 7 Jul 2018 11:41:11 +0300 Subject: [PATCH] New notification icons --- .../activities/topic/TopicActivity.java | 2 +- .../mthmmy/services/NotificationService.java | 25 +++--------------- .../res/drawable-hdpi/ic_notification.png | Bin 0 -> 581 bytes .../res/drawable-mdpi/ic_notification.png | Bin 0 -> 418 bytes .../res/drawable-xhdpi/ic_notification.png | Bin 0 -> 800 bytes .../res/drawable-xxhdpi/ic_notification.png | Bin 0 -> 1245 bytes 6 files changed, 5 insertions(+), 22 deletions(-) create mode 100644 app/src/main/res/drawable-hdpi/ic_notification.png create mode 100644 app/src/main/res/drawable-mdpi/ic_notification.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_notification.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_notification.png diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java index de572b2f..cffbc290 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java @@ -898,7 +898,7 @@ public class TopicActivity extends BaseActivity { @Override protected Boolean doInBackground(String... args) { - final String sentFrommTHMMY = "\n[right][size=7pt][i]sent from [url=https://play.google.com/store/apps/details?id=gr.thmmy.mthmmy]mTHMMY [/url][/i][/size][/right]"; + final String sentFrommTHMMY = "\n[right][size=7pt][i]sent from [url=https://play.google.com/store/apps/details?id=gr.thmmy.mthmmy]mTHMMY[/url] [/i][/size][/right]"; RequestBody postBody = new MultipartBody.Builder() .setType(MultipartBody.FORM) .addFormDataPart("message", args[1] + sentFrommTHMMY) diff --git a/app/src/main/java/gr/thmmy/mthmmy/services/NotificationService.java b/app/src/main/java/gr/thmmy/mthmmy/services/NotificationService.java index 6841252e..2ebe4a37 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/services/NotificationService.java +++ b/app/src/main/java/gr/thmmy/mthmmy/services/NotificationService.java @@ -64,7 +64,6 @@ public class NotificationService extends FirebaseMessagingService { private static final String NEW_POSTS_COUNT = "newPostsCount"; public static final String NEW_POST_TAG = "NEW_POST"; private static final String SUMMARY_TAG = "SUMMARY"; - private static final String DELETED_MESSAGES_TAG = "DELETED_MESSAGES"; /** * Create and show a new post notification. @@ -99,7 +98,7 @@ public class NotificationService extends FirebaseMessagingService { NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, CHANNEL_ID) - .setSmallIcon(R.mipmap.ic_launcher) + .setSmallIcon(R.drawable.ic_notification) .setContentTitle(postNotification.getTopicTitle()) .setContentText(contentText) .setAutoCancel(true) @@ -121,7 +120,7 @@ public class NotificationService extends FirebaseMessagingService { { summaryNotificationBuilder = new NotificationCompat.Builder(this, CHANNEL_ID) - .setSmallIcon(R.mipmap.ic_launcher) + .setSmallIcon(R.drawable.ic_notification) .setGroupSummary(true) .setGroup(GROUP_KEY) .setAutoCancel(true) @@ -177,24 +176,8 @@ public class NotificationService extends FirebaseMessagingService { @Override public void onDeletedMessages() { super.onDeletedMessages(); - NotificationCompat.Builder notificationBuilder = - new NotificationCompat.Builder(this, CHANNEL_ID) - .setSmallIcon(R.mipmap.ic_launcher) - .setContentTitle("Error fetching notifications!") - .setContentText("Some notifications may not have arrived successfully either due to" + - "the amount of pending messages (>100) or if the device hasn't come online for more than a month.") - .setAutoCancel(true) - .setDefaults(Notification.DEFAULT_ALL); - - if (buildVersion < Build.VERSION_CODES.O) - notificationBuilder.setPriority(Notification.PRIORITY_MAX); - - NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + Timber.w("onDeletedMessages"); + } - // Since Android Oreo notification channel is needed. - if (buildVersion >= Build.VERSION_CODES.O) - notificationManager.createNotificationChannel(new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH)); - notificationManager.notify(DELETED_MESSAGES_TAG, 0, notificationBuilder.build()); - } } diff --git a/app/src/main/res/drawable-hdpi/ic_notification.png b/app/src/main/res/drawable-hdpi/ic_notification.png new file mode 100644 index 0000000000000000000000000000000000000000..6b78b6e6b1304abdd6ae4e2c2555675ee56579e0 GIT binary patch literal 581 zcmV-L0=oT)P)AP?a>qprm za}|p1jxo01ZxtLBaWJtaO4#_TW#oxbnsSqA81#aL*nC!z-s~#D#<^m?gZiz;7d|TxXEgbxiGH4bp%tj%#0%8fW+Lv{f^Dk;FdvkAeH?_$sOEW0RY4> zoAU=%9i#ztCldRn_Kn@M*B`8JKy+eITjrEL@^VgBVmA^Fp#MIIHfPW7U}Ya`iz|R+ zWCA|J(f@GP*gx|{gn>4KsBGBW*@(p5av!REq=jPr^1xg};z%>^2f=`plGM>E>!q{H zQ6qLWl_poCAiQSmf*o)k_7|VoFi4X3Vnkc&<26?gt+zm91=h3W067bx{t7Sv_tV}7 T$)$J000000NkvXXu0mjf?=A!( literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/ic_notification.png b/app/src/main/res/drawable-mdpi/ic_notification.png new file mode 100644 index 0000000000000000000000000000000000000000..b8c700e0542e67f6273f28f42e439b6067fa39ba GIT binary patch literal 418 zcmV;T0bTxyP)*9JWCPfs*}%DzK3Dv}zB6e#=@ZDlm+xhpOhL}Ml0F5Y#L`H3 z7-JsUQX-`}p&<+|Oh1H5`#q`Pp)pWM2Xd07(1ldopM#n*aa+ M07*qoM6N<$f~+U6EdT%j literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/ic_notification.png b/app/src/main/res/drawable-xhdpi/ic_notification.png new file mode 100644 index 0000000000000000000000000000000000000000..79982cca2683fa1f09ed9646a5e3e9bdcaa9f7eb GIT binary patch literal 800 zcmV+*1K<3KP)c95s}8Eclevjne-RwGwEryT0PJ1JsGV?Q_`xlmxeSWjpi~u@8qN;O>SX$ zh*O(N%E=-^8^@$=cN^JD8=rQ!mlB1++xWbjPbx1bW;Wi>iJ4$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