Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emoji Picker #415

Merged
merged 17 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<p align="center">
<a href="https://github.com/dessalines/thumb-key" rel="noopener">
<img width=200px height=200px src="https://i.postimg.cc/RZjZGzFG/Screenshot-2023-03-16-00-14-28-039-edit-app-olaunchercf.jpg"></a>
<img width=200px height=200px src="https://raw.githubusercontent.com/dessalines/thumb-key/main/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png"></a>

<h3 align="center"><a href="https://github.com/dessalines/thumb-key">Thumb-Key</a></h3>
<p align="center">
Expand Down
3 changes: 3 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,7 @@ dependencies {
implementation "androidx.activity:activity-compose:1.7.2"
implementation "com.louiscad.splitties:splitties-systemservices:3.0.0"
implementation "com.louiscad.splitties:splitties-views:3.0.0"

// Emoji Picker
implementation "androidx.emoji2:emoji2-emojipicker:1.4.0"
}
75 changes: 60 additions & 15 deletions app/src/main/java/com/dessalines/thumbkey/keyboards/CommonKeys.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ package com.dessalines.thumbkey.keyboards

import android.view.KeyEvent
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Abc
import androidx.compose.material.icons.outlined.ArrowDropDown
import androidx.compose.material.icons.outlined.ArrowDropUp
import androidx.compose.material.icons.outlined.ContentCopy
import androidx.compose.material.icons.outlined.ContentCut
import androidx.compose.material.icons.outlined.ContentPaste
import androidx.compose.material.icons.outlined.Copyright
import androidx.compose.material.icons.outlined.Keyboard
Expand All @@ -12,9 +15,12 @@ import androidx.compose.material.icons.outlined.KeyboardCapslock
import androidx.compose.material.icons.outlined.KeyboardReturn
import androidx.compose.material.icons.outlined.Language
import androidx.compose.material.icons.outlined.LinearScale
import androidx.compose.material.icons.outlined.Mood
import androidx.compose.material.icons.outlined.Numbers
import androidx.compose.material.icons.outlined.Redo
import androidx.compose.material.icons.outlined.SelectAll
import androidx.compose.material.icons.outlined.Settings
import androidx.compose.material.icons.outlined.Undo
import com.dessalines.thumbkey.utils.ColorVariant
import com.dessalines.thumbkey.utils.FontSizeVariant
import com.dessalines.thumbkey.utils.KeyAction
Expand All @@ -25,17 +31,6 @@ import com.dessalines.thumbkey.utils.SlideType
import com.dessalines.thumbkey.utils.SwipeDirection
import com.dessalines.thumbkey.utils.SwipeNWay

val SETTINGS_KEY_ITEM =
KeyItemC(
center = KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.Settings),
action = KeyAction.GotoSettings,
size = FontSizeVariant.LARGE,
color = ColorVariant.SECONDARY,
),
backgroundColor = ColorVariant.SURFACE_VARIANT,
)

val NUMERIC_KEY_ITEM =
KeyItemC(
center = KeyC(
Expand All @@ -47,20 +42,59 @@ val NUMERIC_KEY_ITEM =
swipeType = SwipeNWay.EIGHT_WAY,
swipes = mapOf(
SwipeDirection.TOP to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.SelectAll),
action = KeyAction.SelectAndCopyAll,
display = KeyDisplay.IconDisplay(Icons.Outlined.ContentCopy),
action = KeyAction.Copy,
color = ColorVariant.MUTED,
),
SwipeDirection.TOP_LEFT to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.Keyboard),
action = KeyAction.SwitchIME,
display = KeyDisplay.IconDisplay(Icons.Outlined.SelectAll),
action = KeyAction.SelectAll,
color = ColorVariant.MUTED,
),
SwipeDirection.TOP_RIGHT to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.ContentCut),
action = KeyAction.Cut,
color = ColorVariant.MUTED,
),
SwipeDirection.LEFT to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.Undo),
action = KeyAction.Undo,
color = ColorVariant.MUTED,
),
SwipeDirection.RIGHT to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.Redo),
action = KeyAction.Redo,
color = ColorVariant.MUTED,
),
SwipeDirection.BOTTOM to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.ContentPaste),
action = KeyAction.Paste,
color = ColorVariant.MUTED,
),
),
backgroundColor = ColorVariant.SURFACE_VARIANT,
)

val EMOJI_KEY_ITEM =
KeyItemC(
center = KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.Mood),
action = KeyAction.ToggleEmojiMode(true),
size = FontSizeVariant.LARGE,
color = ColorVariant.SECONDARY,
),
swipeType = SwipeNWay.FOUR_WAY_CROSS,
swipes = mapOf(
dessalines marked this conversation as resolved.
Show resolved Hide resolved
SwipeDirection.TOP to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.Settings),
action = KeyAction.GotoSettings,
color = ColorVariant.MUTED,
),
SwipeDirection.BOTTOM to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.Keyboard),
action = KeyAction.SwitchIME,
color = ColorVariant.MUTED,
),
SwipeDirection.LEFT to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.Language),
action = KeyAction.SwitchLanguage,
Expand All @@ -75,6 +109,17 @@ val NUMERIC_KEY_ITEM =
backgroundColor = ColorVariant.SURFACE_VARIANT,
)

