Fix for message composer losing focus in Compose 1.8.0 (#4853)
Co-authored-by: ElementBot <android@element.io>
This commit is contained in:
parent
2eda54d264
commit
eff693ccd9
12 changed files with 46 additions and 25 deletions
|
|
@ -27,6 +27,11 @@ fun View.showKeyboard(andRequestFocus: Boolean = false) {
|
|||
imm?.showSoftInput(this, InputMethodManager.SHOW_IMPLICIT)
|
||||
}
|
||||
|
||||
fun View.isKeyboardVisible(): Boolean {
|
||||
val imm = context?.getSystemService<InputMethodManager>()
|
||||
return imm?.isAcceptingText == true
|
||||
}
|
||||
|
||||
suspend fun View.awaitWindowFocus() = suspendCancellableCoroutine { continuation ->
|
||||
if (hasWindowFocus()) {
|
||||
continuation.resume(Unit)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue