From 7571a51e16e9fd85d7c76d483676114f2f81e7d2 Mon Sep 17 00:00:00 2001 From: Jahir Fiquitiva Date: Sat, 13 Jan 2024 20:38:27 -0500 Subject: [PATCH] feat: update to Kuper 2.5.0 --- app/proguard-rules.pro | 1 + .../app/NotificationServiceExtension.kt | 15 ++++++++------- app/src/main/res/drawable/ic_notification.xml | 17 +++++++++++++++++ buildSrc/src/main/java/Blueprint.kt | 4 ++-- buildSrc/src/main/java/Versions.kt | 10 +++++----- library/proguard-rules.pro | 1 + 6 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 app/src/main/res/drawable/ic_notification.xml diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 9f744b580..696cbe2f5 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -24,6 +24,7 @@ -keep class dev.jahir.kuper.** { *; } -keep class dev.jahir.blueprint.** { *; } +-keep class androidx.core.app.CoreComponentFactory { *; } -keep class com.google.** -keep class autovalue.shaded.com.google.** -keep class com.android.vending.billing.** diff --git a/app/src/main/kotlin/dev/jahir/blueprint/app/NotificationServiceExtension.kt b/app/src/main/kotlin/dev/jahir/blueprint/app/NotificationServiceExtension.kt index ec5a5d22f..a0b493624 100644 --- a/app/src/main/kotlin/dev/jahir/blueprint/app/NotificationServiceExtension.kt +++ b/app/src/main/kotlin/dev/jahir/blueprint/app/NotificationServiceExtension.kt @@ -2,28 +2,29 @@ package dev.jahir.blueprint.app /* TODO: Remove comment marks to enable import android.content.Context -import androidx.core.app.NotificationCompat import com.onesignal.OSNotificationReceivedEvent import com.onesignal.OneSignal.OSRemoteNotificationReceivedHandler +import dev.jahir.kuper.app.R import dev.jahir.frames.extensions.context.color -import dev.jahir.frames.extensions.context.drawable -import dev.jahir.frames.extensions.context.preferences import dev.jahir.frames.extensions.context.hasNotificationsPermission +import dev.jahir.frames.extensions.context.preferences class NotificationServiceExtension : OSRemoteNotificationReceivedHandler { override fun remoteNotificationReceived( context: Context, notificationReceivedEvent: OSNotificationReceivedEvent ) { - if(!context.preferences.notificationsEnabled || !context.hasNotificationsPermission) { + if (!context.preferences.notificationsEnabled || !context.hasNotificationsPermission) { notificationReceivedEvent.complete(null) return } val notification = notificationReceivedEvent.notification val mutableNotification = notification.mutableCopy() - mutableNotification.setExtender { builder: NotificationCompat.Builder -> - builder.color = context.color(R.color.accent) - builder.setSmallIcon(R.drawable.ic_notification) + mutableNotification.setExtender { extender -> + extender.apply { + color = context.color(R.color.accent) + setSmallIcon(R.drawable.ic_notification) + } } notificationReceivedEvent.complete(mutableNotification) } diff --git a/app/src/main/res/drawable/ic_notification.xml b/app/src/main/res/drawable/ic_notification.xml new file mode 100644 index 000000000..df6affc34 --- /dev/null +++ b/app/src/main/res/drawable/ic_notification.xml @@ -0,0 +1,17 @@ + + + + + diff --git a/buildSrc/src/main/java/Blueprint.kt b/buildSrc/src/main/java/Blueprint.kt index c07e8c5fe..cf3d43c1e 100644 --- a/buildSrc/src/main/java/Blueprint.kt +++ b/buildSrc/src/main/java/Blueprint.kt @@ -2,6 +2,6 @@ object Blueprint { const val appId = "dev.jahir.blueprint.app" - const val version = 239 - const val versionName = "2.3.9" + const val version = 240 + const val versionName = "2.4.0" } diff --git a/buildSrc/src/main/java/Versions.kt b/buildSrc/src/main/java/Versions.kt index a69642ad6..a67e2275c 100644 --- a/buildSrc/src/main/java/Versions.kt +++ b/buildSrc/src/main/java/Versions.kt @@ -2,13 +2,13 @@ object Versions { // Plugins - const val gradle = "8.1.1" - const val kotlin = "1.9.10" + const val gradle = "8.2.0" + const val kotlin = "1.9.22" const val sonatype = "1.3.0" - const val ksp = "$kotlin-1.0.13" + const val ksp = "$kotlin-1.0.16" // OneSignal - const val oneSignal = "4.8.6" + const val oneSignal = "4.8.7" // App const val minSdk = 21 @@ -16,7 +16,7 @@ object Versions { const val buildTools = "34.0.0" // Kuper - const val kuper = "2.4.9" + const val kuper = "2.5.0" // Adaptive Icons const val adaptiveIcons = "1.0.1" diff --git a/library/proguard-rules.pro b/library/proguard-rules.pro index 9f744b580..696cbe2f5 100644 --- a/library/proguard-rules.pro +++ b/library/proguard-rules.pro @@ -24,6 +24,7 @@ -keep class dev.jahir.kuper.** { *; } -keep class dev.jahir.blueprint.** { *; } +-keep class androidx.core.app.CoreComponentFactory { *; } -keep class com.google.** -keep class autovalue.shaded.com.google.** -keep class com.android.vending.billing.**