mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
move the HashListener interface in a separate file
This commit is contained in:
parent
2684fde107
commit
805633dfb6
4 changed files with 10 additions and 7 deletions
|
@ -6,9 +6,10 @@ import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import com.simplemobiletools.gallery.R
|
import com.simplemobiletools.gallery.R
|
||||||
|
import com.simplemobiletools.gallery.interfaces.HashListener
|
||||||
import com.simplemobiletools.gallery.views.PatternTab
|
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 {
|
override fun instantiateItem(container: ViewGroup, position: Int): Any {
|
||||||
val view = LayoutInflater.from(context).inflate(layoutSelection(position), container, false)
|
val view = LayoutInflater.from(context).inflate(layoutSelection(position), container, false)
|
||||||
|
|
|
@ -9,11 +9,11 @@ import com.simplemobiletools.gallery.R
|
||||||
import com.simplemobiletools.gallery.activities.SimpleActivity
|
import com.simplemobiletools.gallery.activities.SimpleActivity
|
||||||
import com.simplemobiletools.gallery.adapters.PasswordTypesAdapter
|
import com.simplemobiletools.gallery.adapters.PasswordTypesAdapter
|
||||||
import com.simplemobiletools.gallery.extensions.config
|
import com.simplemobiletools.gallery.extensions.config
|
||||||
|
import com.simplemobiletools.gallery.interfaces.HashListener
|
||||||
import com.simplemobiletools.gallery.views.MyDialogViewPager
|
import com.simplemobiletools.gallery.views.MyDialogViewPager
|
||||||
import com.simplemobiletools.gallery.views.PatternTab
|
|
||||||
import kotlinx.android.synthetic.main.dialog_security.view.*
|
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
|
var dialog: AlertDialog? = null
|
||||||
val view = LayoutInflater.from(activity).inflate(R.layout.dialog_security, null)
|
val view = LayoutInflater.from(activity).inflate(R.layout.dialog_security, null)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
package com.simplemobiletools.gallery.interfaces
|
||||||
|
|
||||||
|
interface HashListener {
|
||||||
|
fun receivedHash(hash: String)
|
||||||
|
}
|
|
@ -11,6 +11,7 @@ import com.simplemobiletools.commons.extensions.toast
|
||||||
import com.simplemobiletools.commons.extensions.updateTextColors
|
import com.simplemobiletools.commons.extensions.updateTextColors
|
||||||
import com.simplemobiletools.gallery.R
|
import com.simplemobiletools.gallery.R
|
||||||
import com.simplemobiletools.gallery.extensions.config
|
import com.simplemobiletools.gallery.extensions.config
|
||||||
|
import com.simplemobiletools.gallery.interfaces.HashListener
|
||||||
import kotlinx.android.synthetic.main.tab_pattern.view.*
|
import kotlinx.android.synthetic.main.tab_pattern.view.*
|
||||||
|
|
||||||
class PatternTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, attrs) {
|
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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue