Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b49229d6 authored by tibbi's avatar tibbi
Browse files

do not scroll the pattern tab while inserting it

parent 47d5f430
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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'
    }
+3 −2
Original line number Diff line number Diff line
@@ -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
    }

+1 −1
Original line number Diff line number Diff line
@@ -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) {
+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)
}
+1 −1
Original line number Diff line number Diff line
@@ -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