Skip to content

Commit

Permalink
issue boostcampwm-2022#171 refactor: measure 하지 않아 불필요한 코드 삭제
Browse files Browse the repository at this point in the history
Co-authored-by: junhyeongleeee <[email protected]>
  • Loading branch information
junhyeongleeee committed Jul 26, 2023
1 parent c270295 commit e7774c9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ class CalendarView(
}

private fun createDateTextView(dateModel: DateModel) = DateTextView(
context,
tmpHorizontal,
textHeight
context
).apply {
text = dateModel.day
setTextColor(ContextCompat.getColor(this.context, R.color.OnSurface))
Expand All @@ -151,9 +149,7 @@ class CalendarView(
private fun createDateImgView(dateModel: DateModel) = DateImgView(
context,
dateModel,
requestManager,
tmpHorizontal,
tmpVertical - textHeight
requestManager
).apply {
setPadding(IMG_PADDING)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,10 @@ import com.bumptech.glide.request.transition.DrawableCrossFadeFactory
class DateImgView constructor(
context: Context,
var dateModel: DateModel,
private val requestManager: RequestManager,
private val staticWidth: Int,
private val staticHeight: Int
private val requestManager: RequestManager
) : AppCompatImageView(context) {

private val factory = DrawableCrossFadeFactory.Builder().setCrossFadeEnabled(true).build()

override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
setMeasuredDimension(staticWidth, staticHeight)
}

fun setVideoUrl(dateModel: DateModel) {
this.dateModel = dateModel
load(dateModel.videoUrl)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,5 @@ import android.content.Context
import androidx.appcompat.widget.AppCompatTextView

class DateTextView constructor(
context: Context,
private val staticWidth: Int,
private val staticHeight: Int,
) : AppCompatTextView(context) {

override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
setMeasuredDimension(staticWidth, staticHeight)
}
}
context: Context
) : AppCompatTextView(context)

0 comments on commit e7774c9

Please sign in to comment.