Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
7a2ca28
feat: Add floating keyboard functionality to Scribe-Android (#261)
prince-0408 Jun 18, 2026
6becf1b
style: fix ktlint issues in GeneralKeyboardIME and PreferencesHelper
prince-0408 Jun 19, 2026
e10e724
style: refine float button color and resize corner handles position
prince-0408 Jun 19, 2026
8888f67
fix: pass getKeyboardWidth() to all KeyboardBase constructor calls to…
prince-0408 Jun 19, 2026
43dcc7e
style(keyboard): rework floating keyboard design and behavior as per …
prince-0408 Jun 23, 2026
77c2767
style: fix ktlint formatting and style issues in KeyboardView, Keyboa…
prince-0408 Jun 23, 2026
1f4578f
Merge upstream main and resolve conflicts
prince-0408 Jul 5, 2026
98d0a3f
style: adjust float and comma key widths, reduce spacebar size as per…
prince-0408 Jul 5, 2026
1a5fda3
Resolve merge conflict in colors.xml
prince-0408 Jul 5, 2026
b9e946f
fix: apply text color filter to float toggle icon; correctly report f…
prince-0408 Jul 5, 2026
849302e
chore: update i18n submodule and regenerate strings
prince-0408 Jul 5, 2026
6ae29ad
feat: show floating keyboard toggle button in search bars
prince-0408 Jul 5, 2026
1808a78
Enhance floating keyboard with independent resizing, drag-to-dock sna…
prince-0408 Jul 6, 2026
a4b8925
Apply ktlint formatting fixes
prince-0408 Jul 6, 2026
9c4ded7
Fix key clipping and layout alignment issues in symbols and numeric l…
prince-0408 Jul 6, 2026
b038902
Merge remote-tracking branch 'upstream/main' into feature/floating-ke…
prince-0408 Jul 7, 2026
c6a3b61
feat: Add floating keyboard visibility toggle setting (#642)
prince-0408 Jul 7, 2026
a7a0953
chore: format codebase and suppress detekt long parameter list warning
prince-0408 Jul 7, 2026
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
4 changes: 4 additions & 0 deletions app/src/keyboards/java/be/scri/helpers/KeyHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ class KeyHandler(
handleModeChangeKey()
true
}
KeyboardBase.KEYCODE_FLOAT_TOGGLE -> {
ime.toggleFloatingMode()
true
}
KeyboardBase.KEYCODE_SPACE -> handleSpaceKeyPress(previousWasLastKeySpace)
in KeyboardBase.NAVIGATION_KEYS -> {
handleNavigationKey(code)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,16 @@ object KeyboardLanguageMappingConstants {
"RU" to RUInterfaceVariables.PLURAL_KEY_LBL,
"SV" to SVInterfaceVariables.PLURAL_KEY_LBL,
)

val floatPlaceholder =
mapOf(
"EN" to "Float",
"ES" to "Flotante",
"DE" to "Schweben",
"IT" to "Fluttuante",
"FR" to "Flottant",
"PT" to "Flutuante",
"RU" to "Плавающая",
"SV" to "Flytande",
)
}
42 changes: 38 additions & 4 deletions app/src/keyboards/java/be/scri/helpers/ui/KeyboardUIManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ class KeyboardUIManager(

fun onCloseClicked()

fun onFloatClicked()

fun isFloatingModeActive(): Boolean

fun onEmojiSelected(emoji: String)

fun onSuggestionClicked(suggestion: String)
Expand All @@ -74,6 +78,8 @@ class KeyboardUIManager(

fun isNumericKeyboardActive(): Boolean

fun getKeyboardWidth(): Int

fun onClipboardSuggestionClicked()
}

Expand All @@ -82,6 +88,8 @@ class KeyboardUIManager(

// UI Elements
var pluralBtn: Button? = binding.pluralBtn
var floatBtn: Button? = null
var separatorFloat: View? = null
var emojiBtnPhone1: Button? = binding.emojiBtnPhone1
var emojiSpacePhone: View? = binding.emojiSpacePhone
var emojiBtnPhone2: Button? = binding.emojiBtnPhone2
Expand Down Expand Up @@ -220,6 +228,7 @@ class KeyboardUIManager(
listOf(binding.translateBtn, binding.conjugateBtn, binding.pluralBtn).forEachIndexed { index, button ->
button.visibility = View.VISIBLE
button.background = null
button.foreground = null
button.setTextColor(textColor)
button.text = HintUtils.getBaseAutoSuggestions(language).getOrNull(index)
button.isAllCaps = false
Expand Down Expand Up @@ -289,11 +298,31 @@ class KeyboardUIManager(
button.backgroundTintList = ContextCompat.getColorStateList(context, R.color.theme_scribe_blue)
button.setTextColor(buttonTextColor)
button.textSize = GeneralKeyboardIME.SUGGESTION_SIZE
button.isAllCaps = false
}

binding.translateBtn.text = translatePlaceholder[langAlias] ?: "Translate"
binding.conjugateBtn.text = conjugatePlaceholder[langAlias] ?: "Conjugate"
binding.pluralBtn.text = pluralPlaceholder[langAlias] ?: "Plural"
val isFloating = listener.isFloatingModeActive()
if (isFloating) {
binding.translateBtn.text = ""
binding.conjugateBtn.text = ""
binding.pluralBtn.text = ""

binding.translateBtn.foreground = ContextCompat.getDrawable(context, R.drawable.ic_translate_command)
binding.conjugateBtn.foreground = ContextCompat.getDrawable(context, R.drawable.ic_conjugate_command)
binding.pluralBtn.foreground = ContextCompat.getDrawable(context, R.drawable.ic_plural_command)

binding.translateBtn.foregroundGravity = android.view.Gravity.CENTER
binding.conjugateBtn.foregroundGravity = android.view.Gravity.CENTER
binding.pluralBtn.foregroundGravity = android.view.Gravity.CENTER
} else {
binding.translateBtn.text = translatePlaceholder[langAlias] ?: "Translate"
binding.conjugateBtn.text = conjugatePlaceholder[langAlias] ?: "Conjugate"
binding.pluralBtn.text = pluralPlaceholder[langAlias] ?: "Plural"

binding.translateBtn.foreground = null
binding.conjugateBtn.foreground = null
binding.pluralBtn.foreground = null
}

val separatorColor = (if (isUserDarkMode) GeneralKeyboardIME.DARK_THEME else GeneralKeyboardIME.LIGHT_THEME).toColorInt()
binding.separator2.setBackgroundColor(separatorColor)
Expand Down Expand Up @@ -610,7 +639,8 @@ class KeyboardUIManager(
*/
fun initializeKeyboard(xmlId: Int) {
val enterKeyType = listener.getCurrentEnterKeyType()
keyboard = KeyboardBase(context, xmlId, enterKeyType)
val width = listener.getKeyboardWidth()
keyboard = KeyboardBase(context, xmlId, enterKeyType, width)
keyboardView.setKeyboard(keyboard!!)
keyboardView.mOnKeyboardActionListener = listener.onKeyboardActionListener()
keyboardView.requestLayout()
Expand Down Expand Up @@ -678,6 +708,10 @@ class KeyboardUIManager(
binding.separator4.visibility = View.GONE
binding.separator5.visibility = View.GONE
binding.separator6.visibility = View.GONE

binding.translateBtn.foreground = null
binding.conjugateBtn.foreground = null
pluralBtn?.foreground = null
}

/**
Expand Down
Loading
Loading