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 9dfd6c2
Show file tree
Hide file tree
Showing 21 changed files with 131 additions and 388 deletions.
8 changes: 3 additions & 5 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 All @@ -27,7 +25,7 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew android:assembleDebug
run: ./gradlew composeApp:assembleDebug

build-release:
runs-on: ubuntu-latest
Expand All @@ -43,7 +41,7 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew android:assembleRelease
run: ./gradlew composeApp:assembleRelease

test:
runs-on: ubuntu-latest
Expand All @@ -59,4 +57,4 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew android:check
run: ./gradlew composeApp:check
6 changes: 2 additions & 4 deletions .github/workflows/desktop-web.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 All @@ -31,7 +29,7 @@ jobs:
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew desktop:assemble
run: ./gradlew composeApp:desktopJar

Build-Web:
runs-on: ubuntu-latest
Expand All @@ -56,4 +54,4 @@ jobs:
node-version: '10.x'

- name: Build with Gradle
run: ./gradlew jsApp:assemble
run: ./gradlew composeApp:jsJar
30 changes: 13 additions & 17 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ on:
push:
branches:
- main
pull_request:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -16,6 +14,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 +30,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 $RUNNER_TEMP/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
Loading

0 comments on commit 9dfd6c2

Please sign in to comment.