Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/ChatHistory_schema_v2.xml

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
alias(libs.plugins.android.gradle)
id("kotlin-android")
alias(libs.plugins.serialization)
id("dagger.hilt.android.plugin")
id("org.jetbrains.kotlin.plugin.parcelize")
alias(libs.plugins.google.services)
alias(libs.plugins.crashlytics.gradle)
Expand Down Expand Up @@ -91,8 +90,6 @@ dependencies {
testImplementation(libs.coroutines.test)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.androidx.test.espresso.core)
androidTestImplementation(libs.hilt.android.testing)
kspAndroidTest(libs.hilt.android.compiler)
testImplementation(libs.mockk)

implementation(libs.androidx.room.runtime)
Expand All @@ -105,12 +102,6 @@ dependencies {
implementation(libs.coroutines.android)

implementation(libs.androidx.activity.compose)
implementation(libs.androidx.hilt.navigation.compose)

implementation(libs.timber)

implementation(libs.hilt.android)
ksp(libs.hilt.android.compiler)

implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics)
Expand Down Expand Up @@ -143,4 +134,14 @@ dependencies {

implementation(libs.lyricist)
ksp(libs.lyricist.processor)

val koinBom = platform(libs.koin.bom)
implementation(koinBom)
implementation(libs.koin.core)
implementation(libs.koin.android)
implementation(libs.koin.compose)
implementation(libs.koin.compose.viewmodel)

implementation(libs.kermit)
implementation(libs.kermit.crashlytics)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,23 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.os.PowerManager
import co.touchlab.kermit.Logger
import com.timilehinaregbesola.mathalarm.framework.Usecases
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import timber.log.Timber
import javax.inject.Inject
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject

/**
* [BroadcastReceiver] to be notified by the [android.app.AlarmManager].
*/
@AndroidEntryPoint
class AlarmReceiver : BroadcastReceiver() {
@Inject lateinit var usecases: Usecases
class AlarmReceiver : BroadcastReceiver(), KoinComponent {
val usecases: Usecases by inject()

@OptIn(DelicateCoroutinesApi::class)
override fun onReceive(context: Context, intent: Intent) {
Timber.d("onReceive() - intent ${intent.action}")
Logger.d("onReceive() - intent ${intent.action}")

if (intent.action == ALARM_ACTION) {
val powerManager = context.getSystemService(Context.POWER_SERVICE) as PowerManager
Expand All @@ -48,12 +47,12 @@ class AlarmReceiver : BroadcastReceiver() {
"android.intent.action.QUICKBOOT_POWERON",
"android.intent.action.MY_PACKAGE_REPLACED",
AlarmManager.ACTION_SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED -> {
Timber.d("Reboot Reboot!!")
Logger.d("Reboot Reboot!!")
usecases.rescheduleFutureAlarms()
}
else -> {
Timber.e("action: ${intent?.action}")
Timber.e("Action not supported")
Logger.e("action: ${intent?.action}")
Logger.e("Action not supported")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
package com.timilehinaregbesola.mathalarm.framework.app

import android.app.Application
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.ui.ExperimentalComposeUiApi
import co.touchlab.kermit.Logger
import com.google.firebase.messaging.FirebaseMessaging
import dagger.hilt.android.HiltAndroidApp
import timber.log.Timber
import com.timilehinaregbesola.mathalarm.framework.app.di.appModule
import kotlinx.coroutines.InternalCoroutinesApi
import org.koin.android.ext.koin.androidContext
import org.koin.core.context.startKoin

@HiltAndroidApp
class AlarmApplication : Application() {
@OptIn(ExperimentalAnimationApi::class, ExperimentalComposeUiApi::class,
ExperimentalFoundationApi::class, InternalCoroutinesApi::class
)
override fun onCreate() {
super.onCreate()
Timber.plant(Timber.DebugTree())
startKoin {
androidContext(this@AlarmApplication)
modules(appModule)
}
Logger.setTag("MathAlarm")
FirebaseMessaging.getInstance().subscribeToTopic("all")
}
}
Loading
Loading