Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/kotlin/org/carstenf/wordfinder/GameState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class GameState : ViewModel() {
}

fun onSolveFinished() {
if (computerResultList.value?.size == 0) {
if (computerResultList.value?.isEmpty() ?: true) {
cancelTimer()
gameLifecycleState.postValue(GameLifeCycleState.UNSOLVABLE)
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/kotlin/org/carstenf/wordfinder/WordFinder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ class WordFinder : AppCompatActivity(), OnSharedPreferenceChangeListener {
private fun updateLetterButtonOverlay() {
val buttons = mutableListOf<AppCompatButton>()
for(m in gameState.moves) {
buttons.add(this.findViewById<AppCompatButton>(letterButtonIds[m]))
buttons.add(this.findViewById(letterButtonIds[m]))
}
drawConnectionsBetweenButtons(
this.findViewById<BackGestureBlockingTableLayout>(R.id.letterGridView),
Expand Down
10 changes: 8 additions & 2 deletions app/src/main/kotlin/org/carstenf/wordfinder/util/Util.kt
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,21 @@ 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)
.setPositiveButton(
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)
}
}

Expand Down
5 changes: 0 additions & 5 deletions app/src/main/res/drawable/light_off.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/lightbulb.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/preview.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/drawable/psychology_alt.xml

This file was deleted.

4 changes: 0 additions & 4 deletions app/src/main/res/drawable/table_outline_border.xml

This file was deleted.

4 changes: 0 additions & 4 deletions app/src/main/res/values/dimens.xml

This file was deleted.

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':app' // NON-NLS
include(":app") // NON-NLS