Skip to content

Commit

Permalink
Fixed docs and issues with common resources (#9)
Browse files Browse the repository at this point in the history
fix(*) Updated docs to follow the latest changes
fix(*) Usage of XML-based vector resources instead of raw SVGs on all platforms
  • Loading branch information
kotlitecture committed Jun 8, 2024
1 parent 719c34c commit b692cfd
Show file tree
Hide file tree
Showing 50 changed files with 68 additions and 100 deletions.
2 changes: 1 addition & 1 deletion docs/Dataflow/Cash App Paging Library/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The example is part of showcases provided when the feature is included into the

```kotlin
class BasicPagingViewModel(
private val pagingSource: AppPagingSource = instance()
private val pagingSource: AppPagingSource = get()
) : BaseViewModel() {

val itemsFlow by lazy {
Expand Down
2 changes: 1 addition & 1 deletion docs/Dataflow/Facade Analytics API/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To start using, just inject any of them to your DI managed class. Recommended to

```kotlin
class TemplateViewModel (
private val analyticsSource: AnalyticsSource = instance() // AppAnalyticsSource
private val analyticsSource: AnalyticsSource = get() // AppAnalyticsSource
) : BaseViewModel() {

fun onSomeAction() {
Expand Down
2 changes: 1 addition & 1 deletion docs/Dataflow/Facade Config API/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AppConfigSource : DelegateConfigSource() {
}

class TemplateViewModel (
private val configSource: AppConfigSource = instance() // ConfigSource
private val configSource: AppConfigSource = get() // ConfigSource
) : BaseViewModel() {

private val counter by lazy { AtomicInteger(configSource.getCounterInitialValue()) }
Expand Down
2 changes: 1 addition & 1 deletion docs/Dataflow/Ktor/overview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# About

This API provides access to the Ktor, the latter of which utilizes platform-specific API as its HTTP engine. This data source is pre-configured to facilitate both REST and WebSocket communications with the backend.
This API provides access to the Ktor client, which utilizes platform-specific API as its HTTP engine. This data source is pre-configured to facilitate both REST and WebSocket communications with the backend.

# Links

Expand Down
2 changes: 1 addition & 1 deletion docs/Dataflow/Ktor/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To start using, just inject it to your DI managed class.

```kotlin
class ApiSource(
private val httpSource: HttpSource = instance()
private val httpSource: HttpSource = get()
) {

suspend fun getIp(): String {
Expand Down
2 changes: 1 addition & 1 deletion docs/Dataflow/Multiplatform Settings/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ To start using, just inject it to your DI managed class.

```kotlin
class TemplateViewModel @Inject constructor(
private val keyValueSource: AppKeyValueSource = instance() // KeyValueSource
private val keyValueSource: AppKeyValueSource = get() // KeyValueSource
) : BaseViewModel() {
override fun doBind() {
launchAsync("init settings") {
Expand Down
6 changes: 3 additions & 3 deletions docs/Essentials/Jetpack Navigation/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Overview

The integration comes with a simple API for easier usage of Jetpack Navigation.
The API is available under the package `shared.core.navigation`.
The API is available under the package `shared.presentation.navigation`.

## Create Destination

Expand Down Expand Up @@ -33,7 +33,7 @@ object TemplateDestination : NavigationDestination<TemplateDestination.Data>() {

## Register Destination

All app destinations should be registered within an instance of the class `shared.core.navigation.NavigationState`.
All app destinations should be registered within an instance of the class `shared.presentation.navigation.NavigationState`.
This instance is already pre-configured in dependency injection (DI) through the `app.di.state.ProvidesNavigationState` class.
Simply place all your destinations within this instance.

Expand All @@ -58,7 +58,7 @@ val ProvidesNavigationState = module {

## Navigate to Destination

Once the navigation is aware of the destinations, you can initiate navigation to them using the `onBack` and `onNext` methods available in the `shared.core.navigation.NavigationState` class.
Once the navigation is aware of the destinations, you can initiate navigation to them using the `onBack` and `onNext` methods available in the `shared.presentation.navigation.NavigationState` class.
Simply inject `NavigationState` into your `ViewModel` or other dependency injection managed class, and navigate whenever necessary.

```kotlin
Expand Down
2 changes: 1 addition & 1 deletion docs/Essentials/Material 3/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Overview

- Component package: `app.ui.theme`
- State management: `shared.core.theme.ThemeState`
- State management: `shared.presentation.theme.ThemeState`
- DI integration: `app.di.state.ProvidesThemeState`

This state instance is utilized by `app.ui.theme.AppThemeProvider`, which is pre-defined at the app level to furnish themes for the entire application.
Expand Down
5 changes: 5 additions & 0 deletions docs/Platform/Android/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Usage

## Run

https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-multiplatform-create-first-app.html#run-your-application-on-android
7 changes: 7 additions & 0 deletions docs/Platform/Desktop/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Usage

## Run

```
./gradlew run
```
7 changes: 7 additions & 0 deletions docs/Platform/Web/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Usage

## Run

```
./gradlew jsBrowserRun
```
5 changes: 5 additions & 0 deletions docs/Platform/iOS/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Usage

## Run

https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-multiplatform-create-first-app.html#run-your-application-on-ios
2 changes: 1 addition & 1 deletion docs/Testing/Kermit/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

Library is pre-configured in the `composeApp` module.
Library is pre-configured in the `app` module.

## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/Testing/Napier/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

Library is pre-configured in the `composeApp` module.
Library is pre-configured in the `app` module.

## Example

Expand Down
7 changes: 3 additions & 4 deletions docs/Userflow/Adaptive Navigation/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

## Overview

- Component package: `app.userflow.navigation`
- Component package: `app.feature.navigation`
- DI integration: `app.di.state.ProvidesNavigationBarState`
- State management: `app.userflow.navigation.NavigationBarState`
- Pre-configured destinations package: `app.userflow.navigation.samples`

- State management: `app.feature.navigation.NavigationBarState`
- Pre-configured destinations package: `app.feature.navigation.samples`

## Configuration

Expand Down
7 changes: 3 additions & 4 deletions docs/Userflow/Bottom Navigation/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

## Overview

- Component package: `app.userflow.navigation`
- Component package: `app.feature.navigation`
- DI integration: `app.di.state.ProvidesNavigationBarState`
- State management: `app.userflow.navigation.NavigationBarState`
- Pre-configured destinations package: `app.userflow.navigation.samples`

- State management: `app.feature.navigation.NavigationBarState`
- Pre-configured destinations package: `app.feature.navigation.samples`

## Configuration

Expand Down
6 changes: 3 additions & 3 deletions docs/Userflow/Change Theme Screen/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

Component package: `app.userflow.theme.change`
Component package: `app.feature.theme.change`

## Example

Expand All @@ -12,7 +12,7 @@ Invoke the `ChangeThemeDestination` destination from your **ViewModel** or **Vie

```kotlin
class TemplateViewModel(
private val navigationState: NavigationState = instance()
private val navigationState: NavigationState = get()
) : BaseViewModel() {

fun onChangeTheme() {
Expand All @@ -28,7 +28,7 @@ Invoke the `ChangeThemeDialogDestination` destination from your **ViewModel** or

```kotlin
class TemplateViewModel(
private val navigationState: NavigationState = instance()
private val navigationState: NavigationState = get()
) : BaseViewModel() {

fun onChangeTheme() {
Expand Down
10 changes: 5 additions & 5 deletions docs/Userflow/Data Loader/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## Overview

Component package: `app.userflow.loader.data`
Component package: `app.feature.loader.data`

The component is pre-configured at the `app.AppScreen` level to monitor state changes of the `app.AppState` instance.

If you need to modify the behavior, including colors, texts, logic, etc., simply update the `app.userflow.loader.data.DataLoaderProvider` composable.
If you need to modify the behavior, including colors, texts, logic, etc., simply update the `app.feature.loader.data.DataLoaderProvider` composable.

## Example

Expand All @@ -19,7 +19,7 @@ Simply inject the `app.AppState` instance into your **ViewModel** and call the `

```kotlin
class TemplateViewModel(
private val appState: AppState = instance()
private val appState: AppState = get()
) : BaseViewModel() {

fun onActionWithLoader() {
Expand All @@ -38,7 +38,7 @@ However, it is recommended to use it only at the **ViewModel** level.

```kotlin
class DataRepository(
private val appState: AppState = instance()
private val appState: AppState = get()
) {

fun performSomeAction() {
Expand All @@ -57,4 +57,4 @@ class DataRepository(

### Usage without `app.AppState`

`app.userflow.loader.data.DataLoaderProvider` accepts any `StoreState` instance. As this is your code, feel free to use it as needed.
`app.feature.loader.data.DataLoaderProvider` accepts any `StoreState` instance. As this is your code, feel free to use it as needed.
7 changes: 3 additions & 4 deletions docs/Userflow/Dismissible Navigation/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

## Overview

- Component package: `app.userflow.navigation`
- Component package: `app.feature.navigation`
- DI integration: `app.di.state.ProvidesNavigationBarState`
- State management: `app.userflow.navigation.NavigationBarState`
- Pre-configured destinations package: `app.userflow.navigation.samples`

- State management: `app.feature.navigation.NavigationBarState`
- Pre-configured destinations package: `app.feature.navigation.samples`

## Configuration

Expand Down
7 changes: 3 additions & 4 deletions docs/Userflow/Modal Navigation/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

## Overview

- Component package: `app.userflow.navigation`
- Component package: `app.feature.navigation`
- DI integration: `app.di.state.ProvidesNavigationBarState`
- State management: `app.userflow.navigation.NavigationBarState`
- Pre-configured destinations package: `app.userflow.navigation.samples`

- State management: `app.feature.navigation.NavigationBarState`
- Pre-configured destinations package: `app.feature.navigation.samples`

## Configuration

Expand Down
7 changes: 3 additions & 4 deletions docs/Userflow/Permanent Navigation/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

## Overview

- Component package: `app.userflow.navigation`
- Component package: `app.feature.navigation`
- DI integration: `app.di.state.ProvidesNavigationBarState`
- State management: `app.userflow.navigation.NavigationBarState`
- Pre-configured destinations package: `app.userflow.navigation.samples`

- State management: `app.feature.navigation.NavigationBarState`
- Pre-configured destinations package: `app.feature.navigation.samples`

## Configuration

Expand Down
7 changes: 3 additions & 4 deletions docs/Userflow/Rail Navigation/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

## Overview

- Component package: `app.userflow.navigation`
- Component package: `app.feature.navigation`
- DI integration: `app.di.state.ProvidesNavigationBarState`
- State management: `app.userflow.navigation.NavigationBarState`
- Pre-configured destinations package: `app.userflow.navigation.samples`

- State management: `app.feature.navigation.NavigationBarState`
- Pre-configured destinations package: `app.feature.navigation.samples`

## Configuration

Expand Down
4 changes: 2 additions & 2 deletions docs/Userflow/Save Theme API/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Component package: `app.ui.theme`

The current theme state is managed by an instance of `shared.core.theme.ThemeState`. This class provides a `configStore` property representing the currently selected theme configuration.
The current theme state is managed by an instance of `shared.presentation.theme.ThemeState`. This class provides a `configStore` property representing the currently selected theme configuration.

The feature utilizes `AppThemeProvider` to control the value of this property:
- Persist its state whenever it changes.
Expand All @@ -16,7 +16,7 @@ Thus, whenever you update the current active application theme, it is automatica

```kotlin
class ToggleThemeViewModel(
private val themeState: ThemeState = instance()
private val themeState: ThemeState = get()
) : BaseViewModel() {

fun onSetLightTheme() {
Expand Down
4 changes: 2 additions & 2 deletions docs/Userflow/Toggle Theme Button/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## Overview

Component package: `app.userflow.theme.toggle`
Component package: `app.feature.theme.toggle`

## Example

Simply add the `ToggleThemeButton` composable from the `app.userflow.theme.toggle` package to your screen.
Simply add the `ToggleThemeButton` composable from the `app.feature.theme.toggle` package to your screen.

```kotlin
@Composable
Expand Down
2 changes: 1 addition & 1 deletion processor/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: "${project.rootDir}/gradle/kotlin/processor.gradle"

group = 'com.kotlitecture.kotli'
version = '0.2.0'
version = '0.2.1'

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package shared.design.icon

expect fun appIconsProvider(): AppIconsProvider

val AppIcons by lazy { appIconsProvider() }
val AppIcons = object : AppIconsProvider {}
Loading

0 comments on commit b692cfd

Please sign in to comment.