From 81c50220b5722390d30818e81a15c63b6740c093 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Tue, 19 Mar 2024 09:48:33 +0900 Subject: [PATCH 01/19] =?UTF-8?q?[chore]=20#117=20=EC=9D=B8=EC=A6=9D?= =?UTF-8?q?=EC=82=AC=EC=A7=84=200=EA=B0=9C,=20=EC=9A=B4=EB=8F=99=EB=AF=B8?= =?UTF-8?q?=EC=85=98=EC=84=A0=ED=83=9Dx=20=ED=8C=8C=EC=9D=BC=20=EA=B7=B8?= =?UTF-8?q?=EB=9E=98=ED=94=BD=20=EA=B5=90=EC=B2=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/deploymentTargetDropDown.xml | 17 ------ app/src/main/res/drawable/img_notexercise.xml | 55 ++++++++----------- 2 files changed, 24 insertions(+), 48 deletions(-) delete mode 100644 .idea/deploymentTargetDropDown.xml diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml deleted file mode 100644 index c32e3fc3..00000000 --- a/.idea/deploymentTargetDropDown.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/img_notexercise.xml b/app/src/main/res/drawable/img_notexercise.xml index 87c8c6c7..baf2250d 100644 --- a/app/src/main/res/drawable/img_notexercise.xml +++ b/app/src/main/res/drawable/img_notexercise.xml @@ -1,35 +1,28 @@ - - - - - - - - - - - - - - - - + + + + + + + From 4e8ee299e977b51dff804a0ff25bde649afaf175 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Tue, 19 Mar 2024 14:06:29 +0900 Subject: [PATCH 02/19] =?UTF-8?q?[feat]=20#117=20=EC=9A=B4=EB=8F=99=20?= =?UTF-8?q?=EB=B7=B0=20=EC=83=81=EB=8B=A8=20=EA=B7=B8=EB=A6=AC=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/drawable/background_exercise.xml | 8 + .../res/drawable/ic_bubble_exercising.xml | 15 ++ .../main/res/drawable/ic_bubble_success.xml | 15 ++ app/src/main/res/drawable/ic_child_left.xml | 55 +++++++ app/src/main/res/drawable/ic_parent_right.xml | 40 +++++ .../res/drawable/img_exercise_today_empty.xml | 18 +++ .../res/drawable/img_exercise_today_shoes.xml | 35 ++++ .../main/res/layout/item_exercise_notice.xml | 150 ++++++++++++------ app/src/main/res/values/strings.xml | 2 +- 9 files changed, 290 insertions(+), 48 deletions(-) create mode 100644 app/src/main/res/drawable/background_exercise.xml create mode 100644 app/src/main/res/drawable/ic_bubble_exercising.xml create mode 100644 app/src/main/res/drawable/ic_bubble_success.xml create mode 100644 app/src/main/res/drawable/ic_child_left.xml create mode 100644 app/src/main/res/drawable/ic_parent_right.xml create mode 100644 app/src/main/res/drawable/img_exercise_today_empty.xml create mode 100644 app/src/main/res/drawable/img_exercise_today_shoes.xml diff --git a/app/src/main/res/drawable/background_exercise.xml b/app/src/main/res/drawable/background_exercise.xml new file mode 100644 index 00000000..6f80bff4 --- /dev/null +++ b/app/src/main/res/drawable/background_exercise.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_bubble_exercising.xml b/app/src/main/res/drawable/ic_bubble_exercising.xml new file mode 100644 index 00000000..4e27db24 --- /dev/null +++ b/app/src/main/res/drawable/ic_bubble_exercising.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_bubble_success.xml b/app/src/main/res/drawable/ic_bubble_success.xml new file mode 100644 index 00000000..3ca6eb7b --- /dev/null +++ b/app/src/main/res/drawable/ic_bubble_success.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_child_left.xml b/app/src/main/res/drawable/ic_child_left.xml new file mode 100644 index 00000000..66ee2176 --- /dev/null +++ b/app/src/main/res/drawable/ic_child_left.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_parent_right.xml b/app/src/main/res/drawable/ic_parent_right.xml new file mode 100644 index 00000000..4f7d53a7 --- /dev/null +++ b/app/src/main/res/drawable/ic_parent_right.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/img_exercise_today_empty.xml b/app/src/main/res/drawable/img_exercise_today_empty.xml new file mode 100644 index 00000000..42bfc245 --- /dev/null +++ b/app/src/main/res/drawable/img_exercise_today_empty.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/app/src/main/res/drawable/img_exercise_today_shoes.xml b/app/src/main/res/drawable/img_exercise_today_shoes.xml new file mode 100644 index 00000000..7f437a12 --- /dev/null +++ b/app/src/main/res/drawable/img_exercise_today_shoes.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/item_exercise_notice.xml b/app/src/main/res/layout/item_exercise_notice.xml index 43f61ba5..fcb5653c 100644 --- a/app/src/main/res/layout/item_exercise_notice.xml +++ b/app/src/main/res/layout/item_exercise_notice.xml @@ -1,7 +1,6 @@ + + + + + app:layout_constraintEnd_toStartOf="@id/cl_exercise_today_right" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/tv_exercise_today_mission"> - + - + - + + + + + android:layout_marginEnd="16dp" + app:layout_constraintBottom_toBottomOf="@id/cl_exercise_today_left" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/cl_exercise_today_left" + app:layout_constraintTop_toTopOf="@id/cl_exercise_today_left"> + + + + + + + + + - + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 240a5076..005f2b09 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -147,7 +147,7 @@ 오늘의 운동 - 8천걸음 걷고 \n스쿼트 10번 하기 + 8천걸음 걷고 \n스탠딩 랫폴다운 20번 하기 운동 기록은 30일간 보관 후 사라져요! 2023년 12월 25일 월요일 다음 운동은\n꼭 성공해요! From 3ec95fc6132e02b766dd48d8a2548397f0e9cd35 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Tue, 19 Mar 2024 14:27:58 +0900 Subject: [PATCH 03/19] =?UTF-8?q?[mod]=20#117=20=EC=9A=B4=EB=8F=99=20?= =?UTF-8?q?=EB=B7=B0=20=EC=83=81=EB=8B=A8=20=EC=BA=90=EB=A6=AD=ED=84=B0=20?= =?UTF-8?q?=EC=95=84=EC=9D=B4=EC=BD=98=20=EC=82=AC=EC=9D=B4=EC=A6=88=20?= =?UTF-8?q?=EC=A1=B0=EC=A0=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/item_exercise_notice.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/layout/item_exercise_notice.xml b/app/src/main/res/layout/item_exercise_notice.xml index fcb5653c..e4d3ee3d 100644 --- a/app/src/main/res/layout/item_exercise_notice.xml +++ b/app/src/main/res/layout/item_exercise_notice.xml @@ -23,12 +23,12 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginHorizontal="-2dp" - android:layout_marginTop="44dp" + android:layout_marginTop="-97dp" android:adjustViewBounds="true" android:src="@drawable/img_exercise_today_shoes" app:layout_constraintEnd_toEndOf="@id/cl_exercise_today_right" app:layout_constraintStart_toStartOf="@id/cl_exercise_today_right" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="@id/cl_exercise_today_right" /> Date: Thu, 21 Mar 2024 18:01:32 +0900 Subject: [PATCH 04/19] =?UTF-8?q?[feat]=20#117=20=EC=9A=B4=EB=8F=99=20?= =?UTF-8?q?=EB=B7=B0=20=EC=83=81=EB=8B=A8=20=EC=98=A4=EB=8A=98=EC=9D=98=20?= =?UTF-8?q?=EC=9A=B4=EB=8F=99=20=EC=84=A0=ED=83=9D=ED=95=98=EB=9F=AC?= =?UTF-8?q?=EA=B0=80=EA=B8=B0=20=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/drawable/ic_small_arrow.xml | 13 +++++++ .../main/res/layout/item_exercise_notice.xml | 39 ++++++++++++++++++- app/src/main/res/values/strings.xml | 1 + 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 app/src/main/res/drawable/ic_small_arrow.xml diff --git a/app/src/main/res/drawable/ic_small_arrow.xml b/app/src/main/res/drawable/ic_small_arrow.xml new file mode 100644 index 00000000..62343bfa --- /dev/null +++ b/app/src/main/res/drawable/ic_small_arrow.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/layout/item_exercise_notice.xml b/app/src/main/res/layout/item_exercise_notice.xml index e4d3ee3d..5dca5bad 100644 --- a/app/src/main/res/layout/item_exercise_notice.xml +++ b/app/src/main/res/layout/item_exercise_notice.xml @@ -55,17 +55,52 @@ app:layout_constraintStart_toStartOf="@id/tv_exercise_today_exercise" app:layout_constraintTop_toBottomOf="@id/tv_exercise_today_exercise" /> + + + + + + + + + app:layout_constraintTop_toBottomOf="@id/tv_exercise_today_exercise"> 자녀 운동 아직 완료한 운동이 없어요\n운동하고 나만의 앨범을 만들어봐요! 오늘의 운동 하러가기 + 오늘의 운동 선택하러가기 잠시 연결이 불안정해요 From d6c6b8984c8046c5e56af5fdea381a4692aaabba Mon Sep 17 00:00:00 2001 From: hyunjium Date: Thu, 21 Mar 2024 18:20:04 +0900 Subject: [PATCH 05/19] =?UTF-8?q?[feat]=20#117=20'=EC=9A=B0=EB=A6=AC?= =?UTF-8?q?=EB=93=A4=EC=9D=98=20=EC=9A=B4=EB=8F=99=20=EA=B8=B0=EB=A1=9D=20?= =?UTF-8?q?=3F'=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/drawable/ic_question.xml | 18 +++++++++--------- .../main/res/layout/item_exercise_notice.xml | 14 ++++++++++++++ app/src/main/res/values/strings.xml | 1 + 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/app/src/main/res/drawable/ic_question.xml b/app/src/main/res/drawable/ic_question.xml index abc05253..103aaf7b 100644 --- a/app/src/main/res/drawable/ic_question.xml +++ b/app/src/main/res/drawable/ic_question.xml @@ -1,14 +1,14 @@ + android:width="20dp" + android:height="20dp" + android:viewportWidth="20" + android:viewportHeight="20"> + android:pathData="M9.011,12.981C9.026,11.019 9.626,10.418 10.637,9.803C11.245,9.437 11.707,8.851 11.707,8.03C11.707,7.034 10.93,6.397 9.963,6.404C9.128,6.397 8.286,6.895 8.206,8.104H6.873C6.946,6.324 8.286,5.291 9.963,5.291C11.802,5.291 12.996,6.47 12.996,8.089C12.996,9.239 12.454,10.037 11.545,10.594C10.63,11.15 10.3,11.714 10.271,12.981V13.055H9.011V12.981ZM8.748,15.179C8.733,14.666 9.172,14.241 9.685,14.241C10.205,14.241 10.63,14.666 10.623,15.179C10.63,15.699 10.205,16.124 9.685,16.131C9.172,16.124 8.733,15.699 8.748,15.179Z" + android:fillColor="#9D9EA0"/> + android:strokeColor="#9D9EA0"/> diff --git a/app/src/main/res/layout/item_exercise_notice.xml b/app/src/main/res/layout/item_exercise_notice.xml index 5dca5bad..10a7bb58 100644 --- a/app/src/main/res/layout/item_exercise_notice.xml +++ b/app/src/main/res/layout/item_exercise_notice.xml @@ -9,6 +9,20 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> + + 매칭이 끊어졌어요 매칭이 끊어져 모티부를 이용할 수 없어요\n탈퇴 후 다시 가입해주세요 잠시 연결이 불안정해요 + 우리들의 운동 기록 From 461b2cf3cbf7c90b068e26ceae8984ae8e3ffa45 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Thu, 21 Mar 2024 19:05:16 +0900 Subject: [PATCH 06/19] =?UTF-8?q?[feat]=20#117=20item=5Fexercise=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=B6=80=EB=B6=84=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../res/drawable/img_notexercise_white.xml | 28 +++++ .../drawable/img_success_next_exercise.xml | 23 ++++ app/src/main/res/layout/item_exercise.xml | 104 ++++-------------- .../main/res/layout/item_exercise_notice.xml | 4 + 4 files changed, 75 insertions(+), 84 deletions(-) create mode 100644 app/src/main/res/drawable/img_notexercise_white.xml create mode 100644 app/src/main/res/drawable/img_success_next_exercise.xml diff --git a/app/src/main/res/drawable/img_notexercise_white.xml b/app/src/main/res/drawable/img_notexercise_white.xml new file mode 100644 index 00000000..6d31a882 --- /dev/null +++ b/app/src/main/res/drawable/img_notexercise_white.xml @@ -0,0 +1,28 @@ + + + + + + + + + diff --git a/app/src/main/res/drawable/img_success_next_exercise.xml b/app/src/main/res/drawable/img_success_next_exercise.xml new file mode 100644 index 00000000..f537b486 --- /dev/null +++ b/app/src/main/res/drawable/img_success_next_exercise.xml @@ -0,0 +1,23 @@ + + + + + + + + diff --git a/app/src/main/res/layout/item_exercise.xml b/app/src/main/res/layout/item_exercise.xml index ff9d0fb6..2eedc175 100644 --- a/app/src/main/res/layout/item_exercise.xml +++ b/app/src/main/res/layout/item_exercise.xml @@ -19,94 +19,30 @@ app:layout_constraintTop_toTopOf="parent" tools:text="@string/exercise_date" /> - - - - - + app:layout_constraintTop_toBottomOf="@id/tv_item_exercise_date"/> - - - - - - - - - - - - - + app:layout_constraintStart_toEndOf="@id/iv_item_exercise_fail_exercise_left" + app:layout_constraintTop_toTopOf="@id/iv_item_exercise_fail_exercise_left"/> + Date: Thu, 21 Mar 2024 21:28:32 +0900 Subject: [PATCH 07/19] =?UTF-8?q?[feat]=20#117=20=EC=9A=B4=EB=8F=99=20?= =?UTF-8?q?=EB=B7=B0=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=B6=84=EA=B8=B0=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/response/ResponseExerciseDto.kt | 1 + .../exercise/ExerciseViewHolder.kt | 92 +++---------------- .../main/res/drawable/img_choose_exercise.xml | 20 ++++ app/src/main/res/layout/item_exercise.xml | 28 +++--- 4 files changed, 47 insertions(+), 94 deletions(-) create mode 100644 app/src/main/res/drawable/img_choose_exercise.xml diff --git a/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt b/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt index fad50396..fc45edd7 100644 --- a/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt +++ b/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt @@ -21,6 +21,7 @@ data class ResponseExerciseDto( @Serializable data class MissionContent( @SerialName("mission_content") val missionContent: String, + @SerialName("date") val date: String, ) @Serializable diff --git a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt index 1fd41e0c..6122589e 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt @@ -10,9 +10,6 @@ import sopt.motivoo.databinding.ItemExerciseBinding import sopt.motivoo.databinding.ItemExerciseNoticeBinding import sopt.motivoo.domain.entity.exercise.ExerciseData.ExerciseItemInfo import sopt.motivoo.presentation.exercise.ExerciseFragment.Companion.CHILD -import sopt.motivoo.util.extension.prettyString -import sopt.motivoo.util.extension.setVisible -import java.time.LocalDate class ExerciseEachDateInfoViewHolder(private val binding: ItemExerciseBinding) : RecyclerView.ViewHolder(binding.root) { @@ -21,9 +18,7 @@ class ExerciseEachDateInfoViewHolder(private val binding: ItemExerciseBinding) : val context = binding.root.context initText(exerciseItemInfoData, binding, userType) initImage(exerciseItemInfoData, binding) - imageVisibility(exerciseItemInfoData, binding) checkStatus(exerciseItemInfoData, binding, context) - compareDate(binding, context) } private fun initText( @@ -49,49 +44,29 @@ class ExerciseEachDateInfoViewHolder(private val binding: ItemExerciseBinding) : binding: ItemExerciseBinding, ) { with(binding) { - ivItemExerciseFinishLeft.load(exerciseItemInfoData.myMissionImgUrl) - if (exerciseItemInfoData.myMissionImgUrl == null) { - ivItemExerciseFinishLeft.visibility = View.GONE + if (exerciseItemInfoData.myMissionImgUrl != null) { + ivItemExerciseLeftImage.load(exerciseItemInfoData.myMissionImgUrl) + } else if (exerciseItemInfoData.myMissionStatus == "없음") { + ivItemExerciseLeftImage.setImageResource(R.drawable.img_choose_exercise) + } else { + ivItemExerciseLeftImage.setImageResource(R.drawable.img_success_next_exercise) } - if (exerciseItemInfoData.opponentMissionImgUrl == null) { - ivItemExerciseFinishRight.visibility = View.GONE + if (exerciseItemInfoData.opponentMissionImgUrl != null) { + ivItemExerciseRightImage.load(exerciseItemInfoData.opponentMissionImgUrl) + } else if (exerciseItemInfoData.opponentMissionStatus == "없음") { + ivItemExerciseRightImage.setImageResource(R.drawable.img_choose_exercise) + } else { + ivItemExerciseRightImage.setImageResource(R.drawable.img_success_next_exercise) } } } - private fun imageVisibility( - exerciseItemInfoData: ExerciseItemInfo.EachDateItemInfo, - binding: ItemExerciseBinding, - ) { - if (exerciseItemInfoData.myMissionImgUrl == null) { - binding.ivItemExerciseFinishLeft.setVisible(View.INVISIBLE) - binding.tvItemExerciseNoImageBeforeExerciseLeft.setVisible(View.VISIBLE) - } else { - binding.ivItemExerciseFinishLeft.setVisible(View.VISIBLE) - binding.tvItemExerciseNoImageBeforeExerciseLeft.setVisible(View.INVISIBLE) - } - if (exerciseItemInfoData.opponentMissionImgUrl == null) { - binding.ivItemExerciseFinishRight.setVisible(View.INVISIBLE) - binding.tvItemExerciseNoImageBeforeExerciseRight.setVisible(View.VISIBLE) - } else { - binding.ivItemExerciseFinishRight.setVisible(View.VISIBLE) - binding.tvItemExerciseNoImageBeforeExerciseRight.setVisible(View.INVISIBLE) - } - } - private fun checkStatus( exerciseItemInfoData: ExerciseItemInfo.EachDateItemInfo, binding: ItemExerciseBinding, context: Context, ) { when (exerciseItemInfoData.myMissionStatus) { - STATE_EXERCISING_TYPE -> { - binding.tvItemExerciseMyState.backgroundTintList = - ContextCompat.getColorStateList(context, R.color.pink_100_FFE6F5) - val textColorPink: Int = ContextCompat.getColor(context, R.color.pink_FF19A3) - binding.tvItemExerciseMyState.setTextColor(textColorPink) - } - STATE_SUCCESS_TYPE -> { binding.tvItemExerciseMyState.backgroundTintList = ContextCompat.getColorStateList(context, R.color.blue_100_D7F6FF) @@ -99,25 +74,11 @@ class ExerciseEachDateInfoViewHolder(private val binding: ItemExerciseBinding) : binding.tvItemExerciseMyState.setTextColor(textColorBlue) } - STATE_FAILURE_TYPE -> { - binding.tvItemExerciseMyState.backgroundTintList = - ContextCompat.getColorStateList(context, R.color.gray_300_D5D5D7) - val textColorGray: Int = ContextCompat.getColor(context, R.color.gray_700_464747) - binding.tvItemExerciseMyState.setTextColor(textColorGray) - } - else -> { binding.tvItemExerciseMyState.visibility = View.GONE } } when (exerciseItemInfoData.opponentMissionStatus) { - STATE_EXERCISING_TYPE -> { - binding.tvItemExerciseParentState.backgroundTintList = - ContextCompat.getColorStateList(context, R.color.pink_100_FFE6F5) - val textColorPink: Int = ContextCompat.getColor(context, R.color.pink_FF19A3) - binding.tvItemExerciseParentState.setTextColor(textColorPink) - } - STATE_SUCCESS_TYPE -> { binding.tvItemExerciseParentState.backgroundTintList = ContextCompat.getColorStateList(context, R.color.blue_100_D7F6FF) @@ -125,43 +86,14 @@ class ExerciseEachDateInfoViewHolder(private val binding: ItemExerciseBinding) : binding.tvItemExerciseParentState.setTextColor(textColorBlue) } - STATE_FAILURE_TYPE -> { - binding.tvItemExerciseParentState.backgroundTintList = - ContextCompat.getColorStateList(context, R.color.gray_300_D5D5D7) - val textColorGray: Int = ContextCompat.getColor(context, R.color.gray_700_464747) - binding.tvItemExerciseParentState.setTextColor(textColorGray) - } - else -> { binding.tvItemExerciseParentState.visibility = View.GONE } } } - private fun compareDate(binding: ItemExerciseBinding, context: Context) { - fun String.isToday(): Boolean = this == LocalDate.now().prettyString - fun String.removeDayOfTheWeek(): String = this.removeRange(length - 4 until length) - - if (binding.tvItemExerciseDate.text.toString().removeDayOfTheWeek().isToday()) { - binding.tvItemExerciseNoImageBeforeExerciseLeft.text = - context.getString(R.string.exercise_no_image_before_exercise_today) - binding.tvItemExerciseNoImageBeforeExerciseRight.text = - context.getString(R.string.exercise_no_image_before_exercise_today) - - binding.ivItemExerciseNoImageBeforeExerciseLeft.visibility = View.GONE - binding.ivItemExerciseNoImageBeforeExerciseRight.visibility = View.GONE - } else { - binding.tvItemExerciseNoImageBeforeExerciseLeft.text = - context.getString(R.string.exercise_no_image_before_exercise) - binding.tvItemExerciseNoImageBeforeExerciseRight.text = - context.getString(R.string.exercise_no_image_before_exercise) - } - } - companion object { - const val STATE_EXERCISING_TYPE = "진행중" const val STATE_SUCCESS_TYPE = "성공" - const val STATE_FAILURE_TYPE = "실패" } } diff --git a/app/src/main/res/drawable/img_choose_exercise.xml b/app/src/main/res/drawable/img_choose_exercise.xml new file mode 100644 index 00000000..6033dba7 --- /dev/null +++ b/app/src/main/res/drawable/img_choose_exercise.xml @@ -0,0 +1,20 @@ + + + + + + + diff --git a/app/src/main/res/layout/item_exercise.xml b/app/src/main/res/layout/item_exercise.xml index 2eedc175..858ac46b 100644 --- a/app/src/main/res/layout/item_exercise.xml +++ b/app/src/main/res/layout/item_exercise.xml @@ -20,29 +20,29 @@ tools:text="@string/exercise_date" /> + app:layout_constraintStart_toEndOf="@id/iv_item_exercise_left_image" + app:layout_constraintTop_toTopOf="@id/iv_item_exercise_left_image"/> Date: Thu, 21 Mar 2024 22:15:46 +0900 Subject: [PATCH 08/19] =?UTF-8?q?[feat]=20#117=20setClickEvents=20?= =?UTF-8?q?=ED=95=A8=EC=88=98=20=EC=9C=84=EC=B9=98=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/sopt/motivoo/presentation/exercise/ExerciseFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseFragment.kt b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseFragment.kt index 645bde72..b6e3c42b 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseFragment.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseFragment.kt @@ -24,7 +24,6 @@ class ExerciseFragment : BindingFragment(R.layout.fragm override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) exerciseViewModel.getExerciseHistoryInfo() - setClickEvents() observeLiveData() overrideOnBackPressed() } @@ -88,6 +87,7 @@ class ExerciseFragment : BindingFragment(R.layout.fragm binding.ivExerciseEmptyImg.visibility = if (isVisible) View.VISIBLE else View.GONE binding.tvExerciseEmptyContent.visibility = if (isVisible) View.VISIBLE else View.GONE binding.tvExerciseEmptyBtn.visibility = if (isVisible) View.VISIBLE else View.GONE + setClickEvents() } private fun initAdapter(exerciseData: ExerciseData) { From 2dec71dcb2324fc18fa685fe675644fc0d666f19 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Sun, 24 Mar 2024 12:57:40 +0900 Subject: [PATCH 09/19] =?UTF-8?q?[feat]=20#117=20=EC=9D=B8=EC=A6=9D?= =?UTF-8?q?=EC=82=AC=EC=A7=84=200=EA=B0=9C,=20=EC=9A=B4=EB=8F=99=EB=AF=B8?= =?UTF-8?q?=EC=85=98=EC=84=A0=ED=83=9Dx=20=ED=99=94=EB=A9=B4=20=EB=82=98?= =?UTF-8?q?=EC=98=A4=EB=8A=94=EA=B2=83=20=ED=99=95=EC=9D=B8,=20=EC=98=A4?= =?UTF-8?q?=EB=8A=98=20=EC=9A=B4=EB=8F=99=20=EB=AF=B8=EC=85=98=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=20=EC=95=88=ED=95=B4=EB=8F=84=20=EC=9A=B4=EB=8F=99=20?= =?UTF-8?q?=EB=B7=B0=20=EC=83=81=EB=8B=A8=20=EA=B7=B8=EB=A6=BC=20=EB=82=98?= =?UTF-8?q?=EC=98=A4=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/model/response/ResponseExerciseDto.kt | 13 ++++++++----- .../motivoo/domain/entity/exercise/ExerciseData.kt | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt b/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt index fc45edd7..ee3611cb 100644 --- a/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt +++ b/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt @@ -37,11 +37,14 @@ data class ResponseExerciseDto( } fun toExerciseData(): ExerciseData { - val list: MutableList = if (data.todayMission?.missionContent == null) { - mutableListOf() - } else { - mutableListOf(ExerciseItemInfo.NoticeItemInfo(data.todayMission?.missionContent)) - } + val list: MutableList = + if (data.todayMission?.missionContent == null && data.missionHistory?.isEmpty() == true) { + mutableListOf() + } else if (data.todayMission?.missionContent == null) { + mutableListOf(ExerciseItemInfo.NoticeItemInfo(null)) + } else { + mutableListOf(ExerciseItemInfo.NoticeItemInfo(data.todayMission?.missionContent)) + } data.missionHistory?.forEach { list.add( diff --git a/app/src/main/java/sopt/motivoo/domain/entity/exercise/ExerciseData.kt b/app/src/main/java/sopt/motivoo/domain/entity/exercise/ExerciseData.kt index 9f668de4..11fc4337 100644 --- a/app/src/main/java/sopt/motivoo/domain/entity/exercise/ExerciseData.kt +++ b/app/src/main/java/sopt/motivoo/domain/entity/exercise/ExerciseData.kt @@ -16,7 +16,7 @@ class ExerciseData( ) : ExerciseItemInfo() data class NoticeItemInfo( - val missionContent: String, + val missionContent: String?, ) : ExerciseItemInfo() } } From ac69774576dc7e28352c0ac7e1a160c65af531a5 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Sun, 24 Mar 2024 14:15:12 +0900 Subject: [PATCH 10/19] =?UTF-8?q?[feat]=20#117=20=EC=98=A4=EB=8A=98=20?= =?UTF-8?q?=EC=9A=B4=EB=8F=99=20=EB=AF=B8=EC=85=98=20=EC=84=A0=ED=83=9D=20?= =?UTF-8?q?=EC=A0=84,=20=ED=9B=84=20=EC=83=81=EB=8B=A8=20=EA=B8=80?= =?UTF-8?q?=EC=94=A8=20=EB=B0=8F=20=EB=B2=84=ED=8A=BC=20=EB=B6=84=EA=B8=B0?= =?UTF-8?q?=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/response/ResponseExerciseDto.kt | 4 +- .../exercise/ExerciseViewHolder.kt | 37 ++++++++++++++++++- app/src/main/res/layout/fragment_exercise.xml | 11 ++++++ app/src/main/res/values/strings.xml | 1 + 4 files changed, 50 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt b/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt index ee3611cb..fb28f0a5 100644 --- a/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt +++ b/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt @@ -38,9 +38,9 @@ data class ResponseExerciseDto( fun toExerciseData(): ExerciseData { val list: MutableList = - if (data.todayMission?.missionContent == null && data.missionHistory?.isEmpty() == true) { + if (data.todayMission == null && data.missionHistory?.isEmpty() == true) { mutableListOf() - } else if (data.todayMission?.missionContent == null) { + } else if (data.todayMission == null) { mutableListOf(ExerciseItemInfo.NoticeItemInfo(null)) } else { mutableListOf(ExerciseItemInfo.NoticeItemInfo(data.todayMission?.missionContent)) diff --git a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt index 6122589e..8597512b 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt @@ -3,6 +3,9 @@ package sopt.motivoo.presentation.exercise import android.content.Context import android.view.View import androidx.core.content.ContextCompat +import androidx.navigation.Navigation.findNavController +import androidx.navigation.findNavController +import androidx.navigation.fragment.findNavController import androidx.recyclerview.widget.RecyclerView import coil.load import sopt.motivoo.R @@ -100,6 +103,38 @@ class ExerciseEachDateInfoViewHolder(private val binding: ItemExerciseBinding) : class ExerciseNoticeViewHolder(private val binding: ItemExerciseNoticeBinding) : RecyclerView.ViewHolder(binding.root) { fun onBind(exerciseNoticeData: ExerciseItemInfo.NoticeItemInfo) { - binding.tvExerciseTodayMission.text = exerciseNoticeData.missionContent + val context = binding.root.context + if (exerciseNoticeData.missionContent == null) { + setTextNoMission(context) + } else { + setTextYesMission(context, exerciseNoticeData) + } + } + + private fun setTextNoMission(context: Context) { + with(binding) { + tvExerciseTodayExercise.text = + context.getString(R.string.exercise_please_select_today_mission) + clExerciseSelectTodayMission.visibility = View.VISIBLE + tvExerciseTodayMission.visibility = View.GONE + setClickEvents() + } + } + + private fun setClickEvents() { + binding.clExerciseSelectTodayMission.setOnClickListener { + it.findNavController().navigate(R.id.action_exerciseFragment_to_homeFragment) + } + } + + private fun setTextYesMission( + context: Context, + exerciseNoticeData: ExerciseItemInfo.NoticeItemInfo, + ) { + with(binding) { + tvExerciseTodayExercise.text = context.getString(R.string.exercise_today_exercise) + clExerciseSelectTodayMission.visibility = View.GONE + tvExerciseTodayMission.text = exerciseNoticeData.missionContent + } } } diff --git a/app/src/main/res/layout/fragment_exercise.xml b/app/src/main/res/layout/fragment_exercise.xml index bbe84719..9d317894 100644 --- a/app/src/main/res/layout/fragment_exercise.xml +++ b/app/src/main/res/layout/fragment_exercise.xml @@ -61,5 +61,16 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tv_exercise_empty_content" /> + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e1e2a159..b7458197 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -158,6 +158,7 @@ 아직 완료한 운동이 없어요\n운동하고 나만의 앨범을 만들어봐요! 오늘의 운동 하러가기 오늘의 운동 선택하러가기 + 오늘 할 운동을 선택하세요! 잠시 연결이 불안정해요 From 49beaeb986f58849a8f761b59bd950571f1f9f93 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Sun, 24 Mar 2024 14:28:30 +0900 Subject: [PATCH 11/19] =?UTF-8?q?[feat]=20#117=20=EC=98=A4=EB=8A=98=20?= =?UTF-8?q?=EC=9A=B4=EB=8F=99=20=EB=AF=B8=EC=85=98=20=EC=84=A0=ED=83=9D=20?= =?UTF-8?q?=EC=A0=84=20=EB=B2=84=EB=B8=94=20=EC=97=86=EC=95=A0=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt index 8597512b..fa2437af 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt @@ -3,9 +3,7 @@ package sopt.motivoo.presentation.exercise import android.content.Context import android.view.View import androidx.core.content.ContextCompat -import androidx.navigation.Navigation.findNavController import androidx.navigation.findNavController -import androidx.navigation.fragment.findNavController import androidx.recyclerview.widget.RecyclerView import coil.load import sopt.motivoo.R @@ -117,6 +115,8 @@ class ExerciseNoticeViewHolder(private val binding: ItemExerciseNoticeBinding) : context.getString(R.string.exercise_please_select_today_mission) clExerciseSelectTodayMission.visibility = View.VISIBLE tvExerciseTodayMission.visibility = View.GONE + ivExerciseTodayBubbleLeft.visibility = View.GONE + ivExerciseTodayBubbleRight.visibility = View.GONE setClickEvents() } } From 16eea684b89f38691fa75688dd16690943948aaa Mon Sep 17 00:00:00 2001 From: hyunjium Date: Sun, 24 Mar 2024 16:18:48 +0900 Subject: [PATCH 12/19] =?UTF-8?q?[feat]=20#117=20=EC=9A=B4=EB=8F=99=20?= =?UTF-8?q?=EB=B7=B0=20=EC=98=A4=EB=8A=98=20=EC=9A=B4=EB=8F=99=20=EC=82=AC?= =?UTF-8?q?=EC=A7=84,=20=EB=B2=84=EB=B8=94=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/exercise/ExerciseAdapter.kt | 5 ++- .../exercise/ExerciseViewHolder.kt | 44 ++++++++++++++++--- .../res/drawable/img_exercise_today_image.xml | 11 +++++ .../main/res/layout/item_exercise_notice.xml | 14 ++++++ 4 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 app/src/main/res/drawable/img_exercise_today_image.xml diff --git a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt index 721dc894..db794285 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt @@ -20,8 +20,9 @@ class ExerciseAdapter(private val userType: String) : } else -> { - val binding = ItemExerciseBinding.inflate(inflater, parent, false) - ExerciseEachDateInfoViewHolder(binding) + val bindingTop = ItemExerciseNoticeBinding.inflate(inflater, parent, false) + val bindingBottom = ItemExerciseBinding.inflate(inflater, parent, false) + ExerciseEachDateInfoViewHolder(bindingBottom, bindingTop) } } } diff --git a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt index fa2437af..1d297b29 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt @@ -1,6 +1,7 @@ package sopt.motivoo.presentation.exercise import android.content.Context +import android.util.Log import android.view.View import androidx.core.content.ContextCompat import androidx.navigation.findNavController @@ -11,15 +12,21 @@ import sopt.motivoo.databinding.ItemExerciseBinding import sopt.motivoo.databinding.ItemExerciseNoticeBinding import sopt.motivoo.domain.entity.exercise.ExerciseData.ExerciseItemInfo import sopt.motivoo.presentation.exercise.ExerciseFragment.Companion.CHILD +import sopt.motivoo.util.extension.prettyString +import java.time.LocalDate -class ExerciseEachDateInfoViewHolder(private val binding: ItemExerciseBinding) : - RecyclerView.ViewHolder(binding.root) { +class ExerciseEachDateInfoViewHolder( + private val bindingBottom: ItemExerciseBinding, + private val bindingTop: ItemExerciseNoticeBinding, +) : + RecyclerView.ViewHolder(bindingBottom.root) { fun onBind(exerciseItemInfoData: ExerciseItemInfo.EachDateItemInfo, userType: String) { - val context = binding.root.context - initText(exerciseItemInfoData, binding, userType) - initImage(exerciseItemInfoData, binding) - checkStatus(exerciseItemInfoData, binding, context) + val context = bindingBottom.root.context + initText(exerciseItemInfoData, bindingBottom, userType) + initImage(exerciseItemInfoData, bindingBottom) + checkStatus(exerciseItemInfoData, bindingBottom, context) + setTodayImageAndBubble(exerciseItemInfoData, bindingTop) } private fun initText( @@ -93,6 +100,31 @@ class ExerciseEachDateInfoViewHolder(private val binding: ItemExerciseBinding) : } } + private fun setTodayImageAndBubble( + exerciseItemInfoData: ExerciseItemInfo.EachDateItemInfo, + binding: ItemExerciseNoticeBinding, + ) { + fun String.removeDayOfTheWeek(): String = this.removeRange(length - 4 until length) + if (exerciseItemInfoData.date!!.removeDayOfTheWeek() == LocalDate.now().prettyString) { + if (exerciseItemInfoData.myMissionStatus == STATE_SUCCESS_TYPE) { + Log.d("check_test", "성공") + binding.ivExerciseTodayBubbleLeft.setImageResource(R.drawable.ic_bubble_success) + binding.ivExerciseTodayImageLeft.load(exerciseItemInfoData.myMissionImgUrl) + } else { + Log.d("check_test", "실패") + // 실패 상태인데 이미지 변경이 안되네요... + binding.ivExerciseTodayBubbleLeft.setImageResource(R.drawable.ic_bubble_exercising) + binding.ivExerciseTodayImageLeft.setImageResource(R.drawable.img_login_after) + } + if (exerciseItemInfoData.opponentMissionStatus == STATE_SUCCESS_TYPE) { + binding.ivExerciseTodayBubbleRight.setImageResource(R.drawable.ic_bubble_success) + binding.ivExerciseTodayImageRight.load(exerciseItemInfoData.opponentMissionImgUrl) + } else { + binding.ivExerciseTodayBubbleRight.setImageResource(R.drawable.ic_bubble_exercising) + } + } + } + companion object { const val STATE_SUCCESS_TYPE = "성공" } diff --git a/app/src/main/res/drawable/img_exercise_today_image.xml b/app/src/main/res/drawable/img_exercise_today_image.xml new file mode 100644 index 00000000..b10141ba --- /dev/null +++ b/app/src/main/res/drawable/img_exercise_today_image.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/layout/item_exercise_notice.xml b/app/src/main/res/layout/item_exercise_notice.xml index e7ecb39f..f94e6856 100644 --- a/app/src/main/res/layout/item_exercise_notice.xml +++ b/app/src/main/res/layout/item_exercise_notice.xml @@ -127,6 +127,13 @@ android:adjustViewBounds="true" android:src="@drawable/img_exercise_today_empty" /> + + + + Date: Sun, 24 Mar 2024 17:35:34 +0900 Subject: [PATCH 13/19] =?UTF-8?q?[feat]=20#117=20=EC=9D=B8=EC=A6=9D?= =?UTF-8?q?=EC=82=AC=EC=A7=84=200=EA=B0=9C,=20=EC=9A=B4=EB=8F=99=EB=AF=B8?= =?UTF-8?q?=EC=85=98=EC=84=A0=ED=83=9DO=20=ED=9E=88=EC=8A=A4=ED=86=A0?= =?UTF-8?q?=EB=A6=AC=20=EB=8C=80=EC=8B=A0=20=ED=8C=8C=EC=9D=BC=20=EB=82=98?= =?UTF-8?q?=EC=98=A4=EA=B2=8C=20=ED=95=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/exercise/ExerciseAdapter.kt | 2 +- .../exercise/ExerciseViewHolder.kt | 33 ++++++++++++++++--- app/src/main/res/layout/fragment_exercise.xml | 10 ------ app/src/main/res/layout/item_exercise.xml | 19 ++++++++--- 4 files changed, 45 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt index db794285..c65a2069 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt @@ -36,7 +36,7 @@ class ExerciseAdapter(private val userType: String) : is ExerciseEachDateInfoViewHolder -> { val dateExerciseInfo = exerciseItemInfoList[position] - holder.onBind(dateExerciseInfo as ExerciseItemInfo.EachDateItemInfo, userType) + holder.onBind(dateExerciseInfo as ExerciseItemInfo.EachDateItemInfo, userType, itemCount) } } } diff --git a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt index 1d297b29..858cd77f 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt @@ -21,14 +21,39 @@ class ExerciseEachDateInfoViewHolder( ) : RecyclerView.ViewHolder(bindingBottom.root) { - fun onBind(exerciseItemInfoData: ExerciseItemInfo.EachDateItemInfo, userType: String) { + fun onBind( + exerciseItemInfoData: ExerciseItemInfo.EachDateItemInfo, + userType: String, + itemSize: Int, + ) { val context = bindingBottom.root.context - initText(exerciseItemInfoData, bindingBottom, userType) - initImage(exerciseItemInfoData, bindingBottom) + Log.d("itemsize", itemSize.toString()) + setHistoryOrNot(exerciseItemInfoData, userType, itemSize) checkStatus(exerciseItemInfoData, bindingBottom, context) setTodayImageAndBubble(exerciseItemInfoData, bindingTop) } + private fun setHistoryOrNot( + exerciseItemInfoData: ExerciseItemInfo.EachDateItemInfo, + userType: String, + itemSize: Int, + ) { + with(bindingBottom) { + fun String.removeDayOfTheWeek(): String = this.removeRange(length - 4 until length) + if (itemSize == 2 && exerciseItemInfoData.date!!.removeDayOfTheWeek() == LocalDate.now().prettyString) { + ivExerciseEmptyHistory.visibility = View.VISIBLE + ivItemExerciseLeftImage.visibility = View.GONE + tvItemExerciseMyExercise.visibility = View.GONE + tvItemExerciseOpponentExercise.visibility = View.GONE + ivItemExerciseRightImage.visibility = View.GONE + } else { + ivExerciseEmptyHistory.visibility = View.GONE + initText(exerciseItemInfoData, bindingBottom, userType) + initImage(exerciseItemInfoData, bindingBottom) + } + } + } + private fun initText( exerciseItemInfoData: ExerciseItemInfo.EachDateItemInfo, binding: ItemExerciseBinding, @@ -40,7 +65,7 @@ class ExerciseEachDateInfoViewHolder( tvItemExerciseImgBottomTxtRight.text = exerciseItemInfoData.opponentMissionContent tvItemExerciseMyState.text = exerciseItemInfoData.myMissionStatus tvItemExerciseParentState.text = exerciseItemInfoData.opponentMissionStatus - tvItemExerciseParentExercise.text = + tvItemExerciseOpponentExercise.text = if (userType == CHILD) root.context.getString(R.string.exercise_parent_exercise) else root.context.getString( R.string.exercise_child_exercise ) diff --git a/app/src/main/res/layout/fragment_exercise.xml b/app/src/main/res/layout/fragment_exercise.xml index 9d317894..64251195 100644 --- a/app/src/main/res/layout/fragment_exercise.xml +++ b/app/src/main/res/layout/fragment_exercise.xml @@ -62,15 +62,5 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tv_exercise_empty_content" /> - \ No newline at end of file diff --git a/app/src/main/res/layout/item_exercise.xml b/app/src/main/res/layout/item_exercise.xml index 858ac46b..c396c863 100644 --- a/app/src/main/res/layout/item_exercise.xml +++ b/app/src/main/res/layout/item_exercise.xml @@ -104,7 +104,7 @@ tools:text="진행중" /> + + \ No newline at end of file From 775f4438967cd43f9387741dffe442d27f97a667 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Sun, 24 Mar 2024 17:50:16 +0900 Subject: [PATCH 14/19] =?UTF-8?q?[feat]=20#117=20=EC=98=A4=EB=8A=98=20?= =?UTF-8?q?=EB=AF=B8=EC=85=98=20=EC=9D=B8=EC=A6=9D=20=EC=82=AC=EC=A7=84=20?= =?UTF-8?q?=EC=B9=B8:=20=EB=B6=84=ED=99=8D=EC=83=89=20=EC=A4=84=20?= =?UTF-8?q?=EC=97=86=EB=8A=94=20=EC=9D=B4=EB=AF=B8=EC=A7=80=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/drawable/img_exercise_today_image.xml | 14 ++++++-------- app/src/main/res/layout/item_exercise_notice.xml | 2 ++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/res/drawable/img_exercise_today_image.xml b/app/src/main/res/drawable/img_exercise_today_image.xml index b10141ba..22cf4088 100644 --- a/app/src/main/res/drawable/img_exercise_today_image.xml +++ b/app/src/main/res/drawable/img_exercise_today_image.xml @@ -1,11 +1,9 @@ + android:width="159dp" + android:height="175dp" + android:viewportWidth="159" + android:viewportHeight="175"> + android:pathData="M8,0L151,0A8,8 0,0 1,159 8L159,167A8,8 0,0 1,151 175L8,175A8,8 0,0 1,0 167L0,8A8,8 0,0 1,8 0z" + android:fillColor="#ffffff"/> diff --git a/app/src/main/res/layout/item_exercise_notice.xml b/app/src/main/res/layout/item_exercise_notice.xml index f94e6856..43f3d374 100644 --- a/app/src/main/res/layout/item_exercise_notice.xml +++ b/app/src/main/res/layout/item_exercise_notice.xml @@ -131,6 +131,7 @@ android:id="@+id/iv_exercise_today_image_left" android:layout_width="match_parent" android:layout_height="match_parent" + android:padding="1dp" android:adjustViewBounds="true" android:src="@drawable/img_exercise_today_image"/> @@ -180,6 +181,7 @@ android:id="@+id/iv_exercise_today_image_right" android:layout_width="match_parent" android:layout_height="match_parent" + android:padding="1dp" android:adjustViewBounds="true" android:src="@drawable/img_exercise_today_image"/> From b1e6197100bf8e3e658182944437aeb34c9e96b6 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Sun, 24 Mar 2024 18:25:33 +0900 Subject: [PATCH 15/19] =?UTF-8?q?[feat]=20#117=20=EB=B6=80=EB=AA=A8,=20?= =?UTF-8?q?=EC=9E=90=EB=85=80=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EC=95=84?= =?UTF-8?q?=EC=9D=B4=EC=BD=98=20=EB=B6=84=EA=B8=B0=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/exercise/ExerciseAdapter.kt | 2 +- .../exercise/ExerciseViewHolder.kt | 17 +++++- app/src/main/res/drawable/ic_child_right.xml | 55 +++++++++++++++++++ app/src/main/res/drawable/ic_parent_left.xml | 40 ++++++++++++++ 4 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 app/src/main/res/drawable/ic_child_right.xml create mode 100644 app/src/main/res/drawable/ic_parent_left.xml diff --git a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt index c65a2069..dcda8d58 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt @@ -31,7 +31,7 @@ class ExerciseAdapter(private val userType: String) : when (holder) { is ExerciseNoticeViewHolder -> { val noticeInfo = exerciseItemInfoList[position] - holder.onBind(noticeInfo as ExerciseItemInfo.NoticeItemInfo) + holder.onBind(noticeInfo as ExerciseItemInfo.NoticeItemInfo, userType) } is ExerciseEachDateInfoViewHolder -> { diff --git a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt index 858cd77f..40402c6f 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt @@ -157,7 +157,22 @@ class ExerciseEachDateInfoViewHolder( class ExerciseNoticeViewHolder(private val binding: ItemExerciseNoticeBinding) : RecyclerView.ViewHolder(binding.root) { - fun onBind(exerciseNoticeData: ExerciseItemInfo.NoticeItemInfo) { + fun onBind(exerciseNoticeData: ExerciseItemInfo.NoticeItemInfo, userType: String) { + setCharacterIcon(userType) + setText(exerciseNoticeData) + } + + private fun setCharacterIcon(userType: String) { + if (userType == CHILD) { + binding.ivExerciseTodayIconLeft.setImageResource(R.drawable.ic_child_left) + binding.ivExerciseTodayIconRight.setImageResource(R.drawable.ic_parent_right) + } else { + binding.ivExerciseTodayIconLeft.setImageResource(R.drawable.ic_parent_left) + binding.ivExerciseTodayIconRight.setImageResource(R.drawable.ic_child_right) + } + } + + private fun setText(exerciseNoticeData: ExerciseItemInfo.NoticeItemInfo) { val context = binding.root.context if (exerciseNoticeData.missionContent == null) { setTextNoMission(context) diff --git a/app/src/main/res/drawable/ic_child_right.xml b/app/src/main/res/drawable/ic_child_right.xml new file mode 100644 index 00000000..9d7db45e --- /dev/null +++ b/app/src/main/res/drawable/ic_child_right.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_parent_left.xml b/app/src/main/res/drawable/ic_parent_left.xml new file mode 100644 index 00000000..391a1cec --- /dev/null +++ b/app/src/main/res/drawable/ic_parent_left.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + From c79dede473924171a6f287e3ed3a186384eafd3f Mon Sep 17 00:00:00 2001 From: hyunjium Date: Sun, 24 Mar 2024 19:10:35 +0900 Subject: [PATCH 16/19] =?UTF-8?q?[chore]=20#117=20=EC=95=84=EC=9D=B4?= =?UTF-8?q?=EC=BD=98=20=EC=9E=88=EB=8A=94=20=EC=83=81=EC=9E=90=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=EB=B0=91=EC=9C=BC=EB=A1=9C=20=EB=8D=94=20?= =?UTF-8?q?=EB=82=B4=EB=A6=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/item_exercise_notice.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/layout/item_exercise_notice.xml b/app/src/main/res/layout/item_exercise_notice.xml index 43f3d374..a7120e3d 100644 --- a/app/src/main/res/layout/item_exercise_notice.xml +++ b/app/src/main/res/layout/item_exercise_notice.xml @@ -113,7 +113,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="16dp" - android:layout_marginTop="78dp" + android:layout_marginTop="85dp" android:layout_marginBottom="20dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@id/cl_exercise_today_right" From d5779deb4ceaaf37d4c538a0d8867e9e41d831d1 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Mon, 25 Mar 2024 00:32:45 +0900 Subject: [PATCH 17/19] =?UTF-8?q?[feat]=20#117=20=EC=98=A4=EB=8A=98=20?= =?UTF-8?q?=EB=AF=B8=EC=85=98=20=EC=9A=B4=EB=8F=99=EC=A4=91,=20=EC=84=B1?= =?UTF-8?q?=EA=B3=B5=20=EB=B6=84=EA=B8=B0=EC=B2=98=EB=A6=AC=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C.=20=EA=B3=BC=EA=B1=B0=20=EB=82=A0=EC=A7=9C=EB=A7=8C?= =?UTF-8?q?=20history=EC=97=90=20=EB=82=98=EC=98=A4=EA=B2=8C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/response/ResponseExerciseDto.kt | 50 +++++++++++---- .../domain/entity/exercise/ExerciseData.kt | 6 ++ .../presentation/exercise/ExerciseAdapter.kt | 5 +- .../exercise/ExerciseViewHolder.kt | 63 +++++++++---------- .../res/drawable/img_exercise_today_shoes.xml | 4 +- 5 files changed, 75 insertions(+), 53 deletions(-) diff --git a/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt b/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt index fb28f0a5..d8775147 100644 --- a/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt +++ b/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt @@ -41,25 +41,49 @@ data class ResponseExerciseDto( if (data.todayMission == null && data.missionHistory?.isEmpty() == true) { mutableListOf() } else if (data.todayMission == null) { - mutableListOf(ExerciseItemInfo.NoticeItemInfo(null)) + mutableListOf( + ExerciseItemInfo.NoticeItemInfo( + null, + null, + null, + null, + null, + null, + null + ) + ) } else { - mutableListOf(ExerciseItemInfo.NoticeItemInfo(data.todayMission?.missionContent)) + mutableListOf( + ExerciseItemInfo.NoticeItemInfo( + data.todayMission?.missionContent, + data.missionHistory!![0].myMissionStatus, + data.missionHistory[0]!!.opponentMissionStatus, + data.todayMission.date, data.missionHistory[0]!!.date, + data.missionHistory[0]!!.myMissionImgUrl, + data.missionHistory[0]!!.opponentMissionImgUrl, + ) + ) } data.missionHistory?.forEach { - list.add( - ExerciseItemInfo.EachDateItemInfo( - date = it.date, - myMissionContent = it.myMissionContent, - myMissionImgUrl = it.myMissionImgUrl, - myMissionStatus = it.myMissionStatus, - opponentMissionContent = it.opponentMissionContent, - opponentMissionImgUrl = it.opponentMissionImgUrl, - opponentMissionStatus = it.opponentMissionStatus + if (it.date != data.todayMission!!.date) { + list.add( + ExerciseItemInfo.EachDateItemInfo( + date = it.date, + myMissionContent = it.myMissionContent, + myMissionImgUrl = it.myMissionImgUrl, + myMissionStatus = it.myMissionStatus, + opponentMissionContent = it.opponentMissionContent, + opponentMissionImgUrl = it.opponentMissionImgUrl, + opponentMissionStatus = it.opponentMissionStatus + ) ) - ) - } + } + + } return ExerciseData(data.userType, list) } } + + diff --git a/app/src/main/java/sopt/motivoo/domain/entity/exercise/ExerciseData.kt b/app/src/main/java/sopt/motivoo/domain/entity/exercise/ExerciseData.kt index 11fc4337..6dc3e5da 100644 --- a/app/src/main/java/sopt/motivoo/domain/entity/exercise/ExerciseData.kt +++ b/app/src/main/java/sopt/motivoo/domain/entity/exercise/ExerciseData.kt @@ -17,6 +17,12 @@ class ExerciseData( data class NoticeItemInfo( val missionContent: String?, + val myMissionStatus: String?, + val opponentMissionStatus: String?, + val todayDate: String?, + val missionDate: String?, + val myMissionImgUrl: String?, + val opponentMissionImgUrl: String?, ) : ExerciseItemInfo() } } diff --git a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt index dcda8d58..61cf6437 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt @@ -20,9 +20,8 @@ class ExerciseAdapter(private val userType: String) : } else -> { - val bindingTop = ItemExerciseNoticeBinding.inflate(inflater, parent, false) - val bindingBottom = ItemExerciseBinding.inflate(inflater, parent, false) - ExerciseEachDateInfoViewHolder(bindingBottom, bindingTop) + val binding = ItemExerciseBinding.inflate(inflater, parent, false) + ExerciseEachDateInfoViewHolder(binding) } } } diff --git a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt index 40402c6f..c823c0be 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt @@ -16,21 +16,16 @@ import sopt.motivoo.util.extension.prettyString import java.time.LocalDate class ExerciseEachDateInfoViewHolder( - private val bindingBottom: ItemExerciseBinding, - private val bindingTop: ItemExerciseNoticeBinding, + private val binding: ItemExerciseBinding, ) : - RecyclerView.ViewHolder(bindingBottom.root) { + RecyclerView.ViewHolder(binding.root) { fun onBind( exerciseItemInfoData: ExerciseItemInfo.EachDateItemInfo, userType: String, itemSize: Int, ) { - val context = bindingBottom.root.context - Log.d("itemsize", itemSize.toString()) setHistoryOrNot(exerciseItemInfoData, userType, itemSize) - checkStatus(exerciseItemInfoData, bindingBottom, context) - setTodayImageAndBubble(exerciseItemInfoData, bindingTop) } private fun setHistoryOrNot( @@ -38,7 +33,7 @@ class ExerciseEachDateInfoViewHolder( userType: String, itemSize: Int, ) { - with(bindingBottom) { + with(binding) { fun String.removeDayOfTheWeek(): String = this.removeRange(length - 4 until length) if (itemSize == 2 && exerciseItemInfoData.date!!.removeDayOfTheWeek() == LocalDate.now().prettyString) { ivExerciseEmptyHistory.visibility = View.VISIBLE @@ -48,8 +43,10 @@ class ExerciseEachDateInfoViewHolder( ivItemExerciseRightImage.visibility = View.GONE } else { ivExerciseEmptyHistory.visibility = View.GONE - initText(exerciseItemInfoData, bindingBottom, userType) - initImage(exerciseItemInfoData, bindingBottom) + initText(exerciseItemInfoData, binding, userType) + initImage(exerciseItemInfoData, binding) + val context = binding.root.context + checkStatus(exerciseItemInfoData, binding, context) } } } @@ -125,31 +122,6 @@ class ExerciseEachDateInfoViewHolder( } } - private fun setTodayImageAndBubble( - exerciseItemInfoData: ExerciseItemInfo.EachDateItemInfo, - binding: ItemExerciseNoticeBinding, - ) { - fun String.removeDayOfTheWeek(): String = this.removeRange(length - 4 until length) - if (exerciseItemInfoData.date!!.removeDayOfTheWeek() == LocalDate.now().prettyString) { - if (exerciseItemInfoData.myMissionStatus == STATE_SUCCESS_TYPE) { - Log.d("check_test", "성공") - binding.ivExerciseTodayBubbleLeft.setImageResource(R.drawable.ic_bubble_success) - binding.ivExerciseTodayImageLeft.load(exerciseItemInfoData.myMissionImgUrl) - } else { - Log.d("check_test", "실패") - // 실패 상태인데 이미지 변경이 안되네요... - binding.ivExerciseTodayBubbleLeft.setImageResource(R.drawable.ic_bubble_exercising) - binding.ivExerciseTodayImageLeft.setImageResource(R.drawable.img_login_after) - } - if (exerciseItemInfoData.opponentMissionStatus == STATE_SUCCESS_TYPE) { - binding.ivExerciseTodayBubbleRight.setImageResource(R.drawable.ic_bubble_success) - binding.ivExerciseTodayImageRight.load(exerciseItemInfoData.opponentMissionImgUrl) - } else { - binding.ivExerciseTodayBubbleRight.setImageResource(R.drawable.ic_bubble_exercising) - } - } - } - companion object { const val STATE_SUCCESS_TYPE = "성공" } @@ -208,5 +180,26 @@ class ExerciseNoticeViewHolder(private val binding: ItemExerciseNoticeBinding) : clExerciseSelectTodayMission.visibility = View.GONE tvExerciseTodayMission.text = exerciseNoticeData.missionContent } + setTodayImageAndBubble(exerciseNoticeData) + } + + private fun setTodayImageAndBubble( + exerciseNoticeData: ExerciseItemInfo.NoticeItemInfo, + ) { + if (exerciseNoticeData.missionDate == exerciseNoticeData.todayDate) { + if (exerciseNoticeData.myMissionStatus == ExerciseEachDateInfoViewHolder.STATE_SUCCESS_TYPE) { + binding.ivExerciseTodayBubbleLeft.setImageResource(R.drawable.ic_bubble_success) + binding.ivExerciseTodayImageLeft.load(exerciseNoticeData.myMissionImgUrl) + } else { + binding.ivExerciseTodayBubbleLeft.setImageResource(R.drawable.ic_bubble_exercising) + binding.ivExerciseTodayImageLeft.setImageResource(R.drawable.img_unconnection) + } + if (exerciseNoticeData.opponentMissionStatus == ExerciseEachDateInfoViewHolder.STATE_SUCCESS_TYPE) { + binding.ivExerciseTodayBubbleRight.setImageResource(R.drawable.ic_bubble_success) + binding.ivExerciseTodayImageRight.load(exerciseNoticeData.opponentMissionImgUrl) + } else { + binding.ivExerciseTodayBubbleRight.setImageResource(R.drawable.ic_bubble_exercising) + } + } } } diff --git a/app/src/main/res/drawable/img_exercise_today_shoes.xml b/app/src/main/res/drawable/img_exercise_today_shoes.xml index 7f437a12..2206cdfe 100644 --- a/app/src/main/res/drawable/img_exercise_today_shoes.xml +++ b/app/src/main/res/drawable/img_exercise_today_shoes.xml @@ -25,11 +25,11 @@ From e846c4dde1568b54974d882e320c340debcf35e1 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Mon, 25 Mar 2024 00:42:59 +0900 Subject: [PATCH 18/19] =?UTF-8?q?[del]=20#117=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=ED=85=8C=EC=8A=A4=ED=8A=B8=EC=9A=A9=20=EC=BD=94?= =?UTF-8?q?=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 --- .../sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt index c823c0be..d2d1a34c 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt @@ -192,7 +192,7 @@ class ExerciseNoticeViewHolder(private val binding: ItemExerciseNoticeBinding) : binding.ivExerciseTodayImageLeft.load(exerciseNoticeData.myMissionImgUrl) } else { binding.ivExerciseTodayBubbleLeft.setImageResource(R.drawable.ic_bubble_exercising) - binding.ivExerciseTodayImageLeft.setImageResource(R.drawable.img_unconnection) + binding.ivExerciseTodayImageLeft.setImageResource(R.drawable.img_notexercise) } if (exerciseNoticeData.opponentMissionStatus == ExerciseEachDateInfoViewHolder.STATE_SUCCESS_TYPE) { binding.ivExerciseTodayBubbleRight.setImageResource(R.drawable.ic_bubble_success) From 40a812ccf0fe32c80c2cab98858535d0e071b93e Mon Sep 17 00:00:00 2001 From: hyunjium Date: Mon, 25 Mar 2024 01:37:28 +0900 Subject: [PATCH 19/19] =?UTF-8?q?[feat]=20#117=20=ED=9E=88=EC=8A=A4?= =?UTF-8?q?=ED=86=A0=EB=A6=AC=20=EC=A0=9C=EB=8C=80=EB=A1=9C=20=EB=82=98?= =?UTF-8?q?=EC=98=A4=EA=B2=8C=20=EC=88=98=EC=A0=95,=20=EC=95=84=EC=9D=B4?= =?UTF-8?q?=EC=BD=98=20=EC=82=AC=EC=9D=B4=EC=A6=88=20=EB=A7=9E=EA=B2=8C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/model/response/ResponseExerciseDto.kt | 9 ++++----- .../presentation/exercise/ExerciseViewHolder.kt | 2 -- app/src/main/res/layout/item_exercise_notice.xml | 14 ++++++-------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt b/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt index d8775147..7744e48b 100644 --- a/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt +++ b/app/src/main/java/sopt/motivoo/data/model/response/ResponseExerciseDto.kt @@ -4,6 +4,8 @@ import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import sopt.motivoo.domain.entity.exercise.ExerciseData import sopt.motivoo.domain.entity.exercise.ExerciseData.ExerciseItemInfo +import sopt.motivoo.util.extension.prettyString +import java.time.LocalDate @Serializable data class ResponseExerciseDto( @@ -66,7 +68,8 @@ data class ResponseExerciseDto( } data.missionHistory?.forEach { - if (it.date != data.todayMission!!.date) { + fun String.removeDayOfTheWeek(): String = this.removeRange(length - 4 until length) + if (it.date.removeDayOfTheWeek() != LocalDate.now().prettyString) { list.add( ExerciseItemInfo.EachDateItemInfo( date = it.date, @@ -78,12 +81,8 @@ data class ResponseExerciseDto( opponentMissionStatus = it.opponentMissionStatus ) ) - } - } return ExerciseData(data.userType, list) } } - - diff --git a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt index d2d1a34c..4952ab4e 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt @@ -1,7 +1,6 @@ package sopt.motivoo.presentation.exercise import android.content.Context -import android.util.Log import android.view.View import androidx.core.content.ContextCompat import androidx.navigation.findNavController @@ -192,7 +191,6 @@ class ExerciseNoticeViewHolder(private val binding: ItemExerciseNoticeBinding) : binding.ivExerciseTodayImageLeft.load(exerciseNoticeData.myMissionImgUrl) } else { binding.ivExerciseTodayBubbleLeft.setImageResource(R.drawable.ic_bubble_exercising) - binding.ivExerciseTodayImageLeft.setImageResource(R.drawable.img_notexercise) } if (exerciseNoticeData.opponentMissionStatus == ExerciseEachDateInfoViewHolder.STATE_SUCCESS_TYPE) { binding.ivExerciseTodayBubbleRight.setImageResource(R.drawable.ic_bubble_success) diff --git a/app/src/main/res/layout/item_exercise_notice.xml b/app/src/main/res/layout/item_exercise_notice.xml index a7120e3d..cc8084d6 100644 --- a/app/src/main/res/layout/item_exercise_notice.xml +++ b/app/src/main/res/layout/item_exercise_notice.xml @@ -131,19 +131,18 @@ android:id="@+id/iv_exercise_today_image_left" android:layout_width="match_parent" android:layout_height="match_parent" - android:padding="1dp" android:adjustViewBounds="true" - android:src="@drawable/img_exercise_today_image"/> + android:padding="1dp" + android:src="@drawable/img_exercise_today_image" /> @@ -181,19 +180,18 @@ android:id="@+id/iv_exercise_today_image_right" android:layout_width="match_parent" android:layout_height="match_parent" - android:padding="1dp" android:adjustViewBounds="true" - android:src="@drawable/img_exercise_today_image"/> + android:padding="1dp" + android:src="@drawable/img_exercise_today_image" />