-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from omer358/dev
- Loading branch information
Showing
18 changed files
with
292 additions
and
71 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
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: 3 additions & 0 deletions
3
app/src/main/java/com/example/rememberme/domain/manager/SettingsManager.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,13 @@ | ||
package com.example.rememberme.domain.manager | ||
|
||
import com.example.rememberme.domain.model.RemindersRepetition | ||
import com.example.rememberme.domain.model.ThemeMode | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface SettingsManager { | ||
suspend fun getThemeMode(): Flow<ThemeMode> | ||
suspend fun setThemeMode(themeMode: ThemeMode) | ||
suspend fun isDarkModeEnabled(): Flow<Boolean> | ||
suspend fun getSchedules(): Flow<RemindersRepetition> | ||
suspend fun setSchedules(schedules: RemindersRepetition) | ||
} |
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/example/rememberme/domain/model/RemindersRepetition.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,7 @@ | ||
package com.example.rememberme.domain.model | ||
|
||
enum class RemindersRepetition { | ||
OnceADay, | ||
ThreeADay, | ||
FiveADay | ||
} |
11 changes: 11 additions & 0 deletions
11
app/src/main/java/com/example/rememberme/domain/usecases/reminders/GetSchedule.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 com.example.rememberme.domain.usecases.reminders | ||
|
||
import com.example.rememberme.domain.manager.SettingsManager | ||
import com.example.rememberme.domain.model.RemindersRepetition | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
class GetSchedule(private val settingsManager: SettingsManager) { | ||
suspend operator fun invoke(): Flow<RemindersRepetition> { | ||
return settingsManager.getSchedules() | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
app/src/main/java/com/example/rememberme/domain/usecases/reminders/ReminderUseCases.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 com.example.rememberme.domain.usecases.reminders | ||
|
||
data class ReminderUseCases( | ||
val setSchedule: SetSchedule, | ||
val getSchedule: GetSchedule | ||
) |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/com/example/rememberme/domain/usecases/reminders/SetSchedule.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,10 @@ | ||
package com.example.rememberme.domain.usecases.reminders | ||
|
||
import com.example.rememberme.domain.manager.SettingsManager | ||
import com.example.rememberme.domain.model.RemindersRepetition | ||
|
||
class SetSchedule(private val settingsManager: SettingsManager) { | ||
suspend operator fun invoke(remindersRepetition: RemindersRepetition) { | ||
settingsManager.setSchedules(remindersRepetition) | ||
} | ||
} |
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
4 changes: 3 additions & 1 deletion
4
app/src/main/java/com/example/rememberme/presentation/settings/SettingsEvent.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,11 @@ | ||
package com.example.rememberme.presentation.settings | ||
|
||
import com.example.rememberme.domain.model.RemindersRepetition | ||
import com.example.rememberme.domain.model.ThemeMode | ||
|
||
sealed class SettingsEvent { | ||
data class ChangeTheme(val theme: ThemeMode) : SettingsEvent() | ||
data object GetTheme : SettingsEvent() | ||
|
||
data class ChangeRemindersRepetition(val repetition: RemindersRepetition) : SettingsEvent() | ||
data object GetRemindersRepetition : SettingsEvent() | ||
} |
Oops, something went wrong.