-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
239 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
shared/src/androidMain/kotlin/org/jetbrains/kotlinconf/ApplicationContext.android.kt
This file was deleted.
Oops, something went wrong.
63 changes: 0 additions & 63 deletions
63
shared/src/androidMain/kotlin/org/jetbrains/kotlinconf/NotificationManager.android.kt
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
shared/src/androidMain/kotlin/org/jetbrains/kotlinconf/platformModule.android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.jetbrains.kotlinconf | ||
|
||
import android.app.Application | ||
import androidx.activity.ComponentActivity | ||
import androidx.compose.ui.graphics.Color | ||
import com.russhwolf.settings.ObservableSettings | ||
import com.tweener.alarmee.AlarmeeScheduler | ||
import com.tweener.alarmee.AlarmeeSchedulerAndroid | ||
import com.tweener.alarmee.configuration.AlarmeeAndroidPlatformConfiguration | ||
import dev.icerock.moko.permissions.PermissionsController | ||
import dev.icerock.moko.permissions.PermissionsControllerImpl | ||
import org.jetbrains.kotlinconf.storage.createSettings | ||
import org.koin.core.module.Module | ||
import org.koin.dsl.module | ||
|
||
fun platformModule( | ||
activity: ComponentActivity, | ||
application: Application, | ||
): Module = module { | ||
single<ObservableSettings> { createSettings(application) } | ||
single { NotificationManager(get()) } | ||
single<PermissionsController> { | ||
PermissionsControllerImpl(application).apply { | ||
bind(activity) | ||
} | ||
} | ||
single<AlarmeeScheduler> { | ||
AlarmeeSchedulerAndroid( | ||
context = application, | ||
configuration = AlarmeeAndroidPlatformConfiguration( | ||
notificationIconResId = 0, | ||
notificationIconColor = Color.White, | ||
notificationChannels = emptyList() | ||
) | ||
) | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
...droidMain/kotlin/org/jetbrains/kotlinconf/storage/MultiplatformSettingsStorage.android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
package org.jetbrains.kotlinconf.storage | ||
|
||
import android.app.Application | ||
import androidx.preference.PreferenceManager | ||
import com.russhwolf.settings.ObservableSettings | ||
import com.russhwolf.settings.SharedPreferencesSettings | ||
import org.jetbrains.kotlinconf.ApplicationContext | ||
|
||
actual fun createSettings(context: ApplicationContext): ObservableSettings = | ||
SharedPreferencesSettings(PreferenceManager.getDefaultSharedPreferences(context.application)) | ||
fun createSettings(application: Application): ObservableSettings = | ||
SharedPreferencesSettings(PreferenceManager.getDefaultSharedPreferences(application)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
shared/src/commonMain/kotlin/org/jetbrains/kotlinconf/ApplicationContext.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
shared/src/commonMain/kotlin/org/jetbrains/kotlinconf/NotificationManager.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
package org.jetbrains.kotlinconf | ||
|
||
|
||
expect class NotificationManager(context: ApplicationContext) { | ||
fun requestPermission() | ||
expect class NotificationManager { | ||
suspend fun requestPermission(): Boolean | ||
|
||
fun schedule(delay: Long, title: String, message: String): String? | ||
|
||
fun cancel(title: String) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.