Skip to content

Commit

Permalink
단어장 (테이블명) 조건 추가
Browse files Browse the repository at this point in the history
권장규약에 따라 테이블명이 공백(언더바)로 끝나지 않게 조건 설정
  • Loading branch information
TTC1018 committed Sep 21, 2021
1 parent 549eda7 commit 158c86a
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,17 @@ class MyDicFragment : Fragment() {
before: Int,
count: Int
) {
okBtn.isClickable = s!!.matches(Regex("^[\\p{Alnum}|\\s]+\$")) && s.isNotEmpty() && !s.startsWith(" ")
okBtn.isClickable = s!!.matches(Regex("^[\\p{Alnum}|\\s]+\$")) && s.isNotEmpty() && !s.startsWith(" ") && !s.endsWith(" ")
if(!okBtn.isClickable){ // 한글 숫자 영어 아닐 때
okBtn.setBackgroundColor(Color.GRAY)
if(s.isEmpty()){
dicText.error = "글자를 입력해주세요"
}
else if(s.startsWith(" ")){
dicText.error = "공백만 입력할 수는 없습니다"
dicText.error = "공백으로 시작할 수 없습니다"
}
else if(s.endsWith(" ")){
dicText.error = "공백으로 끝날 수 없습니다"
}
else{
dicText.error = "올바른 문자를 입력해주세요"
Expand Down

0 comments on commit 158c86a

Please sign in to comment.