mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-04-21 02:44:00 +02:00
Avoid consuming all key events
The dialog's key listener was consuming all key events and led to problems like https://github.com/FossifyOrg/Gallery/issues/128
This commit is contained in:
parent
5630a4ceb0
commit
e6a90db721
1 changed files with 6 additions and 3 deletions
|
@ -1,7 +1,8 @@
|
|||
package org.fossify.gallery.dialogs
|
||||
|
||||
import android.graphics.Color
|
||||
import android.view.KeyEvent
|
||||
import android.view.KeyEvent.ACTION_UP
|
||||
import android.view.KeyEvent.KEYCODE_BACK
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
|
@ -54,10 +55,12 @@ class PickDirectoryDialog(
|
|||
.setPositiveButton(org.fossify.commons.R.string.ok, null)
|
||||
.setNegativeButton(org.fossify.commons.R.string.cancel, null)
|
||||
.setOnKeyListener { dialogInterface, i, keyEvent ->
|
||||
if (keyEvent.action == KeyEvent.ACTION_UP && i == KeyEvent.KEYCODE_BACK) {
|
||||
return@setOnKeyListener if (keyEvent.action == ACTION_UP && i == KEYCODE_BACK) {
|
||||
backPressed()
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
if (showOtherFolderButton) {
|
||||
|
|
Loading…
Add table
Reference in a new issue