Skip to content

Commit

Permalink
refactor : EventTag TextView로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
chws0508 committed Aug 2, 2023
1 parent 01c294b commit bf38402
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class EventDetailActivity : AppCompatActivity() {
when (eventDetailUiState) {
is EventDetailUiState.Success -> {
binding.eventDetail = eventDetailUiState
addTagChip(eventDetailUiState.tags)
addTag(eventDetailUiState.tags)
initFragmentStateAdapter(
eventDetailUiState.informationUrl,
eventDetailUiState.imageUrl,
Expand All @@ -74,11 +74,11 @@ class EventDetailActivity : AppCompatActivity() {
}
}

private fun addTagChip(tags: List<String>) {
tags.forEach { binding.chipgroupEvendetailTags.addView(createChip(it)) }
private fun addTag(tags: List<String>) {
tags.forEach { binding.chipgroupEvendetailTags.addView(createTag(it)) }
}

private fun createChip(tag: String) = EventTag(this).apply {
private fun createTag(tag: String) = EventTag(this).apply {
text = tag
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package com.emmsale.presentation.ui.eventdetail
import android.content.Context
import android.util.AttributeSet
import android.view.Gravity
import androidx.appcompat.widget.AppCompatCheckBox
import androidx.appcompat.widget.AppCompatTextView
import androidx.core.content.ContextCompat
import androidx.core.view.updatePadding
import com.emmsale.R
import com.emmsale.presentation.utils.extension.px

class EventTag : AppCompatCheckBox {
class EventTag : AppCompatTextView {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)

Expand All @@ -18,7 +18,6 @@ class EventTag : AppCompatCheckBox {
}

private fun initView() {
buttonDrawable = null
isClickable = false
textSize = 12F
gravity = Gravity.CENTER
Expand Down

0 comments on commit bf38402

Please sign in to comment.