diff --git a/.gitignore b/.gitignore index 8df35eb6..3f32039e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ bin/ gen/ out/ +output.json # Gradle files .gradle/ diff --git a/VERSION b/VERSION deleted file mode 100644 index 31e5c843..00000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.3.3 diff --git a/app/build.gradle b/app/build.gradle index aafe1fe9..35194bae 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "gr.thmmy.mthmmy" minSdkVersion 19 targetSdkVersion 27 - versionCode 12 - versionName "1.4.0" + versionCode 13 + versionName "1.4.1" archivesBaseName = "mTHMMY-v$versionName" } 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 e1789a12..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 ae439dd9..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) @@ -112,19 +111,16 @@ public class NotificationService extends FirebaseMessagingService { notificationBuilder.setPriority(PRIORITY_MAX); boolean createSummaryNotification = false; - if(buildVersion >= Build.VERSION_CODES.LOLLIPOP) - { - createSummaryNotification = true; - if(buildVersion >= Build.VERSION_CODES.M) - createSummaryNotification = otherNotificationsExist(topicId); - } + if(buildVersion >= Build.VERSION_CODES.M) + createSummaryNotification = otherNotificationsExist(topicId); + NotificationCompat.Builder summaryNotificationBuilder = null; if(createSummaryNotification) { summaryNotificationBuilder = new NotificationCompat.Builder(this, CHANNEL_ID) - .setSmallIcon(R.mipmap.ic_launcher) + .setSmallIcon(R.drawable.ic_notification) .setGroupSummary(true) .setGroup(GROUP_KEY) .setAutoCancel(true) @@ -180,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); + Timber.w("onDeletedMessages"); + } - NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); - // 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 00000000..6b78b6e6 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_notification.png differ 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 00000000..b8c700e0 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_notification.png differ 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 00000000..79982cca Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_notification.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_notification.png b/app/src/main/res/drawable-xxhdpi/ic_notification.png new file mode 100644 index 00000000..00a4e37b Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_notification.png differ diff --git a/app/src/main/res/layout/activity_bookmark.xml b/app/src/main/res/layout/activity_bookmark.xml index 03bee885..939fb01a 100644 --- a/app/src/main/res/layout/activity_bookmark.xml +++ b/app/src/main/res/layout/activity_bookmark.xml @@ -30,6 +30,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" + app:tabMaxWidth="0dp" app:tabGravity="fill" app:tabMode="fixed" app:tabSelectedTextColor="@color/accent"