Skip to content

Commit

Permalink
[REFACT] Replace Notification Icon.
Browse files Browse the repository at this point in the history
  - Replace notification icon from SmallIcon to LargeIcon for better visibility.
  - Convert string resource 'notification channel name' into translatable.
  • Loading branch information
doyoonkim3312 committed Oct 23, 2024
1 parent 3f076cd commit f52921b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values-ko-rKR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
<string name="about_title">๋”๋ณด๊ธฐ</string>
<string name="about_version">๋ฒ„์ „์ •๋ณด</string>
<string name="about_oss">์˜คํ”ˆ์†Œ์Šค ๋ผ์ด์„ผ์Šค</string>
<string name="version_code">1.0.0 ์•ŒํŒŒ (๋‚ด๋ถ€ํ…Œ์ŠคํŠธ์šฉ)</string>
<string name="version_code">1.0.1 ์•ŒํŒŒ (๋‚ด๋ถ€ํ…Œ์ŠคํŠธ์šฉ)</string>
<string name="pref_notification_title">์•Œ๋ฆผ</string>
<string name="title_preference">์„ค์ •</string>
<string name="new_notice">์ƒˆ๋กœ์šด ์•Œ๋ฆผ์ด ๋„์ฐฉํ–ˆ์–ด์š”!</string>
<string name="inapp_notificaiton_channel_name">์‹ ๊ทœ ๊ณต์ง€ ์•Œ๋ฆผ</string>
</resources>
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
<string name="about_title">About</string>
<string name="about_version">Version</string>
<string name="about_oss">Open Source License</string>
<string name="version_code">1.0.0 Alpha</string>
<string name="version_code">1.0.1 Alpha</string>
<string name="pref_notification_title">Notification</string>
<string name="title_preference">Preference</string>
<string name="new_notice">New Notice has been delivered!</string>
<string name="default_notification_channel_id" translatable="false">knutice_default_fcm_channel</string>
<string name="default_notification_channel_description" translatable="false">knutice default notification channel for FCM</string>
<string name="inapp_notification_channel_id" translatable="false">knutice_inapp_notification_channel</string>
<string name="inapp_notification_channel_description" translatable="false">knutice inapp notification channel</string>
<string name="inapp_notificaiton_channel_name" translatable="false">knutice inapp notification Channel</string>
<string name="inapp_notificaiton_channel_name">KNUTICE In-app Notice</string>
</resources>

0 comments on commit f52921b

Please sign in to comment.