From e7774c92636645fefdaf68b3375bd20fc987420c Mon Sep 17 00:00:00 2001 From: junhyeongleeee Date: Wed, 26 Jul 2023 17:08:49 +0900 Subject: [PATCH] =?UTF-8?q?issue=20#171=20refactor:=20measure=20=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EC=95=84=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: junhyeongleeee --- .../presentation/calendar/custom/CalendarView.kt | 8 ++------ .../presentation/calendar/custom/DateImgView.kt | 9 +-------- .../presentation/calendar/custom/DateTextView.kt | 11 ++--------- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/com/boostcamp/dailyfilm/presentation/calendar/custom/CalendarView.kt b/app/src/main/java/com/boostcamp/dailyfilm/presentation/calendar/custom/CalendarView.kt index 48a76578..21694ca3 100644 --- a/app/src/main/java/com/boostcamp/dailyfilm/presentation/calendar/custom/CalendarView.kt +++ b/app/src/main/java/com/boostcamp/dailyfilm/presentation/calendar/custom/CalendarView.kt @@ -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)) @@ -151,9 +149,7 @@ class CalendarView( private fun createDateImgView(dateModel: DateModel) = DateImgView( context, dateModel, - requestManager, - tmpHorizontal, - tmpVertical - textHeight + requestManager ).apply { setPadding(IMG_PADDING) } diff --git a/app/src/main/java/com/boostcamp/dailyfilm/presentation/calendar/custom/DateImgView.kt b/app/src/main/java/com/boostcamp/dailyfilm/presentation/calendar/custom/DateImgView.kt index bfcc851a..ff6df057 100644 --- a/app/src/main/java/com/boostcamp/dailyfilm/presentation/calendar/custom/DateImgView.kt +++ b/app/src/main/java/com/boostcamp/dailyfilm/presentation/calendar/custom/DateImgView.kt @@ -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) diff --git a/app/src/main/java/com/boostcamp/dailyfilm/presentation/calendar/custom/DateTextView.kt b/app/src/main/java/com/boostcamp/dailyfilm/presentation/calendar/custom/DateTextView.kt index d40f0175..33c41a13 100644 --- a/app/src/main/java/com/boostcamp/dailyfilm/presentation/calendar/custom/DateTextView.kt +++ b/app/src/main/java/com/boostcamp/dailyfilm/presentation/calendar/custom/DateTextView.kt @@ -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)