Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
19 changes: 17 additions & 2 deletions app/src/main/java/be/scri/services/GeneralKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -452,13 +452,24 @@ abstract class GeneralKeyboardIME(
* This function is responsible for modifying the UI elements of the command bar
* to provide appropriate hints and prompts to the user.
*/
private fun updateCommandBarHintAndPrompt() {
private fun updateCommandBarHintAndPrompt(isUserDarkMode: Boolean? = null) {
val commandBarButton = keyboardBinding.commandBar
val hintMessage = HintUtils.getCommandBarHint(currentState, language)
val promptText = HintUtils.getPromptText(currentState, language)
val promptTextView = keyboardBinding.promptText
promptTextView.text = promptText
commandBarButton.hint = hintMessage

if (isUserDarkMode == true) {
commandBarButton.backgroundTintList = ContextCompat.getColorStateList(this, R.color.command_bar_color_dark)
promptTextView.setBackgroundColor(getColor(R.color.command_bar_color_dark))
keyboardBinding.promptTextBorder.setBackgroundColor(getColor(R.color.command_bar_color_dark))
} else {
commandBarButton.backgroundTintList = ContextCompat.getColorStateList(this, R.color.white)
promptTextView.setBackgroundColor(getColor(white))
keyboardBinding.promptTextBorder.setBackgroundColor(getColor(white))
}

Log.d(
"KeyboardUpdate",
"CommandBar Hint Updated: [State: $currentState, Language: $language, Hint: $hintMessage]",
Expand Down Expand Up @@ -524,10 +535,14 @@ abstract class GeneralKeyboardIME(
when (isUserDarkMode) {
true -> {
keyboardBinding.topKeyboardDivider.setBackgroundColor(getColor(R.color.special_key_dark))
val color = ContextCompat.getColorStateList(this, R.color.light_key_color)
keyboardBinding.scribeKey.foregroundTintList = color
}

false -> {
keyboardBinding.topKeyboardDivider.setBackgroundColor(getColor(R.color.special_key_light))
val colorLight = ContextCompat.getColorStateList(this, R.color.light_key_text_color)
keyboardBinding.scribeKey.foregroundTintList = colorLight
}
}
handleModeChange(keyboardSymbols, keyboardView, this)
Expand All @@ -541,7 +556,7 @@ abstract class GeneralKeyboardIME(
updateUI()
}
setInputView(keyboardHolder)
updateCommandBarHintAndPrompt()
updateCommandBarHintAndPrompt(isUserDarkMode)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/button_background_rounded.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<layer-list>
<item android:id="@+id/button_background_shape">
<shape android:shape="rectangle">
<solid android:color="@color/light_scribe_blue"/>
<solid android:color="@color/color_primary"/>
<corners android:radius="12dp"/>
</shape>
</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<color name="transparent">@android:color/transparent</color>
<color name="special_key_light">#aeb3be</color>
<color name="special_key_dark">#202020</color>
<color name="command_bar_color_dark">#2E2E2E</color>

<color name="nav_bar_selected_color_light">@color/dark_scribe_color</color>
<color name="nav_bar_selected_color_dark">@color/light_scribe_color</color>
Expand Down
Loading