Too many changes

This commit is contained in:
Nehemiah of Zebulun 2023-10-02 16:02:56 -04:00
parent d1bf1c44a1
commit cbaa339c37
10 changed files with 20 additions and 14 deletions

View File

@ -5,6 +5,7 @@
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" <uses-permission android:name="android.permission.WRITE_SETTINGS"
tools:ignore="ProtectedPermissions" /> tools:ignore="ProtectedPermissions" />

View File

@ -1,6 +1,7 @@
package net.mezimmah.wkt9 package net.mezimmah.wkt9
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent import android.content.Intent
import android.inputmethodservice.InputMethodService import android.inputmethodservice.InputMethodService
import android.media.AudioManager import android.media.AudioManager
@ -398,7 +399,7 @@ class WKT9: InputMethodService(), SpellCheckerSession.SpellCheckerSessionListene
commitHistory.add(lastComposed) commitHistory.add(lastComposed)
loadSuggestions(commitHistory.joinToString("")) // loadSuggestions(commitHistory.joinToString(""))
} }
private fun loadSuggestions(word: String) { private fun loadSuggestions(word: String) {
@ -421,11 +422,20 @@ class WKT9: InputMethodService(), SpellCheckerSession.SpellCheckerSessionListene
} }
private fun goHome() { private fun goHome() {
with(Intent(Intent.ACTION_MAIN)) { if (Settings.canDrawOverlays(this)) {
this.addCategory(Intent.CATEGORY_HOME) val startMain = Intent(Intent.ACTION_MAIN)
this.flags = Intent.FLAG_ACTIVITY_NEW_TASK
startActivity(this) startMain.addCategory(Intent.CATEGORY_HOME)
startMain.flags = Intent.FLAG_ACTIVITY_NEW_TASK
startActivity(startMain)
} else {
val intent = Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION)
intent.data = Uri.parse("package:$packageName")
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
startActivity(intent)
} }
} }

View File

@ -6,8 +6,6 @@ import net.mezimmah.wkt9.keypad.Key
import net.mezimmah.wkt9.keypad.KeyEventResult import net.mezimmah.wkt9.keypad.KeyEventResult
class AlphaInputMode: BaseInputMode() { class AlphaInputMode: BaseInputMode() {
private val tag = "WKT9"
init { init {
mode = "alpha" mode = "alpha"
status = Status.CAP status = Status.CAP

View File

@ -6,6 +6,8 @@ import net.mezimmah.wkt9.keypad.KeyEventResult
import net.mezimmah.wkt9.keypad.KeyLayout import net.mezimmah.wkt9.keypad.KeyLayout
open class BaseInputMode: InputMode { open class BaseInputMode: InputMode {
protected val tag = "WKT9"
protected var newKey = true protected var newKey = true
protected var keyIndex = 0 protected var keyIndex = 0
protected var lastKey: Key? = null protected var lastKey: Key? = null

View File

@ -7,7 +7,6 @@ import net.mezimmah.wkt9.keypad.KeyCommandResolver
import net.mezimmah.wkt9.keypad.KeyEventResult import net.mezimmah.wkt9.keypad.KeyEventResult
class FNInputMode: BaseInputMode() { class FNInputMode: BaseInputMode() {
private val tag = "WKT9"
override val keyCommandResolver: KeyCommandResolver = KeyCommandResolver( override val keyCommandResolver: KeyCommandResolver = KeyCommandResolver(
parent = super.keyCommandResolver, parent = super.keyCommandResolver,

View File

@ -6,8 +6,6 @@ import net.mezimmah.wkt9.keypad.Key
import net.mezimmah.wkt9.keypad.KeyEventResult import net.mezimmah.wkt9.keypad.KeyEventResult
class IdleInputMode : BaseInputMode() { class IdleInputMode : BaseInputMode() {
private val tag = "WKT9"
init { init {
mode = "idle" mode = "idle"
status = Status.NA status = Status.NA

View File

@ -7,7 +7,6 @@ import net.mezimmah.wkt9.keypad.KeyCommandResolver
import net.mezimmah.wkt9.keypad.KeyEventResult import net.mezimmah.wkt9.keypad.KeyEventResult
class NumericInputMode: BaseInputMode() { class NumericInputMode: BaseInputMode() {
private val tag = "WKT9"
override val keyCommandResolver: KeyCommandResolver = KeyCommandResolver( override val keyCommandResolver: KeyCommandResolver = KeyCommandResolver(
parent = super.keyCommandResolver, parent = super.keyCommandResolver,

View File

@ -8,7 +8,6 @@ import net.mezimmah.wkt9.keypad.KeyLayout
import java.lang.StringBuilder import java.lang.StringBuilder
class WordInputMode: BaseInputMode() { class WordInputMode: BaseInputMode() {
private val tag = "WKT9"
private val codeWord = StringBuilder() private val codeWord = StringBuilder()
init { init {

View File

@ -16,7 +16,7 @@ object KeyLayout {
) )
val en_US = mapOf( val en_US = mapOf(
Key.N1 to listOf('.','?','!',',','-','\'','"','@','$','/','%',':','(',')'), Key.N1 to listOf('.','?','!',',','-','+','=','\'','"','@','$','/','%',':','(',')'),
Key.N2 to listOf('a','b','c','ä','æ','å','à','á','â','ã','ç'), Key.N2 to listOf('a','b','c','ä','æ','å','à','á','â','ã','ç'),
Key.N3 to listOf('d','e','f','è','é','ê','ë','đ'), Key.N3 to listOf('d','e','f','è','é','ê','ë','đ'),
Key.N4 to listOf('g','h','i','ì','í','î','ï'), Key.N4 to listOf('g','h','i','ì','í','î','ï'),

View File

@ -1,6 +1,6 @@
// 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.
plugins { plugins {
id("com.android.application") version "8.1.0" apply false id("com.android.application") version "8.1.1" apply false
id("org.jetbrains.kotlin.android") version "1.8.0" apply false id("org.jetbrains.kotlin.android") version "1.8.0" apply false
id("com.google.devtools.ksp") version "1.8.10-1.0.9" apply false id("com.google.devtools.ksp") version "1.8.10-1.0.9" apply false
} }