Loading build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '4.1.14' propVersionName = '4.1.16' kotlin_version = '1.2.50' support_libs = '27.1.1' } Loading commons/src/main/kotlin/com/simplemobiletools/commons/adapters/PasswordTypesAdapter.kt +3 −2 Original line number Diff line number Diff line Loading @@ -10,15 +10,16 @@ import com.simplemobiletools.commons.R import com.simplemobiletools.commons.extensions.isFingerPrintSensorAvailable import com.simplemobiletools.commons.interfaces.HashListener import com.simplemobiletools.commons.interfaces.SecurityTab import com.simplemobiletools.commons.views.MyScrollView class PasswordTypesAdapter(val context: Context, val requiredHash: String, val hashListener: HashListener) : PagerAdapter() { class PasswordTypesAdapter(val context: Context, val requiredHash: String, val hashListener: HashListener, val scrollView: MyScrollView) : PagerAdapter() { private val tabs = SparseArray<SecurityTab>() override fun instantiateItem(container: ViewGroup, position: Int): Any { val view = LayoutInflater.from(context).inflate(layoutSelection(position), container, false) container.addView(view) tabs.put(position, view as SecurityTab) (view as SecurityTab).initTab(requiredHash, hashListener) (view as SecurityTab).initTab(requiredHash, hashListener, scrollView) return view } Loading commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/SecurityDialog.kt +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ class SecurityDialog(val activity: Activity, val requiredHash: String, val showT view.apply { viewPager = findViewById(R.id.dialog_tab_view_pager) viewPager.offscreenPageLimit = 2 tabsAdapter = PasswordTypesAdapter(context, requiredHash, this@SecurityDialog) tabsAdapter = PasswordTypesAdapter(context, requiredHash, this@SecurityDialog, dialog_scrollview) viewPager.adapter = tabsAdapter viewPager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener { override fun onPageScrollStateChanged(state: Int) { Loading commons/src/main/kotlin/com/simplemobiletools/commons/interfaces/SecurityTab.kt +3 −1 Original line number Diff line number Diff line package com.simplemobiletools.commons.interfaces import com.simplemobiletools.commons.views.MyScrollView interface SecurityTab { fun initTab(requiredHash: String, listener: HashListener) fun initTab(requiredHash: String, listener: HashListener, scrollView: MyScrollView) fun visibilityChanged(isVisible: Boolean) } commons/src/main/kotlin/com/simplemobiletools/commons/views/FingerprintTab.kt +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ class FingerprintTab(context: Context, attrs: AttributeSet) : RelativeLayout(con } } override fun initTab(requiredHash: String, listener: HashListener) { override fun initTab(requiredHash: String, listener: HashListener, scrollView: MyScrollView) { hashListener = listener } Loading Loading
build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '4.1.14' propVersionName = '4.1.16' kotlin_version = '1.2.50' support_libs = '27.1.1' } Loading
commons/src/main/kotlin/com/simplemobiletools/commons/adapters/PasswordTypesAdapter.kt +3 −2 Original line number Diff line number Diff line Loading @@ -10,15 +10,16 @@ import com.simplemobiletools.commons.R import com.simplemobiletools.commons.extensions.isFingerPrintSensorAvailable import com.simplemobiletools.commons.interfaces.HashListener import com.simplemobiletools.commons.interfaces.SecurityTab import com.simplemobiletools.commons.views.MyScrollView class PasswordTypesAdapter(val context: Context, val requiredHash: String, val hashListener: HashListener) : PagerAdapter() { class PasswordTypesAdapter(val context: Context, val requiredHash: String, val hashListener: HashListener, val scrollView: MyScrollView) : PagerAdapter() { private val tabs = SparseArray<SecurityTab>() override fun instantiateItem(container: ViewGroup, position: Int): Any { val view = LayoutInflater.from(context).inflate(layoutSelection(position), container, false) container.addView(view) tabs.put(position, view as SecurityTab) (view as SecurityTab).initTab(requiredHash, hashListener) (view as SecurityTab).initTab(requiredHash, hashListener, scrollView) return view } Loading
commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/SecurityDialog.kt +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ class SecurityDialog(val activity: Activity, val requiredHash: String, val showT view.apply { viewPager = findViewById(R.id.dialog_tab_view_pager) viewPager.offscreenPageLimit = 2 tabsAdapter = PasswordTypesAdapter(context, requiredHash, this@SecurityDialog) tabsAdapter = PasswordTypesAdapter(context, requiredHash, this@SecurityDialog, dialog_scrollview) viewPager.adapter = tabsAdapter viewPager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener { override fun onPageScrollStateChanged(state: Int) { Loading
commons/src/main/kotlin/com/simplemobiletools/commons/interfaces/SecurityTab.kt +3 −1 Original line number Diff line number Diff line package com.simplemobiletools.commons.interfaces import com.simplemobiletools.commons.views.MyScrollView interface SecurityTab { fun initTab(requiredHash: String, listener: HashListener) fun initTab(requiredHash: String, listener: HashListener, scrollView: MyScrollView) fun visibilityChanged(isVisible: Boolean) }
commons/src/main/kotlin/com/simplemobiletools/commons/views/FingerprintTab.kt +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ class FingerprintTab(context: Context, attrs: AttributeSet) : RelativeLayout(con } } override fun initTab(requiredHash: String, listener: HashListener) { override fun initTab(requiredHash: String, listener: HashListener, scrollView: MyScrollView) { hashListener = listener } Loading