-
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
39 changed files
with
491 additions
and
379 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.
63 changes: 63 additions & 0 deletions
63
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,63 @@ | ||
package org.jetbrains.kotlinconf | ||
|
||
import android.app.Application | ||
import androidx.activity.ComponentActivity | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.preference.PreferenceManager | ||
import com.russhwolf.settings.ObservableSettings | ||
import com.russhwolf.settings.SharedPreferencesSettings | ||
import com.tweener.alarmee.AlarmeeScheduler | ||
import com.tweener.alarmee.AlarmeeSchedulerAndroid | ||
import com.tweener.alarmee.AndroidNotificationConfiguration | ||
import com.tweener.alarmee.AndroidNotificationPriority | ||
import com.tweener.alarmee.channel.AlarmeeNotificationChannel | ||
import com.tweener.alarmee.configuration.AlarmeeAndroidPlatformConfiguration | ||
import dev.icerock.moko.permissions.PermissionsController | ||
import dev.icerock.moko.permissions.PermissionsControllerImpl | ||
import org.koin.core.module.Module | ||
import org.koin.dsl.module | ||
|
||
private const val ANDROID_NOTIFICATION_CHANNEL_ID = "channel_all_notifications" | ||
|
||
fun platformModule( | ||
activity: ComponentActivity, | ||
application: Application, | ||
notificationIconId: Int, | ||
): Module = module { | ||
single<ObservableSettings> { | ||
SharedPreferencesSettings(PreferenceManager.getDefaultSharedPreferences(application)) | ||
} | ||
single<NotificationManager> { | ||
AlarmeeNotificationManager( | ||
permissionsController = get(), | ||
alarmeeScheduler = get(), | ||
timeProvider = get(), | ||
androidConfig = AndroidNotificationConfiguration( | ||
AndroidNotificationPriority.HIGH, | ||
ANDROID_NOTIFICATION_CHANNEL_ID, | ||
notificationIconId, | ||
), | ||
) | ||
} | ||
single<PermissionsController> { | ||
PermissionsControllerImpl(application).apply { | ||
bind(activity) | ||
} | ||
} | ||
single<AlarmeeScheduler> { | ||
AlarmeeSchedulerAndroid( | ||
context = application, | ||
configuration = AlarmeeAndroidPlatformConfiguration( | ||
notificationIconResId = 0, | ||
notificationIconColor = Color.White, | ||
notificationChannels = listOf( | ||
AlarmeeNotificationChannel( | ||
id = ANDROID_NOTIFICATION_CHANNEL_ID, | ||
name = "All notifications", | ||
importance = android.app.NotificationManager.IMPORTANCE_HIGH, | ||
), | ||
), | ||
) | ||
) | ||
} | ||
} |
9 changes: 0 additions & 9 deletions
9
...droidMain/kotlin/org/jetbrains/kotlinconf/storage/MultiplatformSettingsStorage.android.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
3 changes: 0 additions & 3 deletions
3
shared/src/commonMain/kotlin/org/jetbrains/kotlinconf/ApplicationContext.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.