-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
1 parent
46f92d0
commit 80b3a75
Showing
19 changed files
with
173 additions
and
15 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
.../common/src/androidMain/kotlin/org/michaelbel/movies/common/notify/di/NotifyKoinModule.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,11 @@ | ||
package org.michaelbel.movies.common.notify.di | ||
|
||
import org.koin.core.module.dsl.bind | ||
import org.koin.core.module.dsl.singleOf | ||
import org.koin.dsl.module | ||
import org.michaelbel.movies.common.notify.NotifyManager | ||
import org.michaelbel.movies.common.notify.impl.NotifyManagerImpl | ||
|
||
actual val notifyKoinModule = module { | ||
singleOf(::NotifyManagerImpl) { bind<NotifyManager>() } | ||
} |
13 changes: 13 additions & 0 deletions
13
...mmon/src/androidMain/kotlin/org/michaelbel/movies/common/notify/impl/NotifyManagerImpl.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,13 @@ | ||
package org.michaelbel.movies.common.notify.impl | ||
|
||
import android.content.Context | ||
import org.michaelbel.movies.common.ktx.notificationManager | ||
import org.michaelbel.movies.common.notify.NotifyManager | ||
|
||
internal class NotifyManagerImpl( | ||
private val context: Context | ||
): NotifyManager { | ||
|
||
override val areNotificationsEnabled: Boolean | ||
get() = context.notificationManager.areNotificationsEnabled() | ||
} |
6 changes: 6 additions & 0 deletions
6
core/common/src/commonMain/kotlin/org/michaelbel/movies/common/notify/NotifyManager.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,6 @@ | ||
package org.michaelbel.movies.common.notify | ||
|
||
interface NotifyManager { | ||
|
||
val areNotificationsEnabled: Boolean | ||
} |
5 changes: 5 additions & 0 deletions
5
core/common/src/commonMain/kotlin/org/michaelbel/movies/common/notify/di/NotifyKoinModule.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,5 @@ | ||
package org.michaelbel.movies.common.notify.di | ||
|
||
import org.koin.core.module.Module | ||
|
||
expect val notifyKoinModule: Module |
11 changes: 11 additions & 0 deletions
11
core/common/src/iosMain/kotlin/org/michaelbel/movies/common/notify/di/NotifyKoinModule.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,11 @@ | ||
package org.michaelbel.movies.common.notify.di | ||
|
||
import org.koin.core.module.dsl.bind | ||
import org.koin.core.module.dsl.singleOf | ||
import org.koin.dsl.module | ||
import org.michaelbel.movies.common.notify.NotifyManager | ||
import org.michaelbel.movies.common.notify.impl.NotifyManagerImpl | ||
|
||
actual val notifyKoinModule = module { | ||
singleOf(::NotifyManagerImpl) { bind<NotifyManager>() } | ||
} |
9 changes: 9 additions & 0 deletions
9
core/common/src/iosMain/kotlin/org/michaelbel/movies/common/notify/impl/NotifyManagerImpl.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,9 @@ | ||
package org.michaelbel.movies.common.notify.impl | ||
|
||
import org.michaelbel.movies.common.notify.NotifyManager | ||
|
||
internal class NotifyManagerImpl: NotifyManager { | ||
|
||
override val areNotificationsEnabled: Boolean | ||
get() = false | ||
} |
11 changes: 11 additions & 0 deletions
11
core/common/src/jsMain/kotlin/org/michaelbel/movies/common/notify/di/NotifyKoinModule.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,11 @@ | ||
package org.michaelbel.movies.common.notify.di | ||
|
||
import org.koin.core.module.dsl.bind | ||
import org.koin.core.module.dsl.singleOf | ||
import org.koin.dsl.module | ||
import org.michaelbel.movies.common.notify.NotifyManager | ||
import org.michaelbel.movies.common.notify.impl.NotifyManagerImpl | ||
|
||
actual val notifyKoinModule = module { | ||
singleOf(::NotifyManagerImpl) { bind<NotifyManager>() } | ||
} |
9 changes: 9 additions & 0 deletions
9
core/common/src/jsMain/kotlin/org/michaelbel/movies/common/notify/impl/NotifyManagerImpl.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,9 @@ | ||
package org.michaelbel.movies.common.notify.impl | ||
|
||
import org.michaelbel.movies.common.notify.NotifyManager | ||
|
||
internal class NotifyManagerImpl: NotifyManager { | ||
|
||
override val areNotificationsEnabled: Boolean | ||
get() = false | ||
} |
11 changes: 11 additions & 0 deletions
11
core/common/src/jvmMain/kotlin/org/michaelbel/movies/common/notify/di/NotifyKoinModule.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,11 @@ | ||
package org.michaelbel.movies.common.notify.di | ||
|
||
import org.koin.core.module.dsl.bind | ||
import org.koin.core.module.dsl.singleOf | ||
import org.koin.dsl.module | ||
import org.michaelbel.movies.common.notify.NotifyManager | ||
import org.michaelbel.movies.common.notify.impl.NotifyManagerImpl | ||
|
||
actual val notifyKoinModule = module { | ||
singleOf(::NotifyManagerImpl) { bind<NotifyManager>() } | ||
} |
9 changes: 9 additions & 0 deletions
9
core/common/src/jvmMain/kotlin/org/michaelbel/movies/common/notify/impl/NotifyManagerImpl.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,9 @@ | ||
package org.michaelbel.movies.common.notify.impl | ||
|
||
import org.michaelbel.movies.common.notify.NotifyManager | ||
|
||
internal class NotifyManagerImpl: NotifyManager { | ||
|
||
override val areNotificationsEnabled: Boolean | ||
get() = false | ||
} |
11 changes: 11 additions & 0 deletions
11
core/common/src/wasmJsMain/kotlin/org/michaelbel/movies/common/notify/di/NotifyKoinModule.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,11 @@ | ||
package org.michaelbel.movies.common.notify.di | ||
|
||
import org.koin.core.module.dsl.bind | ||
import org.koin.core.module.dsl.singleOf | ||
import org.koin.dsl.module | ||
import org.michaelbel.movies.common.notify.NotifyManager | ||
import org.michaelbel.movies.common.notify.impl.NotifyManagerImpl | ||
|
||
actual val notifyKoinModule = module { | ||
singleOf(::NotifyManagerImpl) { bind<NotifyManager>() } | ||
} |
9 changes: 9 additions & 0 deletions
9
...ommon/src/wasmJsMain/kotlin/org/michaelbel/movies/common/notify/impl/NotifyManagerImpl.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,9 @@ | ||
package org.michaelbel.movies.common.notify.impl | ||
|
||
import org.michaelbel.movies.common.notify.NotifyManager | ||
|
||
internal class NotifyManagerImpl: NotifyManager { | ||
|
||
override val areNotificationsEnabled: Boolean | ||
get() = false | ||
} |
14 changes: 14 additions & 0 deletions
14
...tings-impl/src/androidMain/kotlin/org/michaelbel/movies/settings/ktx/IntentKtx.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,14 @@ | ||
package org.michaelbel.movies.settings.ktx | ||
|
||
import androidx.activity.compose.rememberLauncherForActivityResult | ||
import androidx.activity.result.contract.ActivityResultContracts | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.platform.LocalContext | ||
import org.michaelbel.movies.ui.ktx.appNotificationSettingsIntent | ||
|
||
@Composable | ||
actual fun openAppNotificationSettings(): () -> Unit { | ||
val resultContract = rememberLauncherForActivityResult(ActivityResultContracts.StartActivityForResult()) {} | ||
val context = LocalContext.current | ||
return { resultContract.launch(context.appNotificationSettingsIntent) } | ||
} |
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
6 changes: 6 additions & 0 deletions
6
feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ktx/IntentKtx.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,6 @@ | ||
package org.michaelbel.movies.settings.ktx | ||
|
||
import androidx.compose.runtime.Composable | ||
|
||
@Composable | ||
expect fun openAppNotificationSettings(): () -> Unit |
8 changes: 8 additions & 0 deletions
8
feature/settings-impl/src/iosMain/kotlin/org/michaelbel/movies/settings/ktx/IntentKtx.ios.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,8 @@ | ||
package org.michaelbel.movies.settings.ktx | ||
|
||
import androidx.compose.runtime.Composable | ||
|
||
@Composable | ||
actual fun openAppNotificationSettings(): () -> Unit { | ||
return {} | ||
} |
8 changes: 8 additions & 0 deletions
8
feature/settings-impl/src/jvmMain/kotlin/org/michaelbel/movies/settings/ktx/IntentKtx.jvm.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,8 @@ | ||
package org.michaelbel.movies.settings.ktx | ||
|
||
import androidx.compose.runtime.Composable | ||
|
||
@Composable | ||
actual fun openAppNotificationSettings(): () -> Unit { | ||
return {} | ||
} |