Skip to content

Commit 6648045

Browse files
release-train-botAleksha
authored andcommitted
issues
refac mostly
1 parent 87885ad commit 6648045

File tree

70 files changed

+464
-382
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+464
-382
lines changed

docs/Dataflow/DataStore/usage.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
## Overview
44

55
The API can be accessed through:
6-
- `shared.data.source.keyvalue.KeyValueSource` - base class at the core module level.
7-
- `shared.data.source.keyvalue.DataStoreSource` - implementation of the base class.
6+
- `shared.data.source.settings.SettingsSource` - base class at the core module level.
7+
- `shared.data.source.settings.DataStoreSource` - implementation of the base class.
88

9-
**KeyValueSource** provides the following methods:
9+
**SettingsSource** provides the following methods:
1010

1111
- `read(key: String): T?` - Reads data of type [T] associated with the given [key].
1212
- `save(key: String, value: T)` - Saves the provided [value] of type [T] with the given [key].
@@ -23,12 +23,12 @@ To start using, just inject it to your DI managed class.
2323

2424
```kotlin
2525
class TemplateViewModel @Inject constructor(
26-
private val keyValueSource: KeyValueSource
26+
private val settingsSource: SettingsSource
2727
) : BaseViewModel() {
2828

2929
override fun doBind() = async("Init settings") {
3030
...
31-
val passcode: String? = keyValueSource.read("name")
31+
val passcode: String? = settingsSource.read("name")
3232
...
3333
}
3434
}

docs/Dataflow/Multiplatform Settings/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# About
22

33
During the application lifecycle, it may be necessary to persist data across app reopenings (for example, chosen language, theme, font size, and other preferences).
4-
Key-value storage provides an efficient way to store and retrieve such data using a simple yet powerful API that can manage data of any complexity.
4+
Settings provide an efficient way to store and retrieve such data using a simple yet powerful API that can manage data of any complexity.
55

66
# Links
77

docs/Dataflow/Multiplatform Settings/usage.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
## Overview
44

55
The API can be accessed through:
6-
- `shared.data.source.keyvalue.KeyValueSource` - base class at the core module level.
7-
- `shared.data.source.keyvalue.SettingsKeyValueSource` - implementation of the base class.
6+
- `shared.data.source.settings.SettingsSource` - base class at the core module level.
7+
- `shared.data.source.settings.SettingsSettingsSource` - implementation of the base class.
88

9-
**KeyValueSource** provides the following methods:
9+
**SettingsSource** provides the following methods:
1010

1111
- `read(key: String): T?` - Reads data of type [T] associated with the given [key].
1212
- `save(key: String, value: T)` - Saves the provided [value] of type [T] with the given [key].
@@ -17,18 +17,18 @@ The API can be accessed through:
1717

1818
## Example
1919

20-
Class instance is pre-configured via dependency injection (DI) as a singleton in `app.di.common.KeyValueSourceModule`.
20+
Class instance is pre-configured via dependency injection (DI) as a singleton in `app.di.common.SettingsSourceModule`.
2121

2222
To start using, just inject it to your DI managed class.
2323

2424
```kotlin
2525
class TemplateViewModel @Inject constructor(
26-
private val keyValueSource: KeyValueSource
26+
private val settingsSource: SettingsSource
2727
) : BaseViewModel() {
2828

2929
override fun doBind() = async("Init settings") {
3030
...
31-
val passcode: String? = keyValueSource.read("name")
31+
val passcode: String? = settingsSource.read("name")
3232
...
3333
}
3434
}

docs/Platform/iOS/usage.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
## Run
44

55
https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-multiplatform-create-first-app.html#run-your-application-on-ios
6+
7+
```
8+
Once everything is configured, ensure that the root file `./gradlew` is executable.
9+
```

docs/Userflow/Local Passcode Flow/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ val passcodeModule = module {
1818
persistentKey = "passcode_config",
1919
resumeTimeout = 10.seconds.inWholeMilliseconds,
2020
encryptionSource = get(),
21-
keyValueSource = get(),
21+
settingsSource = get(),
2222
)
2323
}
2424
}

docs/Userflow/Save Theme API/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The feature utilizes `app.feature.theme.provide.presentation.ThemeProvider` to c
1111
- Persist its state whenever it changes.
1212
- Restore the last state when the app is reopened.
1313

14-
The logic is handled by `app.feature.theme.provide.presentation.ThemePersistenceViewModel`.
14+
The logic is handled by `app.feature.theme.provide.presentation.ThemeStatefulViewModel`.
1515

1616
Thus, whenever you update the current active application theme, it is automatically saved across app restarts.
1717

