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
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.7.0] - 2025-11-11
### Added
- Option to show (default) or not the emoji key

### Changed
- Update translations

### Fixed
- Feature added ([#234])

## [1.6.0] - 2025-10-29
### Added
- Added Colemak, Colemak-DH, Workman, Asset, Niro, Soul layouts
Expand Down Expand Up @@ -115,6 +125,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#206]: https://github.com/FossifyOrg/Keyboard/issues/206
[#222]: https://github.com/FossifyOrg/Keyboard/issues/222
[#230]: https://github.com/FossifyOrg/Keyboard/issues/230
[#234]: https://github.com/FossifyOrg/Keyboard/issues/234
[#238]: https://github.com/FossifyOrg/Keyboard/issues/238
[#239]: https://github.com/FossifyOrg/Keyboard/issues/239
[#251]: https://github.com/FossifyOrg/Keyboard/issues/251
Expand All @@ -123,7 +134,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#265]: https://github.com/FossifyOrg/Keyboard/issues/265
[#274]: https://github.com/FossifyOrg/Keyboard/issues/274

[Unreleased]: https://github.com/FossifyOrg/Keyboard/compare/1.6.0...HEAD
[Unreleased]: https://github.com/FossifyOrg/Keyboard/compare/1.7.0...HEAD
[1.7.0]: https://github.com/FossifyOrg/Keyboard/compare/1.6.0...1.7.0
[1.6.0]: https://github.com/FossifyOrg/Keyboard/compare/1.5.0...1.6.0
[1.5.0]: https://github.com/FossifyOrg/Keyboard/compare/1.4.0...1.5.0
[1.4.0]: https://github.com/FossifyOrg/Keyboard/compare/1.3.0...1.4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class SettingsActivity : SimpleActivity() {
setupManageKeyboardLanguages()
setupKeyboardLanguage()
setupKeyboardHeightMultiplier()
setupShowEmojiKey()
setupShowClipboardContent()
setupSentencesCapitalization()
setupShowNumbersRow()
Expand Down Expand Up @@ -237,6 +238,16 @@ class SettingsActivity : SimpleActivity() {
}
}

private fun setupShowEmojiKey() {
binding.apply {
settingsShowEmojiKeyHolder.setOnClickListener {
settingsShowEmojiKey.toggle()
config.showEmojiKey = settingsShowEmojiKey.isChecked
}
settingsShowEmojiKey.isChecked = config.showEmojiKey
}
}

private fun setupShowNumbersRow() {
binding.apply {
settingsShowNumbersRow.isChecked = config.showNumbersRow
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/kotlin/org/fossify/keyboard/helpers/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ class Config(context: Context) : BaseConfig(context) {
get() = prefs.getBoolean(SENTENCES_CAPITALIZATION, true)
set(enableCapitalization) = prefs.edit().putBoolean(SENTENCES_CAPITALIZATION, enableCapitalization).apply()

var showEmojiKey: Boolean
get() = prefs.getBoolean(SHOW_EMOJI_KEY, true)
set(showEmojiKey) = prefs.edit().putBoolean(SHOW_EMOJI_KEY, showEmojiKey).apply()

var showKeyBorders: Boolean
get() = prefs.getBoolean(SHOW_KEY_BORDERS, true)
set(showKeyBorders) = prefs.edit().putBoolean(SHOW_KEY_BORDERS, showKeyBorders).apply()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const val VIBRATE_ON_KEYPRESS = "vibrate_on_keypress"
const val SHOW_POPUP_ON_KEYPRESS = "show_popup_on_keypress"
const val SHOW_KEY_BORDERS = "show_key_borders"
const val SENTENCES_CAPITALIZATION = "sentences_capitalization"
const val SHOW_EMOJI_KEY = "show_emoji_key"
const val LAST_EXPORTED_CLIPS_FOLDER = "last_exported_clips_folder"
const val KEYBOARD_LANGUAGE = "keyboard_language"
const val HEIGHT_PERCENTAGE = "height_percentage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
inputTypeClass = attribute!!.inputType and TYPE_MASK_CLASS
inputTypeClassVariation = attribute.inputType and TYPE_MASK_VARIATION
enterKeyType = attribute.imeOptions and (IME_MASK_ACTION or IME_FLAG_NO_ENTER_ACTION)
keyboard = createNewKeyboard()
keyboard = createNewKeyboard().adjustForEmojiButton()
keyboardView?.setKeyboard(keyboard!!)
keyboardView?.setEditorInfo(attribute)
if (isNougatPlus()) {
Expand Down Expand Up @@ -209,7 +209,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
keyboardMode = KEYBOARD_SYMBOLS
R.xml.keys_symbols
}
keyboard = MyKeyboard(this, keyboardXml, enterKeyType)
keyboard = MyKeyboard(this, keyboardXml, enterKeyType).adjustForEmojiButton()
keyboardView!!.setKeyboard(keyboard!!)
}
keyboardView!!.invalidateAllKeys()
Expand All @@ -234,7 +234,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
R.xml.keys_symbols
}

keyboard = MyKeyboard(this, keyboardXML, enterKeyType)
keyboard = MyKeyboard(this, keyboardXML, enterKeyType).adjustForEmojiButton()
keyboardView!!.setKeyboard(keyboard!!)
}

Expand All @@ -247,7 +247,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
getKeyboardLayoutXML()
}

keyboard = MyKeyboard(this, keyboardXml, enterKeyType)
keyboard = MyKeyboard(this, keyboardXml, enterKeyType).adjustForEmojiButton()
keyboardView!!.setKeyboard(keyboard!!)
}

Expand Down Expand Up @@ -337,7 +337,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
// TODO: Change keyboardMode to enum class
keyboardMode = KEYBOARD_LETTERS

keyboard = MyKeyboard(this, getKeyboardLayoutXML(), enterKeyType)
keyboard = MyKeyboard(this, getKeyboardLayoutXML(), enterKeyType).adjustForEmojiButton()

val editorInfo = currentInputEditorInfo
if (editorInfo != null && editorInfo.inputType != TYPE_NULL && keyboard?.mShiftState != ShiftState.ON_PERMANENT) {
Expand All @@ -364,7 +364,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
}

override fun reloadKeyboard() {
val keyboard = createNewKeyboard()
val keyboard = createNewKeyboard().adjustForEmojiButton()
this.keyboard = keyboard
keyboardView?.setKeyboard(keyboard)
}
Expand Down Expand Up @@ -403,7 +403,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
context = this,
xmlLayoutResId = keyboardXml,
enterKeyType = enterKeyType,
)
).adjustForEmojiButton()
}

override fun onUpdateSelection(oldSelStart: Int, oldSelEnd: Int, newSelStart: Int, newSelEnd: Int, candidatesStart: Int, candidatesEnd: Int) {
Expand Down Expand Up @@ -582,4 +582,26 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared

return Icon.createWithData(byteArray, 0, byteArray.size)
}

private fun MyKeyboard.adjustForEmojiButton(): MyKeyboard {
if (!config.showEmojiKey && keyboardMode == KEYBOARD_LETTERS) {
mKeys?.let { keys ->
val emojiKeyIndex = keys.indexOfFirst { it.code == MyKeyboard.KEYCODE_EMOJI }
val spaceKeyIndex = keys.indexOfFirst { it.code == MyKeyboard.KEYCODE_SPACE }

if (emojiKeyIndex != -1 && spaceKeyIndex != -1) {
val emojiKey = keys[emojiKeyIndex]
val spaceKey = keys[spaceKeyIndex]

spaceKey.width += emojiKey.width + emojiKey.gap
spaceKey.x = emojiKey.x

val mutableKeys = keys.toMutableList()
mutableKeys.removeAt(emojiKeyIndex)
mKeys = mutableKeys
}
}
}
return this
}
}
15 changes: 15 additions & 0 deletions app/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,21 @@

</RelativeLayout>

<RelativeLayout
android:id="@+id/settings_show_emoji_key_holder"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_show_emoji_key"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/show_emoji_key" />

</RelativeLayout>

<RelativeLayout
android:id="@+id/settings_keyboard_height_multiplier_holder"
style="@style/SettingsHolderTextViewStyle"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<string name="show_key_borders">Mostra i bordi dei tasti</string>
<string name="show_numbers_row">Mostra i numeri su una riga separata</string>
<string name="start_sentences_capitalized">Inizia le frasi con la lettera maiuscola</string>
<string name="show_emoji_key">Mostra tasto emoji</string>
<string name="emojis">Emoji</string>
<string name="redirection_note">Attiva Tastiera Fossify nella schermata successiva per renderla disponibile. Una volta abilitata, premi \"Indietro\".</string>
<string name="clipboard">Appunti</string>
Expand All @@ -46,4 +47,4 @@
<string name="food_and_drink">Cibo e bevande</string>
<string name="travel_and_places">Viaggi e luoghi</string>
<string name="activities">Attività</string>
</resources>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<string name="show_key_borders">Show key borders</string>
<string name="show_numbers_row">Show numbers on a separate row</string>
<string name="start_sentences_capitalized">Start sentences with a capital letter</string>
<string name="show_emoji_key">Show emoji key</string>
<!-- Emojis -->
<string name="emojis">Emojis</string>
<string name="recently_used">Recently used</string>
Expand Down
Loading