Browse Source

New notification icons

pull/27/head
Ezerous 7 years ago
parent
commit
43deae2d38
No known key found for this signature in database GPG Key ID: 262B2954BBA319E3
  1. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java
  2. 25
      app/src/main/java/gr/thmmy/mthmmy/services/NotificationService.java
  3. BIN
      app/src/main/res/drawable-hdpi/ic_notification.png
  4. BIN
      app/src/main/res/drawable-mdpi/ic_notification.png
  5. BIN
      app/src/main/res/drawable-xhdpi/ic_notification.png
  6. BIN
      app/src/main/res/drawable-xxhdpi/ic_notification.png

2
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)

25
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());
}
}

BIN
app/src/main/res/drawable-hdpi/ic_notification.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

BIN
app/src/main/res/drawable-mdpi/ic_notification.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

BIN
app/src/main/res/drawable-xhdpi/ic_notification.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 800 B

BIN
app/src/main/res/drawable-xxhdpi/ic_notification.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Loading…
Cancel
Save