Skip to content

Commit

Permalink
📝 Add some README for documenting samples
Browse files Browse the repository at this point in the history
  • Loading branch information
vinceglb committed Apr 9, 2024
1 parent ac9c22b commit aa4881c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
6 changes: 6 additions & 0 deletions samples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Samples Projects

Here is a list of sample projects that demonstrate how to use the Kotlin Picker library:

- `sample-core`: A Kotlin Multiplatform project using Picker in a shared viewModel targeting Android, JVM, WASM, JS, iOS Swift, macOS Swift and iOS Compose.
- `sample-compose`: A Compose Multiplatform project using Picker in a Composable targeting Android, iOS, JVM, WASM,
20 changes: 20 additions & 0 deletions samples/sample-compose/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Sample Compose

This sample project demonstrates the use of Kotlin Picker Compose.

## 🌱 Important parts

The important part of this sample is:
- [App.kt](https://github.com/vinceglb/PickerKotlin/blob/main/samples/sample-compose/composeApp/src/commonMain/kotlin/App.kt) in the composeApp module where the file picker is used.

## 🚀 Running the sample project

By openning KotlinPicker in Android Studio or IntelliJ IDEA, you will be able to run the sample project on all platforms.

```bash
# Run on JVM
./gradlew samples:sample-compose:composeApp:run

# Run on WASM
./gradlew samples:sample-compose:composeApp:wasmJsBrowserDevelopmentRun
```
24 changes: 24 additions & 0 deletions samples/sample-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Sample Core

This sample project demonstrates the use of Kotlin Picker Core in a shared viewModel targeting Android, JVM, WASM, JS, iOS Swift, macOS Swift and iOS Compose.

## 🌱 Important parts

The important parts of this sample are:

- [MainViewModel.kt](https://github.com/vinceglb/PickerKotlin/blob/main/samples/sample-core/shared/src/commonMain/kotlin/io/github/vinceglb/sample/core/MainViewModel.kt) in the shared module. It's here where the file picker is used.
- [App.kt](https://github.com/vinceglb/PickerKotlin/blob/main/samples/sample-core/composeApp/src/commonMain/kotlin/io/github/vinceglb/sample/core/compose/App.kt) in the composeApp module where the state is consumed and the viewModel is called.
- [ContentView.swift](https://github.com/vinceglb/PickerKotlin/blob/main/samples/sample-core/appleApps/macOSApp/ContentView.swift) in the iOSApp and macOSApp modules where the state is consumed and the viewModel is called in Swift.
- [MainActivity.kt](https://github.com/vinceglb/PickerKotlin/blob/main/samples/sample-core/composeApp/src/androidMain/kotlin/io/github/vinceglb/sample/core/compose/MainActivity.kt) where we initialize the Picker in Android.

## 🚀 Running the sample project

By openning KotlinPicker in Android Studio or IntelliJ IDEA, you will be able to run the sample project on all platforms.

```bash
# Run on JVM
./gradlew samples:sample-core:composeApp:run

# Run on WASM
samples:sample-core:composeApp:wasmJsBrowserDevelopmentRun
```

0 comments on commit aa4881c

Please sign in to comment.