From 6bb69e3d9f6050d0c6ab6fbb5ff67985d32c3584 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 14 Dec 2018 21:07:00 +0100 Subject: [PATCH] show an additional dialog before displaying the OTG permission one --- .../gallery/pro/activities/MainActivity.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index d09dfbcea..0b6bf1658 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -17,6 +17,7 @@ import android.widget.Toast import androidx.appcompat.widget.SearchView import androidx.core.view.MenuItemCompat import androidx.recyclerview.widget.RecyclerView +import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.CreateNewFolderDialog import com.simplemobiletools.commons.dialogs.FilePickerDialog import com.simplemobiletools.commons.extensions.* @@ -356,8 +357,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { Thread { if (hasOTGConnected()) { runOnUiThread { - handleOTGPermission { - config.addIncludedFolder(OTG_PATH) + ConfirmationDialog(this, getString(R.string.otg_detected), positive = R.string.ok, negative = 0) { + handleOTGPermission { + config.addIncludedFolder(OTG_PATH) + } } } config.wasOTGHandled = true