Skip to content

Commit

Permalink
Add Hebrew layout based on letter position guidelines (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
roihershberg authored Aug 3, 2023
1 parent fd8859b commit 2270cb7
Show file tree
Hide file tree
Showing 3 changed files with 253 additions and 0 deletions.
250 changes: 250 additions & 0 deletions app/src/main/java/com/dessalines/thumbkey/keyboards/ThumbKeyHEv1.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@
package com.dessalines.thumbkey.keyboards

import com.dessalines.thumbkey.utils.ColorVariant
import com.dessalines.thumbkey.utils.FontSizeVariant
import com.dessalines.thumbkey.utils.KeyAction
import com.dessalines.thumbkey.utils.KeyC
import com.dessalines.thumbkey.utils.KeyDisplay
import com.dessalines.thumbkey.utils.KeyItemC
import com.dessalines.thumbkey.utils.KeyboardC
import com.dessalines.thumbkey.utils.KeyboardMode
import com.dessalines.thumbkey.utils.SwipeDirection
import com.dessalines.thumbkey.utils.SwipeNWay

val THUMBKEY_HE_V1_MAIN = KeyboardC(
listOf(
listOf(
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("מ"),
action = KeyAction.CommitText("מ"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.BOTTOM_RIGHT to KeyC(
display = KeyDisplay.TextDisplay("נ"),
action = KeyAction.CommitText("נ"),
),
),
swipeType = SwipeNWay.FOUR_WAY_DIAGONAL,
),
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("ב"),
action = KeyAction.CommitText("ב"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.BOTTOM to KeyC(
display = KeyDisplay.TextDisplay("ע"),
action = KeyAction.CommitText("ע"),
),
),
swipeType = SwipeNWay.TWO_WAY_VERTICAL,
),
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("א"),
action = KeyAction.CommitText("א"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.BOTTOM_LEFT to KeyC(
display = KeyDisplay.TextDisplay("כ"),
action = KeyAction.CommitText("כ"),
),
),
swipeType = SwipeNWay.FOUR_WAY_DIAGONAL,
),
SETTINGS_KEY_ITEM,
),
listOf(
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("ת"),
action = KeyAction.CommitText("ת"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.RIGHT to KeyC(
display = KeyDisplay.TextDisplay("ם"),
action = KeyAction.CommitText("ם"),
),
SwipeDirection.LEFT to KeyC(
display = KeyDisplay.TextDisplay("ץ"),
action = KeyAction.CommitText("ץ"),
),
),
swipeType = SwipeNWay.TWO_WAY_HORIZONTAL,
),
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("ל"),
action = KeyAction.CommitText("ל"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.TOP_LEFT to KeyC(
display = KeyDisplay.TextDisplay("ט"),
action = KeyAction.CommitText("ט"),
),
SwipeDirection.TOP to KeyC(
display = KeyDisplay.TextDisplay("ך"),
action = KeyAction.CommitText("ך"),
),
SwipeDirection.TOP_RIGHT to KeyC(
display = KeyDisplay.TextDisplay("ק"),
action = KeyAction.CommitText("ק"),
),
SwipeDirection.RIGHT to KeyC(
display = KeyDisplay.TextDisplay("צ"),
action = KeyAction.CommitText("צ"),
),
SwipeDirection.BOTTOM_RIGHT to KeyC(
display = KeyDisplay.TextDisplay("ס"),
action = KeyAction.CommitText("ס"),
),
SwipeDirection.BOTTOM to KeyC(
display = KeyDisplay.TextDisplay("ז"),
action = KeyAction.CommitText("ז"),
),
SwipeDirection.BOTTOM_LEFT to KeyC(
display = KeyDisplay.TextDisplay("ג"),
action = KeyAction.CommitText("ג"),
),
SwipeDirection.LEFT to KeyC(
display = KeyDisplay.TextDisplay("ן"),
action = KeyAction.CommitText("ן"),
),
),
),
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("ו"),
action = KeyAction.CommitText("ו"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.LEFT to KeyC(
display = KeyDisplay.TextDisplay("פ"),
action = KeyAction.CommitText("פ"),
),
SwipeDirection.RIGHT to KeyC(
display = KeyDisplay.TextDisplay("ף"),
action = KeyAction.CommitText("ף"),
),
),
swipeType = SwipeNWay.TWO_WAY_HORIZONTAL,
),
NUMERIC_KEY_ITEM,
),
listOf(
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("ר"),
action = KeyAction.CommitText("ר"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.TOP_RIGHT to KeyC(
display = KeyDisplay.TextDisplay("ש"),
action = KeyAction.CommitText("ש"),
),
SwipeDirection.BOTTOM_RIGHT to KeyC(
display = KeyDisplay.TextDisplay(""),
action = KeyAction.CommitText(""),
color = ColorVariant.MUTED,
),
),
swipeType = SwipeNWay.FOUR_WAY_DIAGONAL,
),
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("ה"),
action = KeyAction.CommitText("ה"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.TOP_LEFT to KeyC(
display = KeyDisplay.TextDisplay("״"),
action = KeyAction.CommitText("״"),
color = ColorVariant.MUTED,
),
SwipeDirection.TOP to KeyC(
display = KeyDisplay.TextDisplay("ד"),
action = KeyAction.CommitText("ד"),
),
SwipeDirection.TOP_RIGHT to KeyC(
display = KeyDisplay.TextDisplay("׳"),
action = KeyAction.CommitText("׳"),
color = ColorVariant.MUTED,
),
SwipeDirection.RIGHT to KeyC(
display = KeyDisplay.TextDisplay(""),
action = KeyAction.CommitText(""),
color = ColorVariant.MUTED,
),
SwipeDirection.BOTTOM_RIGHT to KeyC(
display = KeyDisplay.TextDisplay(""),
action = KeyAction.CommitText(""),
color = ColorVariant.MUTED,
),
SwipeDirection.BOTTOM to KeyC(
display = KeyDisplay.TextDisplay("."),
action = KeyAction.CommitText("."),
color = ColorVariant.MUTED,
),
SwipeDirection.BOTTOM_LEFT to KeyC(
display = KeyDisplay.TextDisplay(","),
action = KeyAction.CommitText(","),
color = ColorVariant.MUTED,
),
SwipeDirection.LEFT to KeyC(
display = KeyDisplay.TextDisplay("־"),
action = KeyAction.CommitText("־"),
color = ColorVariant.MUTED,
),
),
),
KeyItemC(
center = KeyC(
display = KeyDisplay.TextDisplay("י"),
action = KeyAction.CommitText("י"),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
swipes = mapOf(
SwipeDirection.TOP_LEFT to KeyC(
display = KeyDisplay.TextDisplay("ח"),
action = KeyAction.CommitText("ח"),
),
SwipeDirection.BOTTOM_LEFT to KeyC(
display = KeyDisplay.TextDisplay(""),
action = KeyAction.CommitText(""),
color = ColorVariant.MUTED,
),
),
swipeType = SwipeNWay.FOUR_WAY_DIAGONAL,
),
BACKSPACE_KEY_ITEM,
),
listOf(
SPACEBAR_KEY_ITEM,
RETURN_KEY_ITEM,
),
),
)

val THUMBKEY_HE_V1_KEYBOARD_MODES: Map<KeyboardMode, KeyboardC> = mapOf(
KeyboardMode.MAIN to THUMBKEY_HE_V1_MAIN,
KeyboardMode.SHIFTED to THUMBKEY_HE_V1_MAIN,
KeyboardMode.NUMERIC to NUMERIC_KEYBOARD,
)
1 change: 1 addition & 0 deletions app/src/main/java/com/dessalines/thumbkey/utils/Types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ enum class KeyboardLayout(val title: String, val index: Int) {
ThumbKeyESEOv1("Thumb-Key español esperanto v1", 46),
MessageEaseIT("MessageEase italiano", 47),
ThumbKeyENv4Multi("Thumb-Key english v4 (EN+SK multi)", 48),
ThumbKeyHEv1("Thumb-Key עברית v1", 49),
}

enum class KeyboardPosition(private val stringId: Int) {
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/dessalines/thumbkey/utils/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import com.dessalines.thumbkey.keyboards.THUMBKEY_FI_V1_KEYBOARD_MODES
import com.dessalines.thumbkey.keyboards.THUMBKEY_FI_V1_WIDE_KEYBOARD_MODES
import com.dessalines.thumbkey.keyboards.THUMBKEY_FR_V1_KEYBOARD_MODES
import com.dessalines.thumbkey.keyboards.THUMBKEY_FR_V2_KEYBOARD_MODES
import com.dessalines.thumbkey.keyboards.THUMBKEY_HE_V1_KEYBOARD_MODES
import com.dessalines.thumbkey.keyboards.THUMBKEY_HU_V1_KEYBOARD_MODES
import com.dessalines.thumbkey.keyboards.THUMBKEY_ID_V1_SYMBOLS_KEYBOARD_MODES
import com.dessalines.thumbkey.keyboards.THUMBKEY_IT_V1_KEYBOARD_MODES
Expand Down Expand Up @@ -161,6 +162,7 @@ fun keyboardLayoutToModes(layout: KeyboardLayout): Map<KeyboardMode, KeyboardC>
KeyboardLayout.ThumbKeyHUv1 -> THUMBKEY_HU_V1_KEYBOARD_MODES
KeyboardLayout.ThumbKeyESEOv1 -> THUMBKEY_ES_EO_V1_KEYBOARD_MODES
KeyboardLayout.MessageEaseIT -> MESSAGEEASE_IT_KEYBOARD_MODES
KeyboardLayout.ThumbKeyHEv1 -> THUMBKEY_HE_V1_KEYBOARD_MODES
}
}

Expand Down

0 comments on commit 2270cb7

Please sign in to comment.