From e21d7de886375816ee0b15b701af7b0f65d43930 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 19 May 2022 23:15:54 +0200 Subject: [PATCH] fixing a glitch at managing clips --- app/build.gradle | 8 ++++---- .../keyboard/adapters/ClipsActivityAdapter.kt | 9 ++++++--- .../keyboard/services/SimpleKeyboardIME.kt | 2 +- build.gradle | 4 ++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 2b77544..5c122c5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -64,9 +64,9 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:e3376e4f56' + implementation 'com.github.SimpleMobileTools:Simple-Commons:e5a4973e6a' - kapt 'androidx.room:room-compiler:2.3.0' - implementation 'androidx.room:room-runtime:2.3.0' - annotationProcessor 'androidx.room:room-compiler:2.3.0' + kapt 'androidx.room:room-compiler:2.4.2' + implementation 'androidx.room:room-runtime:2.4.2' + annotationProcessor 'androidx.room:room-compiler:2.4.2' } diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/adapters/ClipsActivityAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/adapters/ClipsActivityAdapter.kt index 8f50d39..7e334ce 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/adapters/ClipsActivityAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/adapters/ClipsActivityAdapter.kt @@ -85,12 +85,15 @@ class ClipsActivityAdapter( clip.id = null clip.id = ClipsHelper(activity).insertClip(clip) } - } - activity.runOnUiThread { - notifyDataSetChanged() + activity.runOnUiThread { + notifyDataSetChanged() + } } + } else { + notifyDataSetChanged() } + wasClipMoved = false } diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt index edec879..f8b7ab8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt @@ -165,7 +165,7 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL // However, avoid doing that in cases when the EditText for example requires numbers as the input. // We can detect that by the text not changing on pressing Space. if (keyboardMode != KEYBOARD_LETTERS && code == MyKeyboard.KEYCODE_SPACE) { - val originalText = inputConnection.getExtractedText(ExtractedTextRequest(), 0).text + val originalText = inputConnection.getExtractedText(ExtractedTextRequest(), 0)?.text ?: return inputConnection.commitText(codeChar.toString(), 1) val newText = inputConnection.getExtractedText(ExtractedTextRequest(), 0).text switchToLetters = originalText != newText diff --git a/build.gradle b/build.gradle index aada316..a13b99f 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.6.10' + ext.kotlin_version = '1.6.21' repositories { google() @@ -9,7 +9,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong