Last active
April 21, 2021 00:00
-
-
Save braghome/dd2f92e625c7f35ee5d4fd742b09981c to your computer and use it in GitHub Desktop.
some missing code on vegeta2102 blog trying to add it back in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val charList = listOf<Char>('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', | |
'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z') | |
val isValidCharacters: (Char) -> Boolean = {c -> charList.contains(Character.toLowerCase(c))} | |
val isCharNumberUnderScore: (String) -> Boolean = { s: String -> | |
val allValid = s.all { ch -> | |
isValidCharacters(ch) || Character.valueOf(ch).isDigit() || Character.valueOf(ch) == '_' | |
} | |
allValid | |
} | |
class Validator { | |
fun verify(shoeName: String): Boolean { | |
return isCharNumberUnderScore(shoeName) | |
} | |
} |
aah, the solution was to make every static, AKA in kotlin speak into a companion object used the declared class
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@lupajz
I recently checked your blog on medium Two-way data binding with InputTextEditText Google Materialstrange compilation error on line 13