diff --git a/app/build.gradle b/app/build.gradle index 528c2c9..17ddd9f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,12 +2,12 @@ apply plugin: 'com.android.application' apply plugin: 'org.jetbrains.kotlin.android' android { - compileSdk 35 + compileSdk 36 defaultConfig { applicationId "org.carstenf.wordfinder" minSdkVersion 22 - targetSdkVersion 35 + targetSdk 36 } buildTypes { @@ -36,9 +36,9 @@ dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.2.1' // NON-NLS implementation 'com.squareup.okhttp3:okhttp:4.12.0' // NON-NLS implementation 'com.google.android.material:material:1.12.0' // NON-NLS - implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.3' // NON-NLS - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3" // NON-NLS - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3" // NON-NLS + implementation 'com.fasterxml.jackson.core:jackson-databind:2.19.1' // NON-NLS + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2" // NON-NLS + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2" // NON-NLS implementation 'androidx.core:core-ktx:1.16.0' // NON-NLS implementation "androidx.preference:preference-ktx:1.2.1" // NON-NLS implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.1" // For Kotlin // NON-NLS diff --git a/app/src/main/kotlin/org/carstenf/wordfinder/GameState.kt b/app/src/main/kotlin/org/carstenf/wordfinder/GameState.kt index a1f581b..5bb1afc 100644 --- a/app/src/main/kotlin/org/carstenf/wordfinder/GameState.kt +++ b/app/src/main/kotlin/org/carstenf/wordfinder/GameState.kt @@ -347,7 +347,7 @@ class GameState : ViewModel() { } fun onSolveFinished() { - if (computerResultList.value?.size == 0) { + if (computerResultList.value?.isEmpty() ?: true) { cancelTimer() gameLifecycleState.postValue(GameLifeCycleState.UNSOLVABLE) } diff --git a/app/src/main/kotlin/org/carstenf/wordfinder/WordFinder.kt b/app/src/main/kotlin/org/carstenf/wordfinder/WordFinder.kt index cb9b467..42c41d8 100644 --- a/app/src/main/kotlin/org/carstenf/wordfinder/WordFinder.kt +++ b/app/src/main/kotlin/org/carstenf/wordfinder/WordFinder.kt @@ -494,7 +494,7 @@ class WordFinder : AppCompatActivity(), OnSharedPreferenceChangeListener { private fun updateLetterButtonOverlay() { val buttons = mutableListOf() for(m in gameState.moves) { - buttons.add(this.findViewById(letterButtonIds[m])) + buttons.add(this.findViewById(letterButtonIds[m])) } drawConnectionsBetweenButtons( this.findViewById(R.id.letterGridView), diff --git a/app/src/main/kotlin/org/carstenf/wordfinder/util/Util.kt b/app/src/main/kotlin/org/carstenf/wordfinder/util/Util.kt index f1f1b00..6595752 100644 --- a/app/src/main/kotlin/org/carstenf/wordfinder/util/Util.kt +++ b/app/src/main/kotlin/org/carstenf/wordfinder/util/Util.kt @@ -172,6 +172,12 @@ fun parseTime(timeStr: String): Long { fun showTimeIsUpDialog(app: WordFinder) { + + val gameState = app.gameState + if(gameState.gameLifecycleState.value == GameState.GameLifeCycleState.GAME_OVER) { + return + } + val builder = AlertDialog.Builder(app) builder.setMessage(R.string.time_up_dialog_msg) .setTitle(R.string.time_up_dialog_title) @@ -179,8 +185,8 @@ fun showTimeIsUpDialog(app: WordFinder) { R.string.time_up_dialog_ok ) { _: DialogInterface?, _: Int -> - if(app.gameState.gameLifecycleState.value != GameState.GameLifeCycleState.GAME_OVER) { - app.gameState.gameLifecycleState.postValue(GameState.GameLifeCycleState.GAME_OVER) + if(gameState.gameLifecycleState.value != GameState.GameLifeCycleState.GAME_OVER) { + gameState.gameLifecycleState.postValue(GameState.GameLifeCycleState.GAME_OVER) } } diff --git a/app/src/main/res/drawable/light_off.xml b/app/src/main/res/drawable/light_off.xml deleted file mode 100644 index c68a68a..0000000 --- a/app/src/main/res/drawable/light_off.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/lightbulb.xml b/app/src/main/res/drawable/lightbulb.xml deleted file mode 100644 index 643a621..0000000 --- a/app/src/main/res/drawable/lightbulb.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/preview.xml b/app/src/main/res/drawable/preview.xml deleted file mode 100644 index 652a312..0000000 --- a/app/src/main/res/drawable/preview.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/psychology_alt.xml b/app/src/main/res/drawable/psychology_alt.xml deleted file mode 100644 index c19ee07..0000000 --- a/app/src/main/res/drawable/psychology_alt.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/table_outline_border.xml b/app/src/main/res/drawable/table_outline_border.xml deleted file mode 100644 index 1cfe9b6..0000000 --- a/app/src/main/res/drawable/table_outline_border.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml deleted file mode 100644 index f947b71..0000000 --- a/app/src/main/res/values/dimens.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - 20dp - \ No newline at end of file diff --git a/build.gradle b/build.gradle index 9c44e8d..1f549fd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { - kotlin_version = '1.9.24' + kotlin_version = '2.2.0' } repositories { mavenCentral() diff --git a/settings.gradle b/settings.gradle index 45f8cb5..b489454 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':app' // NON-NLS +include(":app") // NON-NLS