From f52921bb76ad44c4455c70748a0c2c284af40b29 Mon Sep 17 00:00:00 2001 From: Doyoon Kim Date: Wed, 23 Oct 2024 23:41:07 +0900 Subject: [PATCH] [REFACT] Replace Notification Icon. - Replace notification icon from SmallIcon to LargeIcon for better visibility. - Convert string resource 'notification channel name' into translatable. --- .../java/com/doyoonkim/knutice/fcm/PushNotificationHandler.kt | 4 +++- app/src/main/res/values-ko-rKR/strings.xml | 3 ++- app/src/main/res/values/strings.xml | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/doyoonkim/knutice/fcm/PushNotificationHandler.kt b/app/src/main/java/com/doyoonkim/knutice/fcm/PushNotificationHandler.kt index 8ef4d89..6d52ba0 100644 --- a/app/src/main/java/com/doyoonkim/knutice/fcm/PushNotificationHandler.kt +++ b/app/src/main/java/com/doyoonkim/knutice/fcm/PushNotificationHandler.kt @@ -5,6 +5,8 @@ import android.app.NotificationChannel import android.app.NotificationManager import android.content.Context import android.content.pm.PackageManager +import android.graphics.Bitmap +import android.graphics.drawable.Icon import android.os.Build import android.util.Log import androidx.core.app.ActivityCompat @@ -54,7 +56,7 @@ class PushNotificationHandler @Inject constructor() : FirebaseMessagingService() val notificationBuilder = NotificationCompat.Builder( applicationContext, getString(R.string.inapp_notification_channel_id) ) - .setSmallIcon(R.mipmap.ic_launcher) + .setLargeIcon(Icon.createWithResource(applicationContext, R.mipmap.ic_launcher)) .setContentTitle(getString(R.string.new_notice)) .setContentText(this@toPushNotification.notification?.body ?: "No message body") .setPriority(NotificationCompat.PRIORITY_DEFAULT) diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 712f038..b10222c 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -12,8 +12,9 @@ 더보기 버전정보 오픈소스 라이센스 - 1.0.0 알파 (내부테스트용) + 1.0.1 알파 (내부테스트용) 알림 설정 새로운 알림이 도착했어요! + 신규 공지 알림 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0dbd9c1..52711f4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -11,7 +11,7 @@ About Version Open Source License - 1.0.0 Alpha + 1.0.1 Alpha Notification Preference New Notice has been delivered! @@ -19,5 +19,5 @@ knutice default notification channel for FCM knutice_inapp_notification_channel knutice inapp notification channel - knutice inapp notification Channel + KNUTICE In-app Notice \ No newline at end of file