diff --git a/CHANGES.md b/CHANGES.md
index d0cfcf2089..a4a3f7ee73 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -8,6 +8,7 @@ Features ✨:
Improvements 🙌:
- Add System theme option and set as default (#904, #2387)
- Warn user when they are leaving a not public room (#1460)
+ - Option to disable emoji keyboard (#2563)
Bugfix 🐛:
- Unspecced msgType field in m.sticker (#2580)
diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt
index 8d0ed34c1e..e134230c61 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt
@@ -1164,6 +1164,8 @@ class RoomDetailFragment @Inject constructor(
} else false
}
+ views.composerLayout.views.composerEmojiButton.isVisible = vectorPreferences.showEmojiKeyboard()
+
views.composerLayout.callback = object : TextComposerView.Callback {
override fun onAddAttachment() {
if (!::attachmentTypeSelector.isInitialized) {
diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt b/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt
index 16be2b1552..d3ef36a80b 100755
--- a/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt
+++ b/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt
@@ -98,6 +98,7 @@ class VectorPreferences @Inject constructor(private val context: Context) {
private const val SETTINGS_VIBRATE_ON_MENTION_KEY = "SETTINGS_VIBRATE_ON_MENTION_KEY"
private const val SETTINGS_SEND_MESSAGE_WITH_ENTER = "SETTINGS_SEND_MESSAGE_WITH_ENTER"
private const val SETTINGS_ENABLE_CHAT_EFFECTS = "SETTINGS_ENABLE_CHAT_EFFECTS"
+ private const val SETTINGS_SHOW_EMOJI_KEYBOARD = "SETTINGS_SHOW_EMOJI_KEYBOARD"
// Help
private const val SETTINGS_SHOULD_SHOW_HELP_ON_ROOM_LIST_KEY = "SETTINGS_SHOULD_SHOW_HELP_ON_ROOM_LIST_KEY"
@@ -207,6 +208,7 @@ class VectorPreferences @Inject constructor(private val context: Context) {
SETTINGS_MEDIA_SAVING_PERIOD_SELECTED_KEY,
SETTINGS_PREVIEW_MEDIA_BEFORE_SENDING_KEY,
SETTINGS_SEND_MESSAGE_WITH_ENTER,
+ SETTINGS_SHOW_EMOJI_KEYBOARD,
SETTINGS_PIN_UNREAD_MESSAGES_PREFERENCE_KEY,
SETTINGS_PIN_MISSED_NOTIFICATIONS_PREFERENCE_KEY,
@@ -822,6 +824,15 @@ class VectorPreferences @Inject constructor(private val context: Context) {
return defaultPrefs.getBoolean(SETTINGS_SEND_MESSAGE_WITH_ENTER, false)
}
+ /**
+ * Tells if the emoji keyboard button should be visible or not.
+ *
+ * @return true to show emoji keyboard button.
+ */
+ fun showEmojiKeyboard(): Boolean {
+ return defaultPrefs.getBoolean(SETTINGS_SHOW_EMOJI_KEYBOARD, true)
+ }
+
/**
* Tells if the rage shake is used.
*
diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml
index 8612bc43f1..1f282115e0 100644
--- a/vector/src/main/res/values/strings.xml
+++ b/vector/src/main/res/values/strings.xml
@@ -917,6 +917,8 @@
Preview media before sending
Send message with enter
Enter button of the soft keyboard will send message instead of adding a line break
+ Show emoji keyboard
+ Add a button on message composer to open emoji keyboard
Secure Backup
Manage
diff --git a/vector/src/main/res/xml/vector_settings_preferences.xml b/vector/src/main/res/xml/vector_settings_preferences.xml
index 6297b89e6c..4150432149 100644
--- a/vector/src/main/res/xml/vector_settings_preferences.xml
+++ b/vector/src/main/res/xml/vector_settings_preferences.xml
@@ -49,6 +49,12 @@
android:summary="@string/settings_send_message_with_enter_summary"
android:title="@string/settings_send_message_with_enter" />
+
+