mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Fix hints and outputText
This commit is contained in:
parent
be32a25307
commit
0c78fe5f12
@ -129,7 +129,7 @@ data class Key(
|
||||
val hintLabel: String? = null,
|
||||
|
||||
/** Hint icon to display instead of hint label. Icon takes precedence over a label */
|
||||
val hintIconId: String? = null,
|
||||
val hintIconId: String? = if(hintLabel?.isNotEmpty() == true) { "" } else { null },
|
||||
|
||||
/** Flags of the label */
|
||||
val labelFlags: Int,
|
||||
@ -190,6 +190,14 @@ data class Key(
|
||||
/** Key is enabled and responds on press */
|
||||
val isEnabled: Boolean = code != Constants.CODE_UNSPECIFIED,
|
||||
) {
|
||||
/** Validation */
|
||||
init {
|
||||
assert((code == Constants.CODE_OUTPUT_TEXT && outputText != null) ||
|
||||
(code != Constants.CODE_OUTPUT_TEXT && outputText == null)) {
|
||||
"Output text validation failed: $code $outputText"
|
||||
}
|
||||
}
|
||||
|
||||
/** The current pressed state of this key */
|
||||
private var mPressed = false
|
||||
|
||||
|
@ -503,7 +503,9 @@ data class LayoutEngine(
|
||||
labelFlags = data.labelFlags,
|
||||
moreKeys = data.moreKeys,
|
||||
moreKeysColumnAndFlags = data.moreKeyFlags,
|
||||
visualStyle = data.style
|
||||
visualStyle = data.style,
|
||||
outputText = data.outputText,
|
||||
hintLabel = data.hint.ifEmpty { null }
|
||||
)
|
||||
|
||||
params.onAddKey(key)
|
||||
|
Loading…
Reference in New Issue
Block a user