processor/src/main/kotlin/kotli/template/multiplatform/compose/MultiplatformComposeTemplateProcessor.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import kotli.template.multiplatform.compose.dataflow.config.ConfigProvider
1818
import kotli.template.multiplatform.compose.dataflow.database.DatabaseProvider
1919
import kotli.template.multiplatform.compose.dataflow.encryption.EncryptionProvider
2020
import kotli.template.multiplatform.compose.dataflow.http.HttpProvider
21-
import kotli.template.multiplatform.compose.dataflow.keyvalue.KeyValueProvider
22-
import kotli.template.multiplatform.compose.dataflow.keyvalue.settings.SettingsKeyValueProcessor
21+
import kotli.template.multiplatform.compose.dataflow.settings.SettingsProvider
22+
import kotli.template.multiplatform.compose.dataflow.settings.basic.BasicSettingsProcessor
2323
import kotli.template.multiplatform.compose.dataflow.paging.PagingProvider
2424
import kotli.template.multiplatform.compose.essentials.buildtool.BuildToolProvider
2525
import kotli.template.multiplatform.compose.essentials.design.DesignSystemProvider
@@ -57,7 +57,7 @@ object MultiplatformComposeTemplateProcessor : BaseTemplateProcessor() {
5757
features = listOf(
5858
Feature(IOSPlatformProcessor.ID),
5959
Feature(AndroidPlatformProcessor.ID),
60-
Feature(SettingsKeyValueProcessor.ID),
60+
Feature(BasicSettingsProcessor.ID),
6161
Feature(DataLoaderProcessor.ID),
6262
Feature(SaveThemeProcessor.ID),
6363
Feature(ChangeThemeProcessor.ID),
@@ -84,7 +84,7 @@ object MultiplatformComposeTemplateProcessor : BaseTemplateProcessor() {
8484

8585
// dataflow
8686
CommonDataFlowProvider,
87-
KeyValueProvider,
87+
SettingsProvider,
8888
EncryptionProvider,
8989
CacheProvider,
9090
ConfigProvider,

processor/src/main/kotlin/kotli/template/multiplatform/compose/Rules.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ object Rules {
8080

8181
// design
8282
const val SharedDesignSrcDir = "${SharedDesignDir}/src"
83-
const val SharedDesignComponentDir =
84-
"${SharedDesignSrcDir}/commonMain/kotlin/shared/design/component"
83+
const val SharedDesignComponentDir = "${SharedDesignSrcDir}/commonMain/kotlin/shared/design/component"
8584
const val AppIconsKt = "${SharedDesignSrcDir}/commonMain/kotlin/shared/design/icon/AppIcons.kt"
8685
const val AppPlaceholder = "${SharedDesignComponentDir}/AppPlaceholder.kt"
8786
const val AppMarkdown = "${SharedDesignComponentDir}/AppMarkdown.kt"
@@ -111,9 +110,9 @@ object Rules {
111110
// dataflow -> http
112111
const val HttpSource = "*/*HttpSource*.kt"
113112

114-
// dataflow -> keyvalue
115-
const val KeyValueSource = "*/*KeyValueSource*.kt"
116-
const val SettingsKeyValueSource = "*/*SettingsKeyValueSource*.kt"
113+
// dataflow -> settings
114+
const val SettingsSource = "*/*SettingsSource*.kt"
115+
const val BasicSettingsSource = "*/*BasicSettingsSource*.kt"
117116
const val DataStoreSource = "*/*DataStoreSource.kt"
118117

119118
// dataflow -> encryption

processor/src/main/kotlin/kotli/template/multiplatform/compose/dataflow/keyvalue/KeyValueProvider.kt

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package kotli.template.multiplatform.compose.dataflow.settings
2+
3+
import kotli.engine.FeatureProcessor
4+
import kotli.template.multiplatform.compose.dataflow.BaseDataFlowProvider
5+
import kotli.template.multiplatform.compose.dataflow.settings.common.CommonSettingsProcessor
6+
import kotli.template.multiplatform.compose.dataflow.settings.datastore.DataStoreProcessor
7+
import kotli.template.multiplatform.compose.dataflow.settings.basic.BasicSettingsProcessor
8+
9+
object SettingsProvider : BaseDataFlowProvider() {
10+
11+
override fun getId(): String = "dataflow.settings"
12+
override fun isMultiple(): Boolean = false
13+
override fun createProcessors(): List<FeatureProcessor> = listOf(
14+
CommonSettingsProcessor,
15+
BasicSettingsProcessor,
16+
DataStoreProcessor
17+
)
18+
}

0 commit comments

Comments
 (0)