-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Readme list problem fixed * Basic keys enter animation added * Basic suggestions list added * Suggestions list improved * Readme updated with new features * Disable email suggestions option available * Removed key codes from data models * Email suggestions readme update added * Suggestions image uploaded
- Loading branch information
1 parent
e8e8806
commit ef8f849
Showing
12 changed files
with
98 additions
and
119 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 26 additions & 29 deletions
55
app/src/main/java/com/techlads/composetvkeyboard/domain/model/Alphabets.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,33 @@ | ||
package com.techlads.composetvkeyboard.domain.model | ||
|
||
import android.view.KeyEvent.* | ||
|
||
sealed class Alphabets( | ||
override val code: Int, | ||
override val text: String, | ||
override val span: Int = 1 | ||
) : Key, Cloneable { | ||
object A : Alphabets(KEYCODE_A, "a") | ||
object B : Alphabets(KEYCODE_B, "b") | ||
object C : Alphabets(KEYCODE_C, "c") | ||
object D : Alphabets(KEYCODE_D, "d") | ||
object E : Alphabets(KEYCODE_E, "e") | ||
object F : Alphabets(KEYCODE_F, "f") | ||
object G : Alphabets(KEYCODE_G, "g") | ||
object H : Alphabets(KEYCODE_H, "h") | ||
object I : Alphabets(KEYCODE_I, "i") | ||
object J : Alphabets(KEYCODE_J, "j") | ||
object K : Alphabets(KEYCODE_K, "k") | ||
object L : Alphabets(KEYCODE_L, "l") | ||
object M : Alphabets(KEYCODE_M, "m") | ||
object N : Alphabets(KEYCODE_N, "n") | ||
object O : Alphabets(KEYCODE_O, "o") | ||
object P : Alphabets(KEYCODE_P, "p") | ||
object Q : Alphabets(KEYCODE_Q, "q") | ||
object R : Alphabets(KEYCODE_R, "r") | ||
object S : Alphabets(KEYCODE_S, "s") | ||
object T : Alphabets(KEYCODE_T, "t") | ||
object U : Alphabets(KEYCODE_U, "u") | ||
object V : Alphabets(KEYCODE_V, "v") | ||
object W : Alphabets(KEYCODE_W, "w") | ||
object X : Alphabets(KEYCODE_X, "x") | ||
object Y : Alphabets(KEYCODE_Y, "y") | ||
object Z : Alphabets(KEYCODE_Z, "z") | ||
object A : Alphabets("a") | ||
object B : Alphabets("b") | ||
object C : Alphabets("c") | ||
object D : Alphabets("d") | ||
object E : Alphabets("e") | ||
object F : Alphabets("f") | ||
object G : Alphabets("g") | ||
object H : Alphabets("h") | ||
object I : Alphabets("i") | ||
object J : Alphabets("j") | ||
object K : Alphabets("k") | ||
object L : Alphabets("l") | ||
object M : Alphabets("m") | ||
object N : Alphabets("n") | ||
object O : Alphabets("o") | ||
object P : Alphabets("p") | ||
object Q : Alphabets("q") | ||
object R : Alphabets("r") | ||
object S : Alphabets("s") | ||
object T : Alphabets("t") | ||
object U : Alphabets("u") | ||
object V : Alphabets("v") | ||
object W : Alphabets("w") | ||
object X : Alphabets("x") | ||
object Y : Alphabets("y") | ||
object Z : Alphabets("z") | ||
} |
23 changes: 10 additions & 13 deletions
23
app/src/main/java/com/techlads/composetvkeyboard/domain/model/Digit.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
package com.techlads.composetvkeyboard.domain.model | ||
|
||
import android.view.KeyEvent | ||
|
||
sealed class Digit( | ||
override val code: Int, | ||
override val text: String, | ||
override val span: Int = 1 | ||
) : Key { | ||
object Zero : Digit(KeyEvent.KEYCODE_0, "0") | ||
object One : Digit(KeyEvent.KEYCODE_1, "1") | ||
object Two : Digit(KeyEvent.KEYCODE_2, "2") | ||
object Three : Digit(KeyEvent.KEYCODE_3, "3") | ||
object Four : Digit(KeyEvent.KEYCODE_4, "4") | ||
object Five : Digit(KeyEvent.KEYCODE_5, "5") | ||
object Six : Digit(KeyEvent.KEYCODE_6, "6") | ||
object Seven : Digit(KeyEvent.KEYCODE_7, "7") | ||
object Eight : Digit(KeyEvent.KEYCODE_8, "8") | ||
object Nine : Digit(KeyEvent.KEYCODE_9, "9") | ||
object Zero : Digit("0") | ||
object One : Digit("1") | ||
object Two : Digit("2") | ||
object Three : Digit("3") | ||
object Four : Digit("4") | ||
object Five : Digit("5") | ||
object Six : Digit("6") | ||
object Seven : Digit("7") | ||
object Eight : Digit("8") | ||
object Nine : Digit("9") | ||
} |
1 change: 0 additions & 1 deletion
1
app/src/main/java/com/techlads/composetvkeyboard/domain/model/Key.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
package com.techlads.composetvkeyboard.domain.model | ||
|
||
interface Key { | ||
val code: Int | ||
val text: String | ||
val span: Int | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 47 additions & 50 deletions
97
app/src/main/java/com/techlads/composetvkeyboard/domain/model/SpecialCharactersKey.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,57 @@ | ||
package com.techlads.composetvkeyboard.domain.model | ||
|
||
import android.view.KeyEvent.* | ||
|
||
sealed class SpecialCharactersKey( | ||
override val code: Int, | ||
override val text: String, | ||
override val span: Int = 1 | ||
) : Key { | ||
object Dot : SpecialCharactersKey(KEYCODE_NUMPAD_DOT, ".") | ||
object Underscore : SpecialCharactersKey(KEYCODE_UNKNOWN, "_") | ||
object Dash : SpecialCharactersKey(KEYCODE_UNKNOWN, "-") | ||
object Dollar : SpecialCharactersKey(KEYCODE_UNKNOWN, "$") | ||
object Plus : SpecialCharactersKey(KEYCODE_UNKNOWN, "+") | ||
object And : SpecialCharactersKey(KEYCODE_UNKNOWN, "&") | ||
object ParenthesesBracketsLeft : SpecialCharactersKey(KEYCODE_UNKNOWN, "(") | ||
object ParenthesesBracketsRight : SpecialCharactersKey(KEYCODE_UNKNOWN, ")") | ||
object BackSlash : SpecialCharactersKey(KEYCODE_UNKNOWN, "/") | ||
object Asterisk : SpecialCharactersKey(KEYCODE_UNKNOWN, "*") | ||
object Quotes : SpecialCharactersKey(KEYCODE_UNKNOWN, "\"") | ||
object SingleQuotes : SpecialCharactersKey(KEYCODE_UNKNOWN, "\'") | ||
object Colon : SpecialCharactersKey(KEYCODE_UNKNOWN, ":") | ||
object Semicolon : SpecialCharactersKey(KEYCODE_UNKNOWN, ";") | ||
object Exclamation : SpecialCharactersKey(KEYCODE_UNKNOWN, "!") | ||
object Question : SpecialCharactersKey(KEYCODE_UNKNOWN, "?") | ||
object Percent : SpecialCharactersKey(KEYCODE_UNKNOWN, "%") | ||
object Hash : SpecialCharactersKey(KEYCODE_UNKNOWN, "#") | ||
object Ampersat : SpecialCharactersKey(KEYCODE_AT, "@") | ||
object Comma : SpecialCharactersKey(KEYCODE_COMMA, ",") | ||
object Dot : SpecialCharactersKey(".") | ||
object Underscore : SpecialCharactersKey("_") | ||
object Dash : SpecialCharactersKey("-") | ||
object Dollar : SpecialCharactersKey("$") | ||
object Plus : SpecialCharactersKey("+") | ||
object And : SpecialCharactersKey("&") | ||
object ParenthesesBracketsLeft : SpecialCharactersKey("(") | ||
object ParenthesesBracketsRight : SpecialCharactersKey(")") | ||
object BackSlash : SpecialCharactersKey("/") | ||
object Asterisk : SpecialCharactersKey("*") | ||
object Quotes : SpecialCharactersKey("\"") | ||
object SingleQuotes : SpecialCharactersKey("\'") | ||
object Colon : SpecialCharactersKey(":") | ||
object Semicolon : SpecialCharactersKey(";") | ||
object Exclamation : SpecialCharactersKey("!") | ||
object Question : SpecialCharactersKey("?") | ||
object Percent : SpecialCharactersKey("%") | ||
object Hash : SpecialCharactersKey("#") | ||
object Ampersat : SpecialCharactersKey("@") | ||
object Comma : SpecialCharactersKey(",") | ||
|
||
object Tide : SpecialCharactersKey(KEYCODE_UNKNOWN, "~") | ||
object Grave : SpecialCharactersKey(KEYCODE_UNKNOWN, "`") | ||
object Pipe : SpecialCharactersKey(KEYCODE_UNKNOWN, "|") | ||
object Bullet : SpecialCharactersKey(KEYCODE_UNKNOWN, "∙") | ||
object Root : SpecialCharactersKey(KEYCODE_UNKNOWN, "√") | ||
object PI : SpecialCharactersKey(KEYCODE_UNKNOWN, "π") | ||
object Division : SpecialCharactersKey(KEYCODE_UNKNOWN, "÷") | ||
object Multiple : SpecialCharactersKey(KEYCODE_UNKNOWN, "×") | ||
object Paragraph : SpecialCharactersKey(KEYCODE_UNKNOWN, "¶") | ||
object Triangle : SpecialCharactersKey(KEYCODE_UNKNOWN, "△") | ||
object Tide : SpecialCharactersKey("~") | ||
object Grave : SpecialCharactersKey("`") | ||
object Pipe : SpecialCharactersKey("|") | ||
object Bullet : SpecialCharactersKey("∙") | ||
object Root : SpecialCharactersKey("√") | ||
object PI : SpecialCharactersKey("π") | ||
object Division : SpecialCharactersKey("÷") | ||
object Multiple : SpecialCharactersKey("×") | ||
object Paragraph : SpecialCharactersKey("¶") | ||
object Triangle : SpecialCharactersKey("△") | ||
|
||
object Pound : SpecialCharactersKey(KEYCODE_UNKNOWN, "£") | ||
object Cent : SpecialCharactersKey(KEYCODE_UNKNOWN, "¢") | ||
object Euro : SpecialCharactersKey(KEYCODE_UNKNOWN, "€") | ||
object Yen : SpecialCharactersKey(KEYCODE_UNKNOWN, "¥") | ||
object Caret : SpecialCharactersKey(KEYCODE_UNKNOWN, "^") | ||
object Degree : SpecialCharactersKey(KEYCODE_UNKNOWN, "°") | ||
object Equal : SpecialCharactersKey(KEYCODE_UNKNOWN, "=") | ||
object CurlyBracketLeft : SpecialCharactersKey(KEYCODE_UNKNOWN, "{") | ||
object CurlyBracketRight : SpecialCharactersKey(KEYCODE_UNKNOWN, "}") | ||
object Backlash : SpecialCharactersKey(KEYCODE_UNKNOWN, "\\") | ||
object Pound : SpecialCharactersKey("£") | ||
object Cent : SpecialCharactersKey("¢") | ||
object Euro : SpecialCharactersKey("€") | ||
object Yen : SpecialCharactersKey("¥") | ||
object Caret : SpecialCharactersKey("^") | ||
object Degree : SpecialCharactersKey("°") | ||
object Equal : SpecialCharactersKey("=") | ||
object CurlyBracketLeft : SpecialCharactersKey("{") | ||
object CurlyBracketRight : SpecialCharactersKey("}") | ||
object Backlash : SpecialCharactersKey("\\") | ||
|
||
object CopyRight : SpecialCharactersKey(KEYCODE_UNKNOWN, "©") | ||
object RegisterTrademark : SpecialCharactersKey(KEYCODE_UNKNOWN, "®") | ||
object CheckMark : SpecialCharactersKey(KEYCODE_UNKNOWN, "✓") | ||
object BoxBracketLeft : SpecialCharactersKey(KEYCODE_UNKNOWN, "[") | ||
object BoxBracketRight : SpecialCharactersKey(KEYCODE_UNKNOWN, "]") | ||
object ArrowLeft : SpecialCharactersKey(KEYCODE_UNKNOWN, "<") | ||
object ArrowRight : SpecialCharactersKey(KEYCODE_UNKNOWN, ">") | ||
object CopyRight : SpecialCharactersKey("©") | ||
object RegisterTrademark : SpecialCharactersKey("®") | ||
object CheckMark : SpecialCharactersKey("✓") | ||
object BoxBracketLeft : SpecialCharactersKey("[") | ||
object BoxBracketRight : SpecialCharactersKey("]") | ||
object ArrowLeft : SpecialCharactersKey("<") | ||
object ArrowRight : SpecialCharactersKey(">") | ||
} |
2 changes: 1 addition & 1 deletion
2
app/src/main/java/com/techlads/composetvkeyboard/domain/model/SuggestionKey.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package com.techlads.composetvkeyboard.domain.model | ||
|
||
class SuggestionKey(override val code: Int, override val text: String, override val span: Int) : Key | ||
class SuggestionKey(override val text: String, override val span: Int) : Key |
7 changes: 1 addition & 6 deletions
7
app/src/main/java/com/techlads/composetvkeyboard/domain/model/TextUtilityKey.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,28 @@ | ||
package com.techlads.composetvkeyboard.domain.model | ||
|
||
import android.view.KeyEvent | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.outlined.Numbers | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import com.techlads.composetvkeyboard.data.KeysConstants | ||
|
||
sealed class TextUtilityKey( | ||
override val icon: ImageVector, | ||
override val code: Int, | ||
override val text: String, | ||
override val span: Int = 1 | ||
) : UtilityKey(icon, code, text, span) { | ||
) : UtilityKey(icon, text, span) { | ||
|
||
object Numeric : TextUtilityKey( | ||
Icons.Outlined.Numbers, | ||
KeyEvent.KEYCODE_NUM, | ||
KeysConstants.NUMERIC_KEY | ||
) | ||
|
||
object SpecialCharacters : TextUtilityKey( | ||
Icons.Outlined.Numbers, | ||
KeyEvent.KEYCODE_NUM, | ||
KeysConstants.SPECIAL_CHARACTERS_KEY | ||
) | ||
|
||
object ABC : TextUtilityKey( | ||
Icons.Outlined.Numbers, | ||
KeyEvent.KEYCODE_TV_TELETEXT, | ||
KeysConstants.ABC_KEY | ||
) | ||
} |
13 changes: 4 additions & 9 deletions
13
app/src/main/java/com/techlads/composetvkeyboard/domain/model/UtilityKey.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,40 @@ | ||
package com.techlads.composetvkeyboard.domain.model | ||
|
||
import android.view.KeyEvent | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.outlined.* | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import com.techlads.composetvkeyboard.data.KeysConstants | ||
|
||
sealed class UtilityKey( | ||
open val icon: ImageVector, | ||
override val code: Int, | ||
override val text: String, | ||
override val span: Int = 1 | ||
) : Key { | ||
object Uppercase : UtilityKey( | ||
Icons.Outlined.KeyboardCapslock, | ||
KeyEvent.KEYCODE_CAPS_LOCK, | ||
KeysConstants.UPPER_CASE_KEY | ||
) | ||
|
||
object Backspace : UtilityKey( | ||
Icons.Outlined.KeyboardBackspace, | ||
KeyEvent.KEYCODE_BACK, | ||
KeysConstants.BACK_SPACE_KEY | ||
) | ||
|
||
object Clear : UtilityKey( | ||
Icons.Outlined.Delete, | ||
KeyEvent.KEYCODE_CLEAR, | ||
KeysConstants.CLEAR_KEY, | ||
2 | ||
) | ||
|
||
object Space : UtilityKey( | ||
Icons.Outlined.SpaceBar, | ||
KeyEvent.KEYCODE_SPACE, | ||
KeysConstants.SPACE_KEY, 3 | ||
KeysConstants.SPACE_KEY, | ||
3 | ||
) | ||
|
||
object ActionArrow : UtilityKey( | ||
Icons.Outlined.Search, | ||
KeyEvent.KEYCODE_FORWARD, | ||
KeysConstants.SEARCH_KEY, 2 | ||
KeysConstants.SEARCH_KEY, | ||
2 | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters