JUnit testing
Sample 1: How to properly make junit tests for that so you will make sure that ValidateStatus.Invalid will be called if EditText child text is empty? class ViewGroupKeyValidator(private val sequence:…
Sample 1: How to properly make junit tests for that so you will make sure that ValidateStatus.Invalid will be called if EditText child text is empty? class ViewGroupKeyValidator(private val sequence:…
Validating the password: private fun validatePassword(password: String, passwordConfirmation: String): Boolean { val specialCharPattern = Pattern.compile("[^a-z0-9]", Pattern.CASE_INSENSITIVE) val upperCasePatten = Pattern.compile("[A-Z]") val lowerCasePatten = Pattern.compile("[a-z]") val digitCasePatten = Pattern.compile("[0-9]") if (TextUtils.isEmpty(password)…
Here is simple snippet for making imitation of underline for textview. To use it - just set it as a textview's background. <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:background="#EDF5F5"> <item…