This commit is contained in:
Nehemiah of Zebulun 2023-09-01 16:56:13 +02:00
parent 43f2679374
commit 50cb0d6d9b
2 changed files with 9 additions and 6 deletions

View File

@ -6,12 +6,12 @@ plugins {
android {
namespace = "net.mezimmah.wkt9"
compileSdk = 33
compileSdk = 34
defaultConfig {
applicationId = "net.mezimmah.wkt9"
minSdk = 31
targetSdk = 33
minSdk = 30
targetSdk = 34
versionCode = 1
versionName = "1.0"

View File

@ -109,7 +109,9 @@ class WKT9: InputMethodService(), SpellCheckerSession.SpellCheckerSessionListene
val inputMethodManager = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
val inputMethodSubtype = inputMethodManager.currentInputMethodSubtype
locale = Locale.forLanguageTag(inputMethodSubtype.languageTag)
locale = inputMethodSubtype?.let {
Locale.forLanguageTag(it.languageTag)
} ?: Locale.forLanguageTag("en-US")
Log.d(tag, "WKT9 is loading: $locale")
@ -353,7 +355,7 @@ class WKT9: InputMethodService(), SpellCheckerSession.SpellCheckerSessionListene
lastComposedString = null
}
if (allowSuggestions) Log.d(tag, "History: ${commitHistory.toString()}")
if (allowSuggestions) Log.d(tag, "History: $commitHistory")
updateInputStatus()
@ -525,6 +527,7 @@ class WKT9: InputMethodService(), SpellCheckerSession.SpellCheckerSessionListene
handleComposeTimeout(this.timeout)
}
@Suppress("DEPRECATION")
private fun onRecord() {
// The recorder must be busy...
if (recorder !== null || !isInputViewShown) return
@ -539,7 +542,7 @@ class WKT9: InputMethodService(), SpellCheckerSession.SpellCheckerSessionListene
val duration = Toast.LENGTH_SHORT
// Instantiate recorder and start recording
recorder = MediaRecorder(this).also {
recorder = MediaRecorder().also {
recording = File.createTempFile("recording.3gp", null, cacheDir)
it.setAudioSource(MediaRecorder.AudioSource.MIC)