Minor code improvement

This commit is contained in:
Naveen 2023-09-10 17:33:24 +05:30
parent 70e23a72ba
commit 774a81e09f
No known key found for this signature in database
GPG key ID: 0E155DAD31671DA3
2 changed files with 4 additions and 3 deletions

View file

@ -46,7 +46,7 @@ abstract class BaseSecurityTab(context: Context, attrs: AttributeSet) : Relative
} else {
updateTitle(context.getString(wrongTextRes), context.getColor(R.color.md_red))
titleTextView.blink()
handler.postDelayed(1000) {
handler.postDelayed(delayInMillis = 1000) {
updateTitle(context.getString(defaultTextRes), context.getProperTextColor())
}
}

View file

@ -7,6 +7,7 @@ import android.util.AttributeSet
import android.view.MotionEvent
import android.widget.TextView
import androidx.biometric.auth.AuthPromptHost
import androidx.core.os.postDelayed
import com.andrognito.patternlockview.PatternLockView
import com.andrognito.patternlockview.listener.PatternLockViewListener
import com.andrognito.patternlockview.utils.PatternLockUtils
@ -96,12 +97,12 @@ class PatternTab(context: Context, attrs: AttributeSet) : BaseSecurityTab(contex
else -> {
onIncorrectPassword()
binding.patternLockView.setViewMode(PatternLockView.PatternViewMode.WRONG)
Handler().postDelayed({
Handler().postDelayed(delayInMillis = 1000) {
binding.patternLockView.clearPattern()
if (requiredHash.isEmpty()) {
computedHash = ""
}
}, 1000)
}
}
}
}