Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ fun editNote(commonViewModel: CommonViewModel, applicationContext: Context) {
text = commonViewModel.noteTitle.value,
label = "Title",
onTextChange = {
if (it.all { char ->
char.isLetter() || char.isWhitespace()
})
// if (it.all { char ->
// char.isLetter() || char.isWhitespace()
// })
commonViewModel.noteTitle.value = it
if (commonViewModel.noteTitleErrorState.value) {
commonViewModel.noteTitleErrorState.value = false
Expand All @@ -156,7 +156,7 @@ fun editNote(commonViewModel: CommonViewModel, applicationContext: Context) {
text = commonViewModel.noteDescription.value,
label = "Description",
onTextChange = {
if (it.all { char -> char.isLetter() || char.isWhitespace() })
//if (it.all { char -> char.isLetter() || char.isWhitespace() })
commonViewModel.noteDescription.value = it
if (commonViewModel.noteDescriptionErrorState.value) {
commonViewModel.noteDescriptionErrorState.value = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ class CommonViewModel @Inject constructor(
// val ptrn = "^[a-z](?=.*[~'!@#$%^&*-_=+/.,])(?=(.*[A-Z]){2,})(?=(.*[0-9]){2,}).{8,15}\$"
// val pattern = Pattern.compile(ptrn)
// pattern.matcher(password).find()
return !password.contains(name, ignoreCase = true) &&
password.matches(Regex(strongPass))
return !password.contains(name, ignoreCase = true) //&&
// password.matches(Regex(strongPass))
}

fun clearSignUp() {
Expand All @@ -121,7 +121,7 @@ class CommonViewModel @Inject constructor(
fun validateLogin(): Boolean {
luserNameErrorState.value = luserName.value.isEmpty()
lpasswordErrorState.value = lpassword.value.isEmpty()
return luserName.value.isNotEmpty() && lpassword.value.length in 8..15
return luserName.value.isNotEmpty()// && lpassword.value.length in 8..15
}

fun validateSignUp(): Boolean {
Expand Down Expand Up @@ -373,11 +373,13 @@ class CommonViewModel @Inject constructor(

fun validateTitle(title: String): Boolean{
Log.d("validateTitle", "${title.length} ${title.length in 5..100}")
return title.length in 5..100
// return title.length in 5..100
return true
}

fun validateDescription(desc: String): Boolean{
Log.d("validateDesc", "${desc.length} ${desc.length in 100..1000}")
return desc.length in 100..1000
// return desc.length in 100..1000
return true
}
}