Use viewCompat to check if IME is visible

This commit is contained in:
Jays2Kings 2023-04-16 16:51:19 -04:00
parent 35dd94c179
commit 97bcecc1d1

View file

@ -951,7 +951,8 @@ open class MainActivity : BaseActivity<MainActivityBinding>(), DownloadServiceLi
private fun pressingBack() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU &&
window.decorView.rootWindowInsets?.isVisible(WindowInsetsCompat.Type.ime()) == true
ViewCompat.getRootWindowInsets(window.decorView)
?.isVisible(WindowInsetsCompat.Type.ime()) == true
) {
WindowInsetsControllerCompat(window, binding.root).hide(WindowInsetsCompat.Type.ime())
} else if (actionMode != null) {