val EMOJI_BACK_KEY_ITEM =
KeyItemC(
center = KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.Abc),
action = KeyAction.ToggleEmojiMode(false),
size = FontSizeVariant.LARGE,
color = ColorVariant.PRIMARY,
),
backgroundColor = ColorVariant.SURFACE_VARIANT,
)

val BACKSPACE_KEY_ITEM =
KeyItemC(
center = KeyC(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ val MESSAGEEASE_DE_MAIN = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down Expand Up @@ -416,7 +416,7 @@ val MESSAGEEASE_DE_SHIFTED = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ val MESSAGEEASE_EN_MAIN = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down Expand Up @@ -272,7 +272,7 @@ val MESSAGEEASE_EN_SHIFTED = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ val MESSAGEEASE_EN_SYMBOLS_MAIN = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down Expand Up @@ -482,7 +482,7 @@ val MESSAGEEASE_EN_SYMBOLS_SHIFTED = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ val MESSAGEEASE_ES_MAIN = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down Expand Up @@ -329,7 +329,7 @@ val MESSAGEEASE_ES_SHIFTED = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ val MESSAGEEASE_FR_MAIN = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down Expand Up @@ -304,7 +304,7 @@ val MESSAGEEASE_FR_SHIFTED = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ val MESSAGEASE_HE_MAIN = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ val MESSAGEEASE_IT_MAIN = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down Expand Up @@ -302,7 +302,7 @@ val MESSAGEEASE_IT_SHIFTED = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ val MESSAGEEASE_RU_MAIN = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down Expand Up @@ -300,7 +300,7 @@ val MESSAGEEASE_RU_SHIFTED = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ val MESSAGEEASE_RU_SYMBOLS_MAIN = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down Expand Up @@ -502,7 +502,7 @@ val MESSAGEEASE_RU_SYMBOLS_SHIFTED = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ val NUMERIC_KEYBOARD = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down
34 changes: 28 additions & 6 deletions app/src/main/java/com/dessalines/thumbkey/keyboards/T9v1.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package com.dessalines.thumbkey.keyboards

import android.view.KeyEvent
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.ContentCopy
import androidx.compose.material.icons.outlined.ContentCut
import androidx.compose.material.icons.outlined.ContentPaste
import androidx.compose.material.icons.outlined.KeyboardReturn
import androidx.compose.material.icons.outlined.Language
Expand Down Expand Up @@ -352,9 +354,19 @@ val T9_V1_MAIN = KeyboardC(
color = ColorVariant.SECONDARY,
),
swipes = mapOf(
SwipeDirection.TOP_RIGHT to KeyC(
SwipeDirection.TOP_LEFT to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.SelectAll),
action = KeyAction.SelectAndCopyAll,
action = KeyAction.SelectAll,
color = ColorVariant.MUTED,
),
SwipeDirection.TOP to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.ContentCopy),
action = KeyAction.Copy,
color = ColorVariant.MUTED,
),
SwipeDirection.TOP_RIGHT to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.ContentCut),
action = KeyAction.Cut,
color = ColorVariant.MUTED,
),
SwipeDirection.RIGHT to KeyC(
Expand All @@ -368,7 +380,7 @@ val T9_V1_MAIN = KeyboardC(
),
color = ColorVariant.MUTED,
),
SwipeDirection.BOTTOM_RIGHT to KeyC(
SwipeDirection.BOTTOM to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.ContentPaste),
action = KeyAction.Paste,
color = ColorVariant.MUTED,
Expand Down Expand Up @@ -895,9 +907,19 @@ val T9_V1_SHIFTED = KeyboardC(
color = ColorVariant.SECONDARY,
),
swipes = mapOf(
SwipeDirection.TOP_RIGHT to KeyC(
SwipeDirection.TOP_LEFT to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.SelectAll),
action = KeyAction.SelectAndCopyAll,
action = KeyAction.SelectAll,
color = ColorVariant.MUTED,
),
SwipeDirection.TOP to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.ContentCopy),
action = KeyAction.Copy,
color = ColorVariant.MUTED,
),
SwipeDirection.TOP_RIGHT to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.ContentCut),
action = KeyAction.Cut,
color = ColorVariant.MUTED,
),
SwipeDirection.RIGHT to KeyC(
Expand All @@ -911,7 +933,7 @@ val T9_V1_SHIFTED = KeyboardC(
),
color = ColorVariant.MUTED,
),
SwipeDirection.BOTTOM_RIGHT to KeyC(
SwipeDirection.BOTTOM to KeyC(
display = KeyDisplay.IconDisplay(Icons.Outlined.ContentPaste),
action = KeyAction.Paste,
color = ColorVariant.MUTED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ val THUMBKEY_BG_V1_SYMBOLS = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down Expand Up @@ -515,7 +515,7 @@ val THUMBKEY_BG_V1_SYMBOLS_SHIFTED = KeyboardC(
),
),
),
SETTINGS_KEY_ITEM,
EMOJI_KEY_ITEM,
),
listOf(
KeyItemC(
Expand Down
Loading