Focus on search bar when opening reaction view

This commit is contained in:
ryg-git 2021-09-27 22:41:34 +05:30
parent 7e5ec29977
commit 7d911fff17
2 changed files with 8 additions and 1 deletions

View file

@ -165,6 +165,12 @@ class EmojiReactionPickerActivity : VectorBaseActivity<ActivityEmojiReactionPick
}
})
searchView.setOnCloseListener {
currentFocus?.clearFocus()
searchItem.collapseActionView()
true
}
searchView.queryTextChanges()
.throttleWithTimeout(600, TimeUnit.MILLISECONDS)
.doOnError { err -> Timber.e(err) }
@ -174,6 +180,7 @@ class EmojiReactionPickerActivity : VectorBaseActivity<ActivityEmojiReactionPick
}
.disposeOnDestroy()
}
searchItem.expandActionView()
return true
}

View file

@ -7,5 +7,5 @@
app:iconTint="?vctr_content_primary"
android:title="@string/search"
app:actionViewClass="android.widget.SearchView"
app:showAsAction="collapseActionView|ifRoom" />
app:showAsAction="collapseActionView|always" />
</menu>