From 972068c5bd7853662854dc68d8609064c341058c Mon Sep 17 00:00:00 2001 From: Geoff Powell Date: Fri, 1 Dec 2023 06:52:38 -0500 Subject: [PATCH 1/4] Cleanup edit list --- .../components/screens/EditListScreen.kt | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/common/src/commonMain/kotlin/com/greenmiststudios/common/components/screens/EditListScreen.kt b/common/src/commonMain/kotlin/com/greenmiststudios/common/components/screens/EditListScreen.kt index 445ce04..1ae9749 100644 --- a/common/src/commonMain/kotlin/com/greenmiststudios/common/components/screens/EditListScreen.kt +++ b/common/src/commonMain/kotlin/com/greenmiststudios/common/components/screens/EditListScreen.kt @@ -11,6 +11,11 @@ import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.text.KeyboardActions import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.ArrowBack +import androidx.compose.material.icons.rounded.Add +import androidx.compose.foundation.text.KeyboardActions +import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Add import androidx.compose.material.icons.filled.ArrowBack import androidx.compose.material.icons.filled.Delete @@ -54,33 +59,13 @@ public data class EditListScreen(override val params: Config) : Screen Unit) { - val navigator = LocalNavigator.current!! TopAppBarWithContent( modifier = Modifier.fillMaxSize(), title = viewModel.title, navigationIcon = rememberVectorPainter(Icons.Default.ArrowBack), - actionButtons = buildList { - if (viewModel is EditListViewModel.Loaded.Edit) { - add( - ActionButton( - action = "Delete", - icon = rememberVectorPainter(Icons.Default.Delete) - ) { - onEvent(DeleteList) - navigator.pop() - } - ) - } - - add( - ActionButton("Save") { - onEvent(UpdateList) - navigator.pop() - } - ) - } ) { Column(Modifier.padding(16.dp).fillMaxSize()) { Column(Modifier.fillMaxWidth().weight(1f)) { @@ -91,13 +76,24 @@ public fun EditListScreen(viewModel: EditListViewModel, onEvent: (EditListViewEv Box(modifier = Modifier.height(128.dp)) { CircularProgressIndicator() } - return@TopAppBarWithContent + return@Column } } require(viewModel is EditListViewModel.Loaded) } + val navigator = LocalNavigator.current!! + Button( + modifier = Modifier + .fillMaxWidth(), + onClick = { + onEvent(UpdateList) + navigator.pop() + } + ) { + Text("Save") + } } } } @@ -117,7 +113,7 @@ private fun CreateListScreen( TextField( modifier = Modifier .fillMaxWidth(), - leadingIcon = { Icon(Icons.Default.Add, contentDescription = "Add Item") }, + leadingIcon = { Icon(Icons.Rounded.Add, contentDescription = "Add Item") }, placeholder = { Text("Add Item") }, value = viewModel.newItemText, onValueChange = { text -> onEvent(EditListViewEvent.UpdateNewItemText(text)) }, From b49cc4343df1b7394c0c03cfba787ba7703d7a3a Mon Sep 17 00:00:00 2001 From: Geoff Powell Date: Sun, 3 Dec 2023 07:42:45 -0500 Subject: [PATCH 2/4] Add delete function for list --- .../components/screens/EditListScreen.kt | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/common/src/commonMain/kotlin/com/greenmiststudios/common/components/screens/EditListScreen.kt b/common/src/commonMain/kotlin/com/greenmiststudios/common/components/screens/EditListScreen.kt index 1ae9749..1023a43 100644 --- a/common/src/commonMain/kotlin/com/greenmiststudios/common/components/screens/EditListScreen.kt +++ b/common/src/commonMain/kotlin/com/greenmiststudios/common/components/screens/EditListScreen.kt @@ -11,7 +11,9 @@ import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.text.KeyboardActions import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Add import androidx.compose.material.icons.filled.ArrowBack +import androidx.compose.material.icons.filled.Delete import androidx.compose.material.icons.rounded.Add import androidx.compose.foundation.text.KeyboardActions import androidx.compose.foundation.text.KeyboardOptions @@ -59,13 +61,33 @@ public data class EditListScreen(override val params: Config) : Screen Unit) { + val navigator = LocalNavigator.current!! TopAppBarWithContent( modifier = Modifier.fillMaxSize(), title = viewModel.title, navigationIcon = rememberVectorPainter(Icons.Default.ArrowBack), + actionButtons = buildList { + if (viewModel is EditListViewModel.Loaded.Edit) { + add( + ActionButton( + action = "Delete", + icon = rememberVectorPainter(Icons.Default.Delete) + ) { + onEvent(DeleteList) + navigator.pop() + } + ) + } + + add( + ActionButton("Save") { + onEvent(UpdateList) + navigator.pop() + } + ) + } ) { Column(Modifier.padding(16.dp).fillMaxSize()) { Column(Modifier.fillMaxWidth().weight(1f)) { @@ -76,24 +98,13 @@ public fun EditListScreen(viewModel: EditListViewModel, onEvent: (EditListViewEv Box(modifier = Modifier.height(128.dp)) { CircularProgressIndicator() } - return@Column + return@TopAppBarWithContent } } require(viewModel is EditListViewModel.Loaded) } - val navigator = LocalNavigator.current!! - Button( - modifier = Modifier - .fillMaxWidth(), - onClick = { - onEvent(UpdateList) - navigator.pop() - } - ) { - Text("Save") - } } } } @@ -113,7 +124,7 @@ private fun CreateListScreen( TextField( modifier = Modifier .fillMaxWidth(), - leadingIcon = { Icon(Icons.Rounded.Add, contentDescription = "Add Item") }, + leadingIcon = { Icon(Icons.Default.Add, contentDescription = "Add Item") }, placeholder = { Text("Add Item") }, value = viewModel.newItemText, onValueChange = { text -> onEvent(EditListViewEvent.UpdateNewItemText(text)) }, From 8f3f025128f7f1d1095aa17f370c57e094284186 Mon Sep 17 00:00:00 2001 From: Geoff Powell Date: Wed, 13 Dec 2023 20:08:32 -0500 Subject: [PATCH 3/4] Cleanup and fix iOS deployment --- .github/workflows/android.yml | 4 + .github/workflows/desktop-web.yml | 8 +- .github/workflows/ios.yml | 4 + .idea/gradle.xml | 2 +- .idea/misc.xml | 2 +- .run/web.run.xml | 23 - .../com/greenmiststudios/tidy/Application.kt | 5 +- common/build.gradle.kts | 48 +- common/common.podspec | 50 -- .../greenmiststudios/common/components/App.kt | 14 +- .../com/greenmiststudios/common/di/Koins.kt | 11 + .../com/greenmiststudios/common/platform.kt | 18 +- .../com/greenmiststudios/common/platform.kt | 7 +- composeApp/build.gradle.kts | 142 +++++ .../src/androidMain/AndroidManifest.xml | 25 + .../com/greenmiststudios/tidy/Application.kt | 19 + .../com/greenmiststudios/tidy/MainActivity.kt | 24 + .../drawable-v24/ic_launcher_foreground.xml | 30 + .../res/drawable/ic_launcher_background.xml | 170 +++++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + .../res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3593 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 5339 bytes .../res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2636 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 3388 bytes .../res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4926 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 7472 bytes .../res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7909 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 11873 bytes .../res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 10652 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 16570 bytes .../src/androidMain/res/values/strings.xml | 3 + .../resources/compose-multiplatform.xml | 36 ++ composeApp/src/desktopMain/kotlin/main.kt | 27 + .../src/iosMain/kotlin/MainViewController.kt | 27 + composeApp/src/jsMain/kotlin/main.js.kt | 17 + composeApp/src/jsMain/resources/index.html | 40 ++ composeApp/src/jsMain/resources/styles.css | 14 + desktop/src/jvmMain/kotlin/Main.kt | 4 +- gradle.properties | 30 +- gradle/libs.versions.toml | 9 + iosApp/Configuration/Config.xcconfig | 3 + iosApp/Podfile | 5 - iosApp/Podfile.lock | 16 - .../Pods/Local Podspecs/common.podspec.json | 31 - iosApp/Pods/Manifest.lock | 16 - iosApp/Pods/Pods.xcodeproj/project.pbxproj | 598 ------------------ .../xcschemes/common.xcscheme | 58 -- .../xcschemes/xcschememanagement.plist | 25 - .../Pods-iosApp/Pods-iosApp-Info.plist | 26 - .../Pods-iosApp-acknowledgements.markdown | 3 - .../Pods-iosApp-acknowledgements.plist | 29 - .../Pods-iosApp/Pods-iosApp-dummy.m | 5 - ...App-resources-Debug-input-files.xcfilelist | 2 - ...pp-resources-Debug-output-files.xcfilelist | 1 - ...p-resources-Release-input-files.xcfilelist | 2 - ...-resources-Release-output-files.xcfilelist | 1 - .../Pods-iosApp/Pods-iosApp-resources.sh | 129 ---- .../Pods-iosApp/Pods-iosApp-umbrella.h | 16 - .../Pods-iosApp/Pods-iosApp.debug.xcconfig | 11 - .../Pods-iosApp/Pods-iosApp.modulemap | 6 - .../Pods-iosApp/Pods-iosApp.release.xcconfig | 11 - .../common/common.debug.xcconfig | 16 - .../common/common.release.xcconfig | 16 - iosApp/iosApp.xcodeproj/project.pbxproj | 263 ++------ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 6 +- .../UserInterfaceState.xcuserstate | Bin 0 -> 46128 bytes .../xcshareddata/xcschemes/iosApp.xcscheme} | 37 +- .../xcdebugger/Breakpoints_v2.xcbkptlist | 6 + .../xcschemes/iosApp.xcscheme | 33 - .../xcschemes/xcschememanagement.plist | 12 +- .../contents.xcworkspacedata | 10 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../UserInterfaceState.xcuserstate | Bin 29271 -> 0 bytes .../xcschemes/xcschememanagement.plist | 5 - .../AccentColor.colorset/Contents.json | 10 +- .../AppIcon.appiconset/Contents.json | 102 +-- .../AppIcon.appiconset/app-icon-1024.png | Bin 0 -> 67285 bytes iosApp/iosApp/Assets.xcassets/Contents.json | 6 +- iosApp/iosApp/ContentView.swift | 25 +- iosApp/iosApp/Info.plist | 88 +-- .../Preview Assets.xcassets/Contents.json | 6 +- iosApp/iosApp/iOSApp.swift | 23 +- settings.gradle.kts | 18 +- 85 files changed, 905 insertions(+), 1609 deletions(-) delete mode 100644 .run/web.run.xml delete mode 100644 common/common.podspec create mode 100644 common/src/commonMain/kotlin/com/greenmiststudios/common/di/Koins.kt create mode 100644 composeApp/build.gradle.kts create mode 100644 composeApp/src/androidMain/AndroidManifest.xml create mode 100644 composeApp/src/androidMain/kotlin/com/greenmiststudios/tidy/Application.kt create mode 100644 composeApp/src/androidMain/kotlin/com/greenmiststudios/tidy/MainActivity.kt create mode 100644 composeApp/src/androidMain/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 composeApp/src/androidMain/res/drawable/ic_launcher_background.xml create mode 100644 composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.png create mode 100644 composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.png create mode 100644 composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher.png create mode 100644 composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 composeApp/src/androidMain/res/values/strings.xml create mode 100644 composeApp/src/commonMain/resources/compose-multiplatform.xml create mode 100644 composeApp/src/desktopMain/kotlin/main.kt create mode 100644 composeApp/src/iosMain/kotlin/MainViewController.kt create mode 100644 composeApp/src/jsMain/kotlin/main.js.kt create mode 100644 composeApp/src/jsMain/resources/index.html create mode 100644 composeApp/src/jsMain/resources/styles.css create mode 100644 iosApp/Configuration/Config.xcconfig delete mode 100644 iosApp/Podfile delete mode 100644 iosApp/Podfile.lock delete mode 100644 iosApp/Pods/Local Podspecs/common.podspec.json delete mode 100644 iosApp/Pods/Manifest.lock delete mode 100644 iosApp/Pods/Pods.xcodeproj/project.pbxproj delete mode 100644 iosApp/Pods/Pods.xcodeproj/xcuserdata/gpowell.xcuserdatad/xcschemes/common.xcscheme delete mode 100644 iosApp/Pods/Pods.xcodeproj/xcuserdata/gpowell.xcuserdatad/xcschemes/xcschememanagement.plist delete mode 100644 iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp-Info.plist delete mode 100644 iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp-acknowledgements.markdown delete mode 100644 iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp-acknowledgements.plist delete mode 100644 iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp-dummy.m delete mode 100644 iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp-resources-Debug-input-files.xcfilelist delete mode 100644 iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp-resources-Debug-output-files.xcfilelist delete mode 100644 iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp-resources-Release-input-files.xcfilelist delete mode 100644 iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp-resources-Release-output-files.xcfilelist delete mode 100755 iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp-resources.sh delete mode 100644 iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp-umbrella.h delete mode 100644 iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig delete mode 100644 iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp.modulemap delete mode 100644 iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig delete mode 100644 iosApp/Pods/Target Support Files/common/common.debug.xcconfig delete mode 100644 iosApp/Pods/Target Support Files/common/common.release.xcconfig create mode 100644 iosApp/iosApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/gpowell.xcuserdatad/UserInterfaceState.xcuserstate rename iosApp/{Pods/Pods.xcodeproj/xcuserdata/gpowell.xcuserdatad/xcschemes/Pods-iosApp.xcscheme => iosApp.xcodeproj/xcshareddata/xcschemes/iosApp.xcscheme} (58%) create mode 100644 iosApp/iosApp.xcodeproj/xcuserdata/gpowell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist delete mode 100644 iosApp/iosApp.xcodeproj/xcuserdata/gpowell.xcuserdatad/xcschemes/iosApp.xcscheme delete mode 100644 iosApp/iosApp.xcworkspace/contents.xcworkspacedata delete mode 100644 iosApp/iosApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 iosApp/iosApp.xcworkspace/xcuserdata/gpowell.xcuserdatad/UserInterfaceState.xcuserstate delete mode 100644 iosApp/iosApp.xcworkspace/xcuserdata/gpowell.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/app-icon-1024.png diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 0aae365..6137d8f 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -8,6 +8,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: build-debug: runs-on: ubuntu-latest diff --git a/.github/workflows/desktop-web.yml b/.github/workflows/desktop-web.yml index 4aac4c6..125df65 100644 --- a/.github/workflows/desktop-web.yml +++ b/.github/workflows/desktop-web.yml @@ -3,11 +3,15 @@ name: Desktop and Web CI on: push: branches: - - main + - main pull_request: branches: - main - + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: Build-Desktop: runs-on: ubuntu-latest diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index f79a7b3..8e7ba4f 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -8,6 +8,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: build: runs-on: macos-latest diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 21cf18a..04e773a 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -5,12 +5,12 @@