Option to hide emoji keyboard is added.

This commit is contained in:
Onuray Sahin 2021-01-13 13:28:46 +03:00
parent 1d449c84fe
commit 1f1eeccc32
5 changed files with 22 additions and 0 deletions

View File

@ -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)

View File

@ -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) {

View File

@ -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.
*

View File

@ -917,6 +917,8 @@
<string name="settings_preview_media_before_sending">Preview media before sending</string>
<string name="settings_send_message_with_enter">Send message with enter</string>
<string name="settings_send_message_with_enter_summary">Enter button of the soft keyboard will send message instead of adding a line break</string>
<string name="settings_show_emoji_keyboard">Show emoji keyboard</string>
<string name="settings_show_emoji_keyboard_summary">Add a button on message composer to open emoji keyboard</string>
<string name="settings_secure_backup_section_title">Secure Backup</string>
<string name="settings_secure_backup_manage">Manage</string>

View File

@ -49,6 +49,12 @@
android:summary="@string/settings_send_message_with_enter_summary"
android:title="@string/settings_send_message_with_enter" />
<im.vector.app.core.preference.VectorSwitchPreference
android:defaultValue="true"
android:key="SETTINGS_SHOW_EMOJI_KEYBOARD"
android:summary="@string/settings_show_emoji_keyboard_summary"
android:title="@string/settings_show_emoji_keyboard" />
</im.vector.app.core.preference.VectorPreferenceCategory>
<im.vector.app.core.preference.VectorPreferenceCategory android:title="@string/settings_category_timeline">