rename PatternDialog to SecurityDialog

This commit is contained in:
tibbi 2017-07-31 22:00:22 +02:00
parent 9099aa176d
commit 615c49407d
4 changed files with 8 additions and 8 deletions

View file

@ -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

View file

@ -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)

View file

@ -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 {