Skip to content

Commit

Permalink
Update to Frames 3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jahirfiquitiva committed Jan 3, 2024
1 parent f40e84e commit 4352945
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 18 deletions.
1 change: 1 addition & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

-keep class dev.jahir.frames.** { *; }

-keep class androidx.core.app.CoreComponentFactory { *; }
-keep class com.google.**
-keep class autovalue.shaded.com.google.**
-keep class com.android.vending.billing.**
Expand Down
7 changes: 3 additions & 4 deletions app/src/main/kotlin/dev/jahir/frames/app/MyApplication.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package dev.jahir.frames.app

import dev.jahir.frames.ui.FramesApplication

// TODO: Remove comment marks to enable
// import com.onesignal.OneSignal
// import com.onesignal.OSNotificationReceivedEvent
// import com.onesignal.OneSignal
// import dev.jahir.frames.extensions.context.preferences
import dev.jahir.frames.ui.FramesApplication

class MyApplication : FramesApplication(BuildConfig.ONESIGNAL_APP_ID) {
override fun onCreate() {
Expand All @@ -26,6 +25,6 @@ class MyApplication : FramesApplication(BuildConfig.ONESIGNAL_APP_ID) {
OneSignal.unsubscribeWhenNotificationsAreDisabled(true)
OneSignal.pauseInAppMessages(true)
OneSignal.setLocationShared(false)
*/
*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,30 @@ package dev.jahir.frames.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.frames.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)
}
Expand Down
17 changes: 17 additions & 0 deletions app/src/main/res/drawable/ic_notification.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="#fff"
android:pathData="M20.6,9.5C20.6,9.5,20.6,9.5,20.6,9.5l0-2c0,0,0,0,0,0V6.1c0-0.7-0.6-1.4-1.4-1.4h-0.5h-1.9h-3.1h-0.7H4.7
C4,4.7,3.4,5.3,3.4,6.1V12L2,18.2c-0.1,0.6,0.3,1.1,0.9,1.1h1.8h1.4h11.9h1.4h1.8c0.6,0,1-0.5,0.9-1.1L20.6,12V9.5z
M16.6,14.1
c-0.7,0.1-1.5,1.5-2.7,0.2c-0.1-0.1-0.1-0.1-0.2-0.2c0,0,0.2,1.6,0.1,1.8c-0.1,0.2-2.5,2-3.2,1.4c-0.1-0.1-0.2-0.2-0.2-0.5
c-0.2-1.7,1.3-4,1.3-4s-2.3,1.4-4,1.3c-0.2,0-0.4-0.1-0.5-0.2c-0.7-0.7,1.1-3,1.4-3.2c0.3-0.2,1.8,0.1,1.8,0.1
c-0.1-0.1-0.1-0.1-0.2-0.2C9,9.4,10.4,8.6,10.5,7.9c0.1-0.7,1-1.4,1-1.4c0.1,0.1,0.2,0.2,0.3,0.3c2.1,2.1,0.7,5.4,0.7,5.4
s3.3-1.4,5.3,0.6c0.1,0.1,0.2,0.2,0.3,0.3C18,13.1,17.4,13.9,16.6,14.1z" />
</vector>
4 changes: 2 additions & 2 deletions buildSrc/src/main/java/MyApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

object MyApp {
const val appId = "dev.jahir.frames.app"
const val version = 358
const val versionName = "3.5.8"
const val version = 360
const val versionName = "3.6.0"
}
10 changes: 5 additions & 5 deletions buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

object Versions {
// Plugins
const val gradle = "8.1.1"
const val kotlin = "1.9.10"
const val ksp = "$kotlin-1.0.13"
const val gradle = "8.2.0"
const val kotlin = "1.9.22"
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
const val targetSdk = 34
const val buildTools = "34.0.0"

// Frames
const val frames = "3.5.8"
const val frames = "3.6.0"
}

0 comments on commit 4352945

Please sign in to comment.