-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge: 서버에서 주는 형식에 맞게 Response 형식 변경 및 매퍼 로직 변경, 행사 태그를 칩 그룹에 추가하는 바인…
- Loading branch information
Showing
6 changed files
with
9 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
9 changes: 5 additions & 4 deletions
9
...p/src/main/java/com/emmsale/presentation/common/bindingadapter/ChipGroupBindingAdapter.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
package com.emmsale.presentation.common.bindingadapter | ||
|
||
import androidx.databinding.BindingAdapter | ||
import com.emmsale.data.model.EventTag | ||
import com.emmsale.presentation.common.views.EventTagChip | ||
import com.google.android.material.chip.ChipGroup | ||
|
||
@BindingAdapter("app:eventChips") | ||
fun ChipGroup.setEventChips(tags: List<String>?) { | ||
fun ChipGroup.setEventChips(tags: List<EventTag>?) { | ||
removeAllViews() | ||
addEventTags(tags ?: emptyList()) | ||
} | ||
|
||
private fun ChipGroup.addEventTags(tags: List<String>) { | ||
private fun ChipGroup.addEventTags(tags: List<EventTag>) { | ||
tags.forEach { addView(createEventTag(it)) } | ||
} | ||
|
||
private fun ChipGroup.createEventTag(tag: String) = EventTagChip(this.context).apply { | ||
text = tag | ||
private fun ChipGroup.createEventTag(tag: EventTag) = EventTagChip(this.context).apply { | ||
text = tag.name | ||
} |
This file contains 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
This file contains 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