diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index 115ce1bd6..4e26b5f8b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -7,7 +7,7 @@ import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.extensions.updateTextColors import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.gallery.R -import com.simplemobiletools.gallery.dialogs.PatternDialog +import com.simplemobiletools.gallery.dialogs.SecurityDialog import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.extensions.handleHiddenFolderPasswordProtection import com.simplemobiletools.gallery.helpers.* @@ -155,7 +155,7 @@ class SettingsActivity : SimpleActivity() { private fun setupPasswordProtection() { settings_password_protection.isChecked = config.isPasswordProtectionOn settings_password_protection_holder.setOnClickListener { - PatternDialog(this, config.passwordHash) { + SecurityDialog(this, config.passwordHash) { val hasPasswordProtection = config.isPasswordProtectionOn settings_password_protection.isChecked = !hasPasswordProtection config.isPasswordProtectionOn = !hasPasswordProtection diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt similarity index 83% rename from app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt rename to app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt index 8a909c945..e28ea54ba 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PatternDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt @@ -9,11 +9,11 @@ import com.simplemobiletools.gallery.adapters.PasswordTypesAdapter import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.views.MyDialogViewPager import com.simplemobiletools.gallery.views.PatternTab -import kotlinx.android.synthetic.main.dialog_pattern.view.* +import kotlinx.android.synthetic.main.dialog_security.view.* -class PatternDialog(val activity: SimpleActivity, val requiredHash: String, val callback: (hash: String) -> Unit) : PatternTab.HashListener { +class SecurityDialog(val activity: SimpleActivity, val requiredHash: String, val callback: (hash: String) -> Unit) : PatternTab.HashListener { var dialog: AlertDialog? = null - val view = LayoutInflater.from(activity).inflate(R.layout.dialog_pattern, null) + val view = LayoutInflater.from(activity).inflate(R.layout.dialog_security, null) init { view.apply { @@ -21,7 +21,7 @@ class PatternDialog(val activity: SimpleActivity, val requiredHash: String, val dialog_tab_layout.setTabTextColors(textColor, textColor) val viewPager = findViewById(R.id.dialog_tab_view_pager) as MyDialogViewPager - viewPager.adapter = PasswordTypesAdapter(context, requiredHash, this@PatternDialog) + viewPager.adapter = PasswordTypesAdapter(context, requiredHash, this@SecurityDialog) } dialog = AlertDialog.Builder(activity) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt index 348b54037..fa035db0e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt @@ -24,7 +24,7 @@ import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.gallery.BuildConfig import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.SimpleActivity -import com.simplemobiletools.gallery.dialogs.PatternDialog +import com.simplemobiletools.gallery.dialogs.SecurityDialog import com.simplemobiletools.gallery.helpers.NOMEDIA import com.simplemobiletools.gallery.helpers.REQUEST_EDIT_IMAGE import com.simplemobiletools.gallery.helpers.REQUEST_SET_AS @@ -335,7 +335,7 @@ fun Activity.loadStaticGif(path: String, target: MySquareImageView) { fun SimpleActivity.handleHiddenFolderPasswordProtection(callback: () -> Unit) { if (config.isPasswordProtectionOn) { - PatternDialog(this, config.passwordHash) { + SecurityDialog(this, config.passwordHash) { callback() } } else { diff --git a/app/src/main/res/layout/dialog_pattern.xml b/app/src/main/res/layout/dialog_security.xml similarity index 100% rename from app/src/main/res/layout/dialog_pattern.xml rename to app/src/main/res/layout/dialog_security.xml