Skip to content

Commit

Permalink
Cleanup separate modules
Browse files Browse the repository at this point in the history
  • Loading branch information
geoff-powell committed Dec 15, 2023
1 parent 8f3f025 commit 5448f06
Show file tree
Hide file tree
Showing 19 changed files with 123 additions and 376 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches:
- main
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
26 changes: 12 additions & 14 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
build:
runs-on: macos-latest
steps:
- name: Check Xcode version
run: /usr/bin/xcodebuild -version

- name: Checkout Repo
uses: actions/checkout@v4

Expand All @@ -29,17 +32,12 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- shell: bash
run: ./gradlew generateDummyFramework

- name: Set up cocoapods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: latest

- name: Install cocoapods
shell: bash
run: ./gradlew podInstall

- name: Build with Gradle
run: ./gradlew iosSimulatorArm64Binaries
- name: Build App
run: |
cd iosApp && \
xcodebuild -scheme "iosApp" \
-archivePath ~/iosApp.xcarchive \
-sdk iphoneos \
-configuration Debug \
-destination generic/platform=iOS \
clean archive
3 changes: 0 additions & 3 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 0 additions & 41 deletions android/build.gradle.kts

This file was deleted.

19 changes: 0 additions & 19 deletions android/src/main/AndroidManifest.xml

This file was deleted.

21 changes: 0 additions & 21 deletions android/src/main/java/com/greenmiststudios/tidy/Application.kt

This file was deleted.

63 changes: 0 additions & 63 deletions android/src/main/java/com/greenmiststudios/tidy/MainActivity.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,25 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
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
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.material3.Checkbox
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.DismissDirection.EndToStart
import androidx.compose.material3.DismissValue.Default
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SwipeToDismiss
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.material3.rememberDismissState
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -38,6 +37,7 @@ import androidx.compose.ui.unit.dp
import cafe.adriel.voyager.navigator.LocalNavigator
import com.greenmiststudios.common.components.ActionButton
import com.greenmiststudios.common.components.TopAppBarWithContent
import com.greenmiststudios.common.data.TidyListItem
import com.greenmiststudios.common.presenters.EditListPresenter
import com.greenmiststudios.common.screens.Screen
import com.greenmiststudios.common.screens.bindPresenter
Expand All @@ -47,6 +47,7 @@ import com.greenmiststudios.common.viewmodels.EditListViewEvent.DeleteList
import com.greenmiststudios.common.viewmodels.EditListViewEvent.UpdateItemCompletion
import com.greenmiststudios.common.viewmodels.EditListViewEvent.UpdateList
import com.greenmiststudios.common.viewmodels.EditListViewModel
import kotlin.reflect.KProperty

public data class EditListScreen(override val params: Config) : Screen<EditListScreen.Config> {
public sealed interface Config {
Expand Down Expand Up @@ -101,10 +102,7 @@ public fun EditListScreen(viewModel: EditListViewModel, onEvent: (EditListViewEv
return@TopAppBarWithContent
}
}

require(viewModel is EditListViewModel.Loaded)
}

}
}
}
Expand Down Expand Up @@ -140,24 +138,46 @@ private fun CreateListScreen(
LazyColumn {
items(viewModel.items.size) {
val item = viewModel.items[it]
Row {
Checkbox(
checked = item.completed,
onCheckedChange = { checked ->
onEvent(UpdateItemCompletion(item.id, checked))
}
)
TextField(
placeholder = { Text("Item") },
value = item.text,
onValueChange = { text -> onEvent(EditListViewEvent.UpdateItemText(item.id, text)) },
)
}
ListItem(item, onEvent)
}
}
}
}

@Composable
@OptIn(ExperimentalMaterial3Api::class)
private fun ListItem(
item: TidyListItem,
onEvent: (EditListViewEvent) -> Unit
) {
val dismissState = rememberDismissState(
initialValue = Default,
confirmValueChange = {
println("$it - ${item.text}")
true
}
)
SwipeToDismiss(state = dismissState, background = {
Row {
Checkbox(
checked = item.completed,
onCheckedChange = { checked ->
onEvent(UpdateItemCompletion(item.id, checked))
}
)
TextField(
placeholder = { Text("Item") },
value = item.text,
onValueChange = { text -> onEvent(EditListViewEvent.UpdateItemText(item.id, text)) },
)
}
}, dismissContent = {
IconButton({ }) {
Icon(rememberVectorPainter(Icons.Default.Delete), contentDescription = "Delete")
}
}, directions = setOf(EndToStart))
}

@Composable
private fun EditListContentScreen(
viewModel: EditListViewModel.Loaded.Edit,
Expand Down
12 changes: 0 additions & 12 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,13 @@ import org.jetbrains.compose.ExperimentalComposeLibrary
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension

// import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.android.application)
alias(libs.plugins.compose)
}

kotlin {
// @OptIn(ExperimentalWasmDsl::class)
// wasmJs {
// moduleName = "composeApp"
// browser {
// commonWebpackConfig {
// outputFileName = "composeApp.js"
// }
// }
// binaries.executable()
// }
js(IR) {
browser {
useCommonJs()
Expand Down
9 changes: 1 addition & 8 deletions composeApp/src/iosMain/kotlin/MainViewController.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.ui.Modifier
import androidx.compose.ui.window.ComposeUIViewController
import com.greenmiststudios.common.UIShow
import com.greenmiststudios.common.di.startTidyKoin
Expand All @@ -17,11 +14,7 @@ public fun MainViewController(): UIViewController {
MaterialTheme(
colorScheme = if (isSystemInDarkTheme()) darkColorScheme() else lightColorScheme()
) {
Surface(
modifier = Modifier.fillMaxSize(),
) {
UIShow()
}
UIShow()
}
}
}
Loading

0 comments on commit 5448f06

Please sign in to comment.