diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt index 311c14815..ca462f8b6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/PasswordTypesAdapter.kt @@ -6,9 +6,10 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.simplemobiletools.gallery.R +import com.simplemobiletools.gallery.interfaces.HashListener import com.simplemobiletools.gallery.views.PatternTab -class PasswordTypesAdapter(val context: Context, val requiredHash: String, val hashListener: PatternTab.HashListener) : PagerAdapter() { +class PasswordTypesAdapter(val context: Context, val requiredHash: String, val hashListener: HashListener) : PagerAdapter() { override fun instantiateItem(container: ViewGroup, position: Int): Any { val view = LayoutInflater.from(context).inflate(layoutSelection(position), container, false) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt index 55d0064d5..1f9cbd59c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SecurityDialog.kt @@ -9,11 +9,11 @@ import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.SimpleActivity import com.simplemobiletools.gallery.adapters.PasswordTypesAdapter import com.simplemobiletools.gallery.extensions.config +import com.simplemobiletools.gallery.interfaces.HashListener import com.simplemobiletools.gallery.views.MyDialogViewPager -import com.simplemobiletools.gallery.views.PatternTab import kotlinx.android.synthetic.main.dialog_security.view.* -class SecurityDialog(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) : HashListener { var dialog: AlertDialog? = null val view = LayoutInflater.from(activity).inflate(R.layout.dialog_security, null) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/HashListener.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/HashListener.kt new file mode 100644 index 000000000..e8145070c --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/interfaces/HashListener.kt @@ -0,0 +1,5 @@ +package com.simplemobiletools.gallery.interfaces + +interface HashListener { + fun receivedHash(hash: String) +} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt index b2a6e0239..304974d98 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/views/PatternTab.kt @@ -11,6 +11,7 @@ import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.extensions.updateTextColors import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.extensions.config +import com.simplemobiletools.gallery.interfaces.HashListener import kotlinx.android.synthetic.main.tab_pattern.view.* class PatternTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs) { @@ -70,8 +71,4 @@ class PatternTab(context: Context, attrs: AttributeSet) : RelativeLayout(context } } } - - interface HashListener { - fun receivedHash(hash: String) - } }