Skip to content

Commit

Permalink
Fixing messageease keys (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
dessalines authored Mar 22, 2023
1 parent 4d5da72 commit 2753f80
Showing 1 changed file with 10 additions and 147 deletions.
157 changes: 10 additions & 147 deletions app/src/main/java/com/dessalines/thumbkey/keyboards/MessageEase.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
package com.dessalines.thumbkey.keyboards

import android.view.KeyEvent
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.ArrowDropDown
import androidx.compose.material.icons.outlined.ArrowDropUp
import androidx.compose.material.icons.outlined.KeyboardBackspace
import androidx.compose.material.icons.outlined.KeyboardReturn
import androidx.compose.material.icons.outlined.Numbers
import androidx.compose.material.icons.outlined.Settings
import com.dessalines.thumbkey.utils.ColorVariant
import com.dessalines.thumbkey.utils.FontSizeVariant
import com.dessalines.thumbkey.utils.KeyAction
Expand Down Expand Up @@ -63,15 +58,7 @@ val MESSAGEEASE_EN_MAIN = KeyboardC(
)
)
),
KeyItemC(
center = KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.Settings),
action = KeyAction.GotoSettings,
size = FontSizeVariant.LARGE,
color = ColorVariant.SECONDARY
),
backgroundColor = ColorVariant.SURFACE_VARIANT
)
SETTINGS_KEY_ITEM
),
arrayOf(
KeyItemC(
Expand Down Expand Up @@ -149,15 +136,7 @@ val MESSAGEEASE_EN_MAIN = KeyboardC(
)
)
),
KeyItemC(
center = KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.Numbers),
action = KeyAction.ToggleNumericMode(true),
size = FontSizeVariant.LARGE,
color = ColorVariant.SECONDARY
),
backgroundColor = ColorVariant.SURFACE_VARIANT
)
NUMERIC_KEY_ITEM
),
arrayOf(
KeyItemC(
Expand Down Expand Up @@ -226,61 +205,11 @@ val MESSAGEEASE_EN_MAIN = KeyboardC(
)
)
),
KeyItemC(
center = KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.KeyboardBackspace),
action = KeyAction.SendEvent(
KeyEvent(
KeyEvent.ACTION_DOWN,
KeyEvent
.KEYCODE_DEL
)
),
size = FontSizeVariant.LARGE,
color = ColorVariant.SECONDARY
),
swipes = mapOf(
SwipeDirection.LEFT to KeyC(
action = KeyAction.DeleteLastWord,
display = null
),
SwipeDirection.TOP_LEFT to KeyC(
action = KeyAction.DeleteLastWord,
display = null
),
SwipeDirection.BOTTOM_LEFT to KeyC(
action = KeyAction.DeleteLastWord,
display = null
)
),
backgroundColor = ColorVariant.SURFACE_VARIANT
)
BACKSPACE_KEY_ITEM
),
arrayOf(
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay(" "),
action = KeyAction.CommitText(" ")
),
nextTapActions = arrayOf(
KeyAction.ReplaceLastText(", ", trimCount = 1),
KeyAction.ReplaceLastText(". "),
KeyAction.ReplaceLastText("? "),
KeyAction.ReplaceLastText("! "),
KeyAction.ReplaceLastText(": ")
),
backgroundColor = ColorVariant.SURFACE_VARIANT,
widthMultiplier = 3
),
KeyItemC(
center = KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.KeyboardReturn),
action = KeyAction.IMECompleteAction,
size = FontSizeVariant.LARGE,
color = ColorVariant.SECONDARY
),
backgroundColor = ColorVariant.SURFACE_VARIANT
)
SPACEBAR_KEY_ITEM,
RETURN_KEY_ITEM
)
)
)
Expand Down Expand Up @@ -330,15 +259,7 @@ val MESSAGEEASE_EN_SHIFTED = KeyboardC(
)
)
),
KeyItemC(
center = KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.Settings),
action = KeyAction.GotoSettings,
size = FontSizeVariant.LARGE,
color = ColorVariant.SECONDARY
),
backgroundColor = ColorVariant.SURFACE_VARIANT
)
SETTINGS_KEY_ITEM
),
arrayOf(
KeyItemC(
Expand Down Expand Up @@ -416,15 +337,7 @@ val MESSAGEEASE_EN_SHIFTED = KeyboardC(
)
)
),
KeyItemC(
center = KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.Numbers),
action = KeyAction.ToggleNumericMode(true),
size = FontSizeVariant.LARGE,
color = ColorVariant.SECONDARY
),
backgroundColor = ColorVariant.SURFACE_VARIANT
)
NUMERIC_KEY_ITEM
),
arrayOf(
KeyItemC(
Expand Down Expand Up @@ -493,61 +406,11 @@ val MESSAGEEASE_EN_SHIFTED = KeyboardC(
)
)
),
KeyItemC(
center = KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.KeyboardBackspace),
action = KeyAction.SendEvent(
KeyEvent(
KeyEvent.ACTION_DOWN,
KeyEvent
.KEYCODE_DEL
)
),
size = FontSizeVariant.LARGE,
color = ColorVariant.SECONDARY
),
swipes = mapOf(
SwipeDirection.LEFT to KeyC(
action = KeyAction.DeleteLastWord,
display = null
),
SwipeDirection.TOP_LEFT to KeyC(
action = KeyAction.DeleteLastWord,
display = null
),
SwipeDirection.BOTTOM_LEFT to KeyC(
action = KeyAction.DeleteLastWord,
display = null
)
),
backgroundColor = ColorVariant.SURFACE_VARIANT
)
BACKSPACE_KEY_ITEM
),
arrayOf(
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay(" "),
action = KeyAction.CommitText(" ")
),
nextTapActions = arrayOf(
KeyAction.ReplaceLastText(", ", trimCount = 1),
KeyAction.ReplaceLastText(". "),
KeyAction.ReplaceLastText("? "),
KeyAction.ReplaceLastText("! "),
KeyAction.ReplaceLastText(": ")
),
backgroundColor = ColorVariant.SURFACE_VARIANT,
widthMultiplier = 3
),
KeyItemC(
center = KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.KeyboardReturn),
action = KeyAction.IMECompleteAction,
size = FontSizeVariant.LARGE,
color = ColorVariant.SECONDARY
),
backgroundColor = ColorVariant.SURFACE_VARIANT
)
SPACEBAR_KEY_ITEM,
RETURN_KEY_ITEM
)
)
)
Expand Down

0 comments on commit 2753f80

Please sign in to comment.