From d9351ddf9c7c14d2a5653aba84b837375c81320d Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 20 Nov 2022 21:37:23 +0100 Subject: [PATCH] adding an explanation dialog to Grant All Files --- .../pro/dialogs/GrantAllFilesDialog.kt | 25 +++++++++++++++ .../res/layout/dialog_grant_all_files.xml | 31 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/GrantAllFilesDialog.kt create mode 100644 app/src/main/res/layout/dialog_grant_all_files.xml diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/GrantAllFilesDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/GrantAllFilesDialog.kt new file mode 100644 index 000000000..b6df18e28 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/GrantAllFilesDialog.kt @@ -0,0 +1,25 @@ +package com.simplemobiletools.gallery.pro.dialogs + +import android.view.View +import com.simplemobiletools.commons.activities.BaseSimpleActivity +import com.simplemobiletools.commons.extensions.applyColorFilter +import com.simplemobiletools.commons.extensions.getAlertDialogBuilder +import com.simplemobiletools.commons.extensions.getProperTextColor +import com.simplemobiletools.commons.extensions.setupDialogStuff +import com.simplemobiletools.gallery.pro.R +import com.simplemobiletools.gallery.pro.extensions.launchGrantAllFilesIntent +import kotlinx.android.synthetic.main.dialog_grant_all_files.view.* + +class GrantAllFilesDialog(val activity: BaseSimpleActivity) { + init { + val view: View = activity.layoutInflater.inflate(R.layout.dialog_grant_all_files, null) + view.grant_all_files_image.applyColorFilter(activity.getProperTextColor()) + + activity.getAlertDialogBuilder() + .setPositiveButton(R.string.ok) { dialog, which -> activity.launchGrantAllFilesIntent() } + .setNegativeButton(R.string.cancel, null) + .apply { + activity.setupDialogStuff(view, this, cancelOnTouchOutside = false) { alertDialog -> } + } + } +} diff --git a/app/src/main/res/layout/dialog_grant_all_files.xml b/app/src/main/res/layout/dialog_grant_all_files.xml new file mode 100644 index 000000000..131dcc1b9 --- /dev/null +++ b/app/src/main/res/layout/dialog_grant_all_files.xml @@ -0,0 +1,31 @@ + + + + + + + +