-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#160[fix] 곰 미선택시 버튼 비활성화 #161
#160[fix] 곰 미선택시 버튼 비활성화 #161
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
다른 곰돌이 다 되는데 왜 none만 안먹지..
@@ -100,9 +100,9 @@ | |||
android:layout_marginHorizontal="20dp" | |||
android:layout_marginBottom="34dp" | |||
style="?android:attr/borderlessButtonStyle" | |||
android:background="@{viewModel.selectedBearType != @string/none ? @drawable/shape_main1_fill_12_rect : @drawable/shape_gray200_fill_12_rect}" | |||
android:clickable="@{viewModel.selectedBearType != @string/none ? true : false}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getString 써보자고 쓰려다가 후다닥 지웠습니다 ^^ ㅎ.ㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지금처럼 변수 하나 생성하는 것도 괜찮긴 하지만, 변수 생성 없이 하고 싶으시면 "NONE"으로 바꿔서 한번 해보시는 것도 좋을 것 같습니당
android:background="@{viewModel.selectedBearType != @string/none ? @drawable/shape_main1_fill_12_rect : @drawable/shape_gray200_fill_12_rect}" | ||
android:clickable="@{viewModel.selectedBearType != @string/none ? true : false}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분을 !viewModel.selectedBearType.equals(@string/none)
로 바꾸면 될 것 같습니다..!
@@ -6,7 +6,6 @@ | |||
<string name="red">RED</string> | |||
<string name="white">WHITE</string> | |||
<string name="gray">GRAY</string> | |||
<string name="none"></string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분 빈 값 말고 NONE
으로 넣어주시구요!!
private val _selectedBearType: MutableLiveData<String> = MutableLiveData(NONE) | ||
val selectedBearType: LiveData<String> get() = _selectedBearType | ||
private val _isBearSelected: MutableLiveData<Boolean> = MutableLiveData(false) | ||
val isBearSelected: LiveData<Boolean> get() = _isBearSelected | ||
|
||
fun selectBearType(dollType: String) { | ||
val isSameBearSelected = _selectedBearType.value == dollType | ||
|
||
if (isSameBearSelected) _selectedBearType.value = NONE | ||
else _selectedBearType.value = dollType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NONE
으로 되어 있는 부분들 "NONE"
으로 한번 바꿔서 해보실래요..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NONE, NonNull, "" 이런 빈값 처리하는건 항상 물음표네요..
📑 Work Description
🛠️ Issue
📷 Screenshot
btn_unclickable.mp4
💬 To Reviewers
새 변수를 만들어주고 싶지 않은데, NONE인 경우만 자꾸 삼항 연산자가 안먹네요!!!!!!!!!!!!!!!!!! 이유 아시는 분 커피 한 잔