Skip to content

Commit

Permalink
Targeting to Android 15 (#299)
Browse files Browse the repository at this point in the history
* Targeting to Android 15

* Fix spotless
  • Loading branch information
fornewid authored Nov 5, 2024
1 parent bf199f4 commit f56577b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package soup.movie.buildlogic

object Versions {
const val minSdk = 23
const val minSdk = 26
const val compileSdk = 35
const val targetSdk = 33
const val targetSdk = 35
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package soup.movie.feature.notification.impl
import android.app.NotificationChannel
import android.app.NotificationManager
import android.content.Context
import android.os.Build
import androidx.core.app.NotificationCompat.Builder
import soup.movie.feature.notification.R

Expand All @@ -38,13 +37,6 @@ object NotificationSpecs {
}
}

fun notifyLegacy(ctx: Context, intercept: Builder.() -> Builder) {
initialize(ctx)
ctx.getNotificationManager()?.run {
notify(3, Builder(ctx, NotificationChannels.EVENT).intercept().build())
}
}

fun notifyOpenDateAlarm(ctx: Context, intercept: Builder.() -> Builder) {
initialize(ctx)
ctx.getNotificationManager()?.run {
Expand All @@ -53,25 +45,23 @@ object NotificationSpecs {
}

private fun initialize(context: Context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.getNotificationManager()?.run {
val notice = NotificationChannel(
NotificationChannels.NOTICE,
context.getString(R.string.notification_channel_notice),
NotificationManager.IMPORTANCE_HIGH,
)
val event = NotificationChannel(
NotificationChannels.EVENT,
context.getString(R.string.notification_channel_event),
NotificationManager.IMPORTANCE_HIGH,
)
val openDateAlarm = NotificationChannel(
NotificationChannels.OPEN_DATE_ALARM,
context.getString(R.string.notification_channel_open_date_alarm),
NotificationManager.IMPORTANCE_HIGH,
)
createNotificationChannels(listOf(notice, event, openDateAlarm))
}
context.getNotificationManager()?.run {
val notice = NotificationChannel(
NotificationChannels.NOTICE,
context.getString(R.string.notification_channel_notice),
NotificationManager.IMPORTANCE_HIGH,
)
val event = NotificationChannel(
NotificationChannels.EVENT,
context.getString(R.string.notification_channel_event),
NotificationManager.IMPORTANCE_HIGH,
)
val openDateAlarm = NotificationChannel(
NotificationChannels.OPEN_DATE_ALARM,
context.getString(R.string.notification_channel_open_date_alarm),
NotificationManager.IMPORTANCE_HIGH,
)
createNotificationChannels(listOf(notice, event, openDateAlarm))
}
}

Expand Down

0 comments on commit f56577b

Please sign in to comment.