Commit 4cf60e36 authored by Łukasz Rutkowski's avatar Łukasz Rutkowski

Dismiss emoji keyboard when starting search

parent 79bc2d7d
...@@ -271,7 +271,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR ...@@ -271,7 +271,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
activity?.invalidateOptionsMenu() activity?.invalidateOptionsMenu()
} }
private fun dismissEmojiKeyboard() { fun dismissEmojiKeyboard() {
// Check if the keyboard was ever initialized. // Check if the keyboard was ever initialized.
// It may be the case when you are looking a not joined room // It may be the case when you are looking a not joined room
if (::emojiKeyboardPopup.isInitialized) { if (::emojiKeyboardPopup.isInitialized) {
......
...@@ -79,6 +79,14 @@ private fun ChatRoomFragment.setupSearchMessageMenuItem(menu: Menu, context: Con ...@@ -79,6 +79,14 @@ private fun ChatRoomFragment.setupSearchMessageMenuItem(menu: Menu, context: Con
.setShowAsActionFlags( .setShowAsActionFlags(
MenuItem.SHOW_AS_ACTION_IF_ROOM or MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW MenuItem.SHOW_AS_ACTION_IF_ROOM or MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW
) )
.setOnActionExpandListener(object : MenuItem.OnActionExpandListener {
override fun onMenuItemActionExpand(item: MenuItem?): Boolean {
dismissEmojiKeyboard()
return true
}
override fun onMenuItemActionCollapse(item: MenuItem?) = true
})
(searchItem?.actionView as? SearchView)?.let { (searchItem?.actionView as? SearchView)?.let {
// TODO: Check why we need to stylize the search text programmatically instead of by defining it in the styles.xml (ChatRoom.SearchView) // TODO: Check why we need to stylize the search text programmatically instead of by defining it in the styles.xml (ChatRoom.SearchView)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment