-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement CantoneseNumericKeyboard and CantoneseSymbolicKeyboard
- Loading branch information
1 parent
98696b0
commit af0b693
Showing
12 changed files
with
329 additions
and
45 deletions.
There are no files selected for viewing
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
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
87 changes: 87 additions & 0 deletions
87
app/src/main/java/org/jyutping/jyutping/keyboard/CantoneseNumericKeyboard.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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
package org.jyutping.jyutping.keyboard | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
|
||
@Composable | ||
fun CantoneseNumericKeyboard(keyHeight: Dp) { | ||
Column( | ||
modifier = Modifier | ||
.background(Color(0xFFD6D8DD)) | ||
.fillMaxWidth() | ||
) { | ||
ToolBar( | ||
modifier = Modifier | ||
.height(60.dp) | ||
.fillMaxWidth() | ||
) | ||
Row( | ||
modifier = Modifier | ||
.height(keyHeight) | ||
.fillMaxWidth() | ||
) { | ||
SymbolKey(symbol = "1", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "2", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "3", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "4", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "5", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "6", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "7", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "8", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "9", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "0", modifier = Modifier.weight(1f)) | ||
} | ||
Row( | ||
modifier = Modifier | ||
.height(keyHeight) | ||
.fillMaxWidth() | ||
) { | ||
SymbolKey(symbol = "-", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "/", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = ":", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = ";", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "(", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = ")", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "$", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "@", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "「", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "」", modifier = Modifier.weight(1f)) | ||
} | ||
Row( | ||
modifier = Modifier | ||
.height(keyHeight) | ||
.fillMaxWidth() | ||
) { | ||
TransformKey(destination = KeyboardForm.Symbolic, modifier = Modifier.weight(1.3f)) | ||
Spacer(modifier = Modifier.weight(0.22f)) | ||
SymbolKey(symbol = "。", modifier = Modifier.weight(1.16f)) | ||
SymbolKey(symbol = ",", modifier = Modifier.weight(1.16f)) | ||
SymbolKey(symbol = "、", modifier = Modifier.weight(1.16f)) | ||
SymbolKey(symbol = "?", modifier = Modifier.weight(1.16f)) | ||
SymbolKey(symbol = "!", modifier = Modifier.weight(1.16f)) | ||
SymbolKey(symbol = ".", modifier = Modifier.weight(1.16f)) | ||
Spacer(modifier = Modifier.weight(0.22f)) | ||
BackspaceKey(modifier = Modifier.weight(1.3f)) | ||
} | ||
Row( | ||
modifier = Modifier | ||
.height(keyHeight) | ||
.fillMaxWidth() | ||
) { | ||
TransformKey(destination = KeyboardForm.Alphabetic, modifier = Modifier.weight(2f)) | ||
LeftKey(modifier = Modifier.weight(1f)) | ||
SpaceKey(modifier = Modifier.weight(4f)) | ||
RightKey(modifier = Modifier.weight(1f)) | ||
ReturnKey(modifier = Modifier.weight(2f)) | ||
} | ||
} | ||
} |
87 changes: 87 additions & 0 deletions
87
app/src/main/java/org/jyutping/jyutping/keyboard/CantoneseSymbolicKeyboard.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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
package org.jyutping.jyutping.keyboard | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
|
||
@Composable | ||
fun CantoneseSymbolicKeyboard(keyHeight: Dp) { | ||
Column( | ||
modifier = Modifier | ||
.background(Color(0xFFD6D8DD)) | ||
.fillMaxWidth() | ||
) { | ||
ToolBar( | ||
modifier = Modifier | ||
.height(60.dp) | ||
.fillMaxWidth() | ||
) | ||
Row( | ||
modifier = Modifier | ||
.height(keyHeight) | ||
.fillMaxWidth() | ||
) { | ||
SymbolKey(symbol = "[", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "]", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "{", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "}", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "#", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "%", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "^", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "*", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "+", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "=", modifier = Modifier.weight(1f)) | ||
} | ||
Row( | ||
modifier = Modifier | ||
.height(keyHeight) | ||
.fillMaxWidth() | ||
) { | ||
SymbolKey(symbol = "_", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "——", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "\\", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "|", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "~", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "《", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "》", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "€", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "&", modifier = Modifier.weight(1f)) | ||
SymbolKey(symbol = "·", modifier = Modifier.weight(1f)) | ||
} | ||
Row( | ||
modifier = Modifier | ||
.height(keyHeight) | ||
.fillMaxWidth() | ||
) { | ||
TransformKey(destination = KeyboardForm.Numeric, modifier = Modifier.weight(1.3f)) | ||
Spacer(modifier = Modifier.weight(0.22f)) | ||
SymbolKey(symbol = "…", modifier = Modifier.weight(1.16f)) | ||
SymbolKey(symbol = ",", modifier = Modifier.weight(1.16f)) | ||
SymbolKey(symbol = "©", modifier = Modifier.weight(1.16f)) | ||
SymbolKey(symbol = "?", modifier = Modifier.weight(1.16f)) | ||
SymbolKey(symbol = "!", modifier = Modifier.weight(1.16f)) | ||
SymbolKey(symbol = "'", modifier = Modifier.weight(1.16f)) | ||
Spacer(modifier = Modifier.weight(0.22f)) | ||
BackspaceKey(modifier = Modifier.weight(1.3f)) | ||
} | ||
Row( | ||
modifier = Modifier | ||
.height(keyHeight) | ||
.fillMaxWidth() | ||
) { | ||
TransformKey(destination = KeyboardForm.Alphabetic, modifier = Modifier.weight(2f)) | ||
LeftKey(modifier = Modifier.weight(1f)) | ||
SpaceKey(modifier = Modifier.weight(4f)) | ||
RightKey(modifier = Modifier.weight(1f)) | ||
ReturnKey(modifier = Modifier.weight(2f)) | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
app/src/main/java/org/jyutping/jyutping/keyboard/KeyboardForm.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.jyutping.jyutping.keyboard | ||
|
||
enum class KeyboardForm { | ||
Alphabetic, | ||
CandidateBoard, | ||
DecimalPad, | ||
EditingPanel, | ||
EmojiBoard, | ||
NumberPad, | ||
Numeric, | ||
Settings, | ||
Symbolic, | ||
TenKeyNumeric | ||
} |
19 changes: 19 additions & 0 deletions
19
app/src/main/java/org/jyutping/jyutping/keyboard/QwertyForm.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.jyutping.jyutping.keyboard | ||
|
||
enum class QwertyForm { | ||
/// Alphabetic, English | ||
Abc, | ||
|
||
/// Alphabetic, Cantonese (粵拼全鍵盤) | ||
Jyutping, | ||
|
||
/// Cantonese SaamPing (粵拼三拼) | ||
TripleStroke, | ||
|
||
Pinyin, | ||
Cangjie, | ||
Stroke, | ||
|
||
/// LoengFan Reverse Lookup. 拆字、兩分反查. 例如 木 + 旦 = 查: mukdaan | ||
Structure | ||
} |
Oops, something went wrong.