fixing a glitch at managing clips

This commit is contained in:
tibbi 2022-05-19 23:15:54 +02:00
parent f46e560a09
commit e21d7de886
4 changed files with 13 additions and 10 deletions

View file

@ -64,9 +64,9 @@ android {
} }
dependencies { dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:e3376e4f56' implementation 'com.github.SimpleMobileTools:Simple-Commons:e5a4973e6a'
kapt 'androidx.room:room-compiler:2.3.0' kapt 'androidx.room:room-compiler:2.4.2'
implementation 'androidx.room:room-runtime:2.3.0' implementation 'androidx.room:room-runtime:2.4.2'
annotationProcessor 'androidx.room:room-compiler:2.3.0' annotationProcessor 'androidx.room:room-compiler:2.4.2'
} }

View file

@ -85,12 +85,15 @@ class ClipsActivityAdapter(
clip.id = null clip.id = null
clip.id = ClipsHelper(activity).insertClip(clip) clip.id = ClipsHelper(activity).insertClip(clip)
} }
}
activity.runOnUiThread { activity.runOnUiThread {
notifyDataSetChanged() notifyDataSetChanged()
}
} }
} else {
notifyDataSetChanged()
} }
wasClipMoved = false wasClipMoved = false
} }

View file

@ -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. // 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. // We can detect that by the text not changing on pressing Space.
if (keyboardMode != KEYBOARD_LETTERS && code == MyKeyboard.KEYCODE_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) inputConnection.commitText(codeChar.toString(), 1)
val newText = inputConnection.getExtractedText(ExtractedTextRequest(), 0).text val newText = inputConnection.getExtractedText(ExtractedTextRequest(), 0).text
switchToLetters = originalText != newText switchToLetters = originalText != newText

View file

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.kotlin_version = '1.6.10' ext.kotlin_version = '1.6.21'
repositories { repositories {
google() google()
@ -9,7 +9,7 @@ buildscript {
} }
dependencies { 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" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong