Many changes
This commit is contained in:
parent
a29d2d1062
commit
fcb15459d0
@ -37,7 +37,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("androidx.core:core-ktx:1.10.1")
|
||||
implementation("androidx.core:core-ktx:1.12.0")
|
||||
implementation("androidx.appcompat:appcompat:1.6.1")
|
||||
implementation("com.google.android.material:material:1.9.0")
|
||||
implementation("androidx.room:room-common:2.5.2")
|
||||
|
@ -1,12 +1,13 @@
|
||||
package net.mezimmah.wkt9
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.inputmethodservice.InputMethodService
|
||||
import android.media.AudioManager
|
||||
import android.media.MediaRecorder
|
||||
import android.net.Uri
|
||||
import android.opengl.ETC1.getHeight
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.text.InputType
|
||||
import android.util.Log
|
||||
@ -14,6 +15,7 @@ import android.view.KeyEvent
|
||||
import android.view.View
|
||||
import android.view.ViewConfiguration
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.view.inputmethod.InlineSuggestionsRequest
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.view.textservice.SentenceSuggestionsInfo
|
||||
import android.view.textservice.SpellCheckerSession
|
||||
@ -23,6 +25,7 @@ import android.view.textservice.TextServicesManager
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import android.widget.inline.InlinePresentationSpec
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
@ -50,6 +53,7 @@ import okio.IOException
|
||||
import java.io.File
|
||||
import java.util.Locale
|
||||
|
||||
|
||||
class WKT9: InputMethodService(), SpellCheckerSession.SpellCheckerSessionListener {
|
||||
private val tag = "WKT9"
|
||||
|
||||
@ -135,6 +139,14 @@ class WKT9: InputMethodService(), SpellCheckerSession.SpellCheckerSessionListene
|
||||
super.onCreate()
|
||||
}
|
||||
|
||||
override fun onCreateInlineSuggestionsRequest(uiExtras: Bundle): InlineSuggestionsRequest? {
|
||||
Log.d(tag, "Here we are")
|
||||
|
||||
return InlineSuggestionsRequest.Builder(ArrayList<InlinePresentationSpec>())
|
||||
.setMaxSuggestionCount(InlineSuggestionsRequest.SUGGESTION_COUNT_UNLIMITED)
|
||||
.build()
|
||||
}
|
||||
|
||||
@SuppressLint("InflateParams")
|
||||
override fun onCreateInputView(): View? {
|
||||
inputView = layoutInflater.inflate(R.layout.suggestions, null)
|
||||
@ -556,6 +568,8 @@ class WKT9: InputMethodService(), SpellCheckerSession.SpellCheckerSessionListene
|
||||
private fun onDelete(beforeCursor: Int, afterCursor: Int) {
|
||||
clearCandidates()
|
||||
deleteText(beforeCursor, afterCursor)
|
||||
|
||||
Log.d(tag, "Do we connect now????")
|
||||
}
|
||||
|
||||
private fun onFocus() {
|
||||
|
@ -76,9 +76,17 @@ class WordInputMode: BaseInputMode() {
|
||||
}
|
||||
|
||||
override fun deleteCharacter(composing: Boolean): KeyEventResult {
|
||||
codeWord.clear()
|
||||
return if (codeWord.length > 1) {
|
||||
codeWord.deleteAt(codeWord.length - 1)
|
||||
|
||||
return super.deleteCharacter(composing)
|
||||
KeyEventResult(
|
||||
codeWord = codeWord
|
||||
)
|
||||
} else {
|
||||
codeWord.clear()
|
||||
|
||||
super.deleteCharacter(composing)
|
||||
}
|
||||
}
|
||||
|
||||
override fun finalizeWordOrSentence(composing: Boolean): KeyEventResult {
|
||||
|
Loading…
x
Reference in New Issue
Block a user