From 05f47c326681c7b43e470e1805c423effb825883 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Thu, 28 Mar 2024 00:13:11 +0900 Subject: [PATCH 01/22] Revert "Merge branch 'feat/#117-change-exercise' into develop" This reverts commit f803442e3349e1a0d67ab10d64cee163396d3612, reversing changes made to 908b8bdf5af348498620e74f719506c49ba5a454. --- .../motivoo/presentation/home/HomeFragment.kt | 50 +++++++++---------- .../home/viewmodel/HomeViewModel.kt | 2 +- app/src/main/res/layout/bottom_sheet_home.xml | 2 +- app/src/main/res/layout/dialog_home_photo.xml | 2 +- app/src/main/res/layout/fragment_home.xml | 21 ++++++-- app/src/main/res/values/colors.xml | 1 - app/src/main/res/values/strings.xml | 2 + 7 files changed, 47 insertions(+), 33 deletions(-) diff --git a/app/src/main/java/sopt/motivoo/presentation/home/HomeFragment.kt b/app/src/main/java/sopt/motivoo/presentation/home/HomeFragment.kt index 94db467b..82695f79 100644 --- a/app/src/main/java/sopt/motivoo/presentation/home/HomeFragment.kt +++ b/app/src/main/java/sopt/motivoo/presentation/home/HomeFragment.kt @@ -12,6 +12,7 @@ import android.provider.Settings import android.transition.TransitionManager import android.view.View import android.view.ViewGroup +import android.widget.Toast import androidx.activity.OnBackPressedCallback import androidx.activity.result.contract.ActivityResultContracts import androidx.core.content.ContextCompat @@ -37,9 +38,8 @@ import timber.log.Timber @AndroidEntryPoint class HomeFragment : BindingFragment(R.layout.fragment_home) { + private var isCreated = false private val viewModel: HomeViewModel by activityViewModels() - val alarmManager = context?.getSystemService(Context.ALARM_SERVICE) as AlarmManager - private val requestHomePermissionRequest = registerForActivityResult( ActivityResultContracts.RequestMultiplePermissions() @@ -47,33 +47,15 @@ class HomeFragment : BindingFragment(R.layout.fragment_home var permissionGranted = true var educationGranted = false permissions.entries.forEach { - if (it.key in Manifest.permission.POST_NOTIFICATIONS && it.value == false) { - permissionGranted = false - } - if (it.key in Manifest.permission.ACTIVITY_RECOGNITION && it.value == false) { + if (it.key in HOME_REQUIRED_PERMISSIONS && it.value == false) { permissionGranted = false } - - if (!shouldShowRequestPermissionRationale(Manifest.permission.POST_NOTIFICATIONS) && it.value == false) { + if (!shouldShowRequestPermissionRationale(it.key) && it.value == false) { educationGranted = true } - if (!shouldShowRequestPermissionRationale(Manifest.permission.ACTIVITY_RECOGNITION) && it.value == false) { - educationGranted = true - } - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { - if (!alarmManager.canScheduleExactAlarms()) { - permissionGranted = false - educationGranted = false - } else { - permissionGranted = true - educationGranted = true - } - } } - if (!permissionGranted) { - if (educationGranted && viewModel.isMissionChoiceFinished.value == true) intentAppSettings() // TODO :: 교육용 팝업 + if (educationGranted) intentAppSettings() // TODO :: 교육용 팝업 else permissionDenied() } else { permissionGranted() @@ -82,6 +64,7 @@ class HomeFragment : BindingFragment(R.layout.fragment_home override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + isCreated = true binding.vm = viewModel backPressed() @@ -185,13 +168,14 @@ class HomeFragment : BindingFragment(R.layout.fragment_home } private fun checkPermissionIfUnSelectedMission() { - if (viewModel.isMissionChoiceFinished.value != true) { + if (viewModel.isMissionChoiceFinished.value == false) { requestHomePermissionRequest.launch(HOME_REQUIRED_PERMISSIONS) } } private fun checkHomeAlarmPermission(homeState: HomeState.FetchHomeData) { if (checkPermission()) { + val alarmManager = context?.getSystemService(Context.ALARM_SERVICE) as AlarmManager if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { if (!alarmManager.canScheduleExactAlarms()) { requireContext().showSnackbar( @@ -248,6 +232,16 @@ class HomeFragment : BindingFragment(R.layout.fragment_home } } + override fun onResume() { + super.onResume() + if (isCreated) { + isCreated = false + } else { + initHomePermissionsState() + viewModel.postMissionTodayChoice() + } + } + private fun initHomePermissionsState() { checkPermission().also { if (it) permissionGranted() @@ -262,6 +256,11 @@ class HomeFragment : BindingFragment(R.layout.fragment_home } private fun permissionDenied() { + Toast.makeText( + requireContext(), + "Permission request denied", + Toast.LENGTH_SHORT + ).show() updateBlurEffect() viewModel.isPermissionGranted.value = false } @@ -276,6 +275,7 @@ class HomeFragment : BindingFragment(R.layout.fragment_home binding.motivooOtherPieChart.updateBlurEffect() binding.ivMissionCompleted.updateBlurEffect() binding.ivStepCount.updateBlurEffect() + binding.tvExercisePercent.updateBlurEffect() } private fun removeBlurEffect() { @@ -283,6 +283,7 @@ class HomeFragment : BindingFragment(R.layout.fragment_home binding.motivooOtherPieChart.removeBlurEffect() binding.ivMissionCompleted.removeBlurEffect() binding.ivStepCount.removeBlurEffect() + binding.tvExercisePercent.removeBlurEffect() } private fun navigateToExerciseMethodNotion() { @@ -336,7 +337,6 @@ class HomeFragment : BindingFragment(R.layout.fragment_home } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { add(Manifest.permission.POST_NOTIFICATIONS) - add(Manifest.permission.SCHEDULE_EXACT_ALARM) } }.toTypedArray() } diff --git a/app/src/main/java/sopt/motivoo/presentation/home/viewmodel/HomeViewModel.kt b/app/src/main/java/sopt/motivoo/presentation/home/viewmodel/HomeViewModel.kt index 595905df..58299a19 100644 --- a/app/src/main/java/sopt/motivoo/presentation/home/viewmodel/HomeViewModel.kt +++ b/app/src/main/java/sopt/motivoo/presentation/home/viewmodel/HomeViewModel.kt @@ -38,7 +38,7 @@ class HomeViewModel @Inject constructor( val userType = MutableLiveData() val anotherUserType = MutableLiveData() val isPermissionGranted = MutableLiveData() - val isMissionChoiceFinished = MutableLiveData() + val isMissionChoiceFinished = MutableLiveData(false) val isCompletedStepCount = MutableLiveData() val isCompletedMission = MutableLiveData() val isHighFive = MutableLiveData() diff --git a/app/src/main/res/layout/bottom_sheet_home.xml b/app/src/main/res/layout/bottom_sheet_home.xml index 25ce3ffd..bf9e5248 100644 --- a/app/src/main/res/layout/bottom_sheet_home.xml +++ b/app/src/main/res/layout/bottom_sheet_home.xml @@ -87,7 +87,7 @@ android:id="@+id/pv_loading" android:layout_width="0dp" android:layout_height="0dp" - android:background="@color/white_FFFFFF4d" + android:background="@color/gray_600_7072764d" android:padding="150dp" android:visibility="invisible" app:layout_constraintBottom_toBottomOf="parent" diff --git a/app/src/main/res/layout/dialog_home_photo.xml b/app/src/main/res/layout/dialog_home_photo.xml index 320dfa86..63811024 100644 --- a/app/src/main/res/layout/dialog_home_photo.xml +++ b/app/src/main/res/layout/dialog_home_photo.xml @@ -35,7 +35,7 @@ android:id="@+id/pv_loading" android:layout_width="0dp" android:layout_height="0dp" - android:background="@color/white_FFFFFF4d" + android:background="@color/gray_600_7072764d" android:padding="150dp" android:visibility="invisible" app:layout_constraintBottom_toBottomOf="parent" diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 47988237..30281d62 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -166,6 +166,19 @@ app:layout_constraintTop_toTopOf="@id/motivoo_my_pie_chart" app:layout_constraintVertical_bias="0.3" /> + + @@ -237,7 +250,7 @@ android:visibility="@{vm.isPermissionGranted() ? View.GONE : View.VISIBLE}" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/iv_step_count" + app:layout_constraintTop_toBottomOf="@id/tv_exercise_percent" tools:visibility="invisible" /> @@ -245,7 +258,7 @@ android:id="@+id/pv_loading" android:layout_width="0dp" android:layout_height="0dp" - android:background="@color/white_FFFFFF4d" + android:background="@color/gray_600_7072764d" android:padding="150dp" android:visibility="invisible" app:layout_constraintBottom_toBottomOf="parent" diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index d7748263..401d517d 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -2,7 +2,6 @@ #090909 #FFFFFF - #4dFFFFFF #FF19A3 #FFE6F5 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0256b466..ca5e4ae0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -66,12 +66,14 @@ 자녀 걸음 오늘의 운동 운동 방법 + 운동 달성률 운동 인증하기 운동 완료 사진 찍기 앨범에서 선택하기 자녀 부모 + 하이파이브 성공! 운동 인증이 완료되었어요! 오늘도 멋지게 운동을 해내셨군요 motivoo_logo From bbde544daa82e90a3533e4888a4eb029e8c50999 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Thu, 28 Mar 2024 02:16:45 +0900 Subject: [PATCH 02/22] =?UTF-8?q?[feat]=20#117=201.=20=ED=9E=88=EC=8A=A4?= =?UTF-8?q?=ED=86=A0=EB=A6=AC=EB=9E=91=20=EC=98=A4=EB=8A=98=20=EB=AF=B8?= =?UTF-8?q?=EC=85=98=20=EB=91=98=20=EB=8B=A4=20=EC=97=86=EC=9D=84=20?= =?UTF-8?q?=EB=95=8C=20=EB=B9=A8=EA=B0=84=EC=83=89=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=EB=82=98=EC=98=A4=EA=B2=8C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=202.=20=ED=9E=88=EC=8A=A4=ED=86=A0=EB=A6=AC=EB=8A=94?= =?UTF-8?q?=20=EC=97=86=EA=B3=A0=20=EC=98=A4=EB=8A=98=20=EB=AF=B8=EC=85=98?= =?UTF-8?q?=20=EC=9E=88=EC=9D=84=20=EB=95=8C=20=EC=9A=B4=EB=8F=99=20?= =?UTF-8?q?=EB=B7=B0=20=EC=95=84=EB=9E=98=EC=AA=BD=EC=97=90=20=ED=9D=B0?= =?UTF-8?q?=EC=83=89=20=ED=8C=8C=EC=9D=BC=20=EB=82=98=EC=98=A4=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 --- app/src/main/AndroidManifest.xml | 2 +- .../model/response/ResponseExerciseDto.kt | 4 +- .../presentation/exercise/ExerciseAdapter.kt | 11 ++-- .../exercise/ExerciseViewHolder.kt | 50 ++++++++--------- app/src/main/res/layout/item_exercise.xml | 12 ---- ...ise_notice.xml => item_exercise_today.xml} | 56 ++++++++++--------- 6 files changed, 63 insertions(+), 72 deletions(-) rename app/src/main/res/layout/{item_exercise_notice.xml => item_exercise_today.xml} (91%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 61121899..8ca43f9a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -51,7 +51,7 @@ + android:foregroundServiceType="health|dataSync" /> = - if (data.todayMission == null && data.missionHistory?.isEmpty() == true) { + if (data.todayMission == null && data.missionHistory?.size!! < 2) { mutableListOf() } else if (data.todayMission == null) { mutableListOf( @@ -68,7 +69,6 @@ data class ResponseExerciseDto( } data.missionHistory?.forEach { - fun String.removeDayOfTheWeek(): String = this.removeRange(length - 4 until length) if (it.date.removeDayOfTheWeek() != LocalDate.now().prettyString) { list.add( ExerciseItemInfo.EachDateItemInfo( 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 61cf6437..aa09776e 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt @@ -4,7 +4,7 @@ import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import sopt.motivoo.databinding.ItemExerciseBinding -import sopt.motivoo.databinding.ItemExerciseNoticeBinding +import sopt.motivoo.databinding.ItemExerciseTodayBinding import sopt.motivoo.domain.entity.exercise.ExerciseData.ExerciseItemInfo class ExerciseAdapter(private val userType: String) : @@ -15,7 +15,7 @@ class ExerciseAdapter(private val userType: String) : val inflater = LayoutInflater.from(parent.context) return when (viewType) { NOTICE_INFO_TYPE -> { - val binding = ItemExerciseNoticeBinding.inflate(inflater, parent, false) + val binding = ItemExerciseTodayBinding.inflate(inflater, parent, false) ExerciseNoticeViewHolder(binding) } @@ -30,12 +30,15 @@ class ExerciseAdapter(private val userType: String) : when (holder) { is ExerciseNoticeViewHolder -> { val noticeInfo = exerciseItemInfoList[position] - holder.onBind(noticeInfo as ExerciseItemInfo.NoticeItemInfo, userType) + holder.onBind(noticeInfo as ExerciseItemInfo.NoticeItemInfo, userType, itemCount) } is ExerciseEachDateInfoViewHolder -> { val dateExerciseInfo = exerciseItemInfoList[position] - holder.onBind(dateExerciseInfo as ExerciseItemInfo.EachDateItemInfo, userType, itemCount) + holder.onBind( + dateExerciseInfo as ExerciseItemInfo.EachDateItemInfo, + userType + ) } } } 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 4952ab4e..4ecdf0ce 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt @@ -8,11 +8,9 @@ import androidx.recyclerview.widget.RecyclerView import coil.load import sopt.motivoo.R import sopt.motivoo.databinding.ItemExerciseBinding -import sopt.motivoo.databinding.ItemExerciseNoticeBinding +import sopt.motivoo.databinding.ItemExerciseTodayBinding 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, @@ -21,33 +19,22 @@ class ExerciseEachDateInfoViewHolder( fun onBind( exerciseItemInfoData: ExerciseItemInfo.EachDateItemInfo, - userType: String, - itemSize: Int, + userType: String ) { - setHistoryOrNot(exerciseItemInfoData, userType, itemSize) + setHistory(exerciseItemInfoData, userType) } - private fun setHistoryOrNot( + private fun setHistory( exerciseItemInfoData: ExerciseItemInfo.EachDateItemInfo, - userType: String, - itemSize: Int, + userType: String ) { 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 - ivItemExerciseLeftImage.visibility = View.GONE - tvItemExerciseMyExercise.visibility = View.GONE - tvItemExerciseOpponentExercise.visibility = View.GONE - ivItemExerciseRightImage.visibility = View.GONE - } else { - ivExerciseEmptyHistory.visibility = View.GONE - initText(exerciseItemInfoData, binding, userType) - initImage(exerciseItemInfoData, binding) - val context = binding.root.context - checkStatus(exerciseItemInfoData, binding, context) - } + initText(exerciseItemInfoData, binding, userType) + initImage(exerciseItemInfoData, binding) + val context = binding.root.context + checkStatus(exerciseItemInfoData, binding, context) } + } private fun initText( @@ -126,11 +113,12 @@ class ExerciseEachDateInfoViewHolder( } } -class ExerciseNoticeViewHolder(private val binding: ItemExerciseNoticeBinding) : +class ExerciseNoticeViewHolder(private val binding: ItemExerciseTodayBinding) : RecyclerView.ViewHolder(binding.root) { - fun onBind(exerciseNoticeData: ExerciseItemInfo.NoticeItemInfo, userType: String) { + fun onBind(exerciseNoticeData: ExerciseItemInfo.NoticeItemInfo, userType: String, itemCount: Int) { setCharacterIcon(userType) setText(exerciseNoticeData) + setEmptyHistory(itemCount) } private fun setCharacterIcon(userType: String) { @@ -156,7 +144,7 @@ class ExerciseNoticeViewHolder(private val binding: ItemExerciseNoticeBinding) : with(binding) { tvExerciseTodayExercise.text = context.getString(R.string.exercise_please_select_today_mission) - clExerciseSelectTodayMission.visibility = View.VISIBLE + clExerciseTodaySelectTodayMission.visibility = View.VISIBLE tvExerciseTodayMission.visibility = View.GONE ivExerciseTodayBubbleLeft.visibility = View.GONE ivExerciseTodayBubbleRight.visibility = View.GONE @@ -165,7 +153,7 @@ class ExerciseNoticeViewHolder(private val binding: ItemExerciseNoticeBinding) : } private fun setClickEvents() { - binding.clExerciseSelectTodayMission.setOnClickListener { + binding.clExerciseTodaySelectTodayMission.setOnClickListener { it.findNavController().navigate(R.id.action_exerciseFragment_to_homeFragment) } } @@ -176,7 +164,7 @@ class ExerciseNoticeViewHolder(private val binding: ItemExerciseNoticeBinding) : ) { with(binding) { tvExerciseTodayExercise.text = context.getString(R.string.exercise_today_exercise) - clExerciseSelectTodayMission.visibility = View.GONE + clExerciseTodaySelectTodayMission.visibility = View.GONE tvExerciseTodayMission.text = exerciseNoticeData.missionContent } setTodayImageAndBubble(exerciseNoticeData) @@ -200,4 +188,10 @@ class ExerciseNoticeViewHolder(private val binding: ItemExerciseNoticeBinding) : } } } + + private fun setEmptyHistory(itemCount: Int) { + if (itemCount >= 2) { + binding.ivExerciseTodayEmptyHistory.visibility = View.GONE + } + } } diff --git a/app/src/main/res/layout/item_exercise.xml b/app/src/main/res/layout/item_exercise.xml index c396c863..fd45d119 100644 --- a/app/src/main/res/layout/item_exercise.xml +++ b/app/src/main/res/layout/item_exercise.xml @@ -134,16 +134,4 @@ app:layout_constraintTop_toTopOf="@id/tv_item_exercise_opponent_exercise" tools:text="성공" /> - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_exercise_notice.xml b/app/src/main/res/layout/item_exercise_today.xml similarity index 91% rename from app/src/main/res/layout/item_exercise_notice.xml rename to app/src/main/res/layout/item_exercise_today.xml index cc8084d6..6d303ca9 100644 --- a/app/src/main/res/layout/item_exercise_notice.xml +++ b/app/src/main/res/layout/item_exercise_today.xml @@ -9,24 +9,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> - - - + app:layout_constraintBottom_toBottomOf="@id/tv_exercise_today_select_today_mission" + app:layout_constraintStart_toEndOf="@id/tv_exercise_today_select_today_mission" + app:layout_constraintTop_toTopOf="@id/tv_exercise_today_select_today_mission" /> @@ -206,11 +189,34 @@ app:layout_constraintStart_toStartOf="parent" /> - - + + From ad67a49bbcde478dff3f1bd27ee56e1c13da8bad Mon Sep 17 00:00:00 2001 From: hyunjium Date: Thu, 28 Mar 2024 05:26:49 +0900 Subject: [PATCH 03/22] =?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?=EB=82=98=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 --- .../main/res/layout/item_exercise_today.xml | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/app/src/main/res/layout/item_exercise_today.xml b/app/src/main/res/layout/item_exercise_today.xml index 6d303ca9..933911cd 100644 --- a/app/src/main/res/layout/item_exercise_today.xml +++ b/app/src/main/res/layout/item_exercise_today.xml @@ -112,11 +112,14 @@ + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_marginHorizontal="1dp" + android:layout_marginTop="1dp" + app:layout_constraintDimensionRatio="1:1.101" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_marginHorizontal="1dp" + android:layout_marginTop="1dp" + app:layout_constraintDimensionRatio="1:1.101" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> Date: Thu, 28 Mar 2024 05:39:41 +0900 Subject: [PATCH 04/22] =?UTF-8?q?[chore]=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?=EB=B9=84=EC=9C=A8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/item_exercise_today.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/item_exercise_today.xml b/app/src/main/res/layout/item_exercise_today.xml index 933911cd..48267bf1 100644 --- a/app/src/main/res/layout/item_exercise_today.xml +++ b/app/src/main/res/layout/item_exercise_today.xml @@ -116,7 +116,7 @@ android:layout_height="0dp" android:layout_marginHorizontal="1dp" android:layout_marginTop="1dp" - app:layout_constraintDimensionRatio="1:1.101" + app:layout_constraintDimensionRatio="1:1.1006" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -168,7 +168,7 @@ android:layout_height="0dp" android:layout_marginHorizontal="1dp" android:layout_marginTop="1dp" - app:layout_constraintDimensionRatio="1:1.101" + app:layout_constraintDimensionRatio="1:1.1006" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> From adcc8db9429cd6c183b25949ceabe54f685beb44 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Wed, 3 Apr 2024 17:44:49 +0900 Subject: [PATCH 05/22] =?UTF-8?q?[mod]=20#139=20=EC=9A=B4=EB=8F=99=20?= =?UTF-8?q?=EB=B7=B0=20=EC=98=A4=EB=8A=98=20=EB=AF=B8=EC=85=98,=20?= =?UTF-8?q?=ED=9E=88=EC=8A=A4=ED=86=A0=EB=A6=AC=20=EB=91=98=20=EB=8B=A4=20?= =?UTF-8?q?=EB=82=98=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 --- .../sopt/motivoo/data/model/response/ResponseExerciseDto.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 aafa0d49..40363cdb 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,7 +41,7 @@ data class ResponseExerciseDto( fun toExerciseData(): ExerciseData { fun String.removeDayOfTheWeek(): String = this.removeRange(length - 4 until length) val list: MutableList = - if (data.todayMission == null && data.missionHistory?.size!! < 2) { + if (data.todayMission == null && data.missionHistory?.size!! < 1) { mutableListOf() } else if (data.todayMission == null) { mutableListOf( From 2591806688753a92e0bad8538bdd7e5f2397ef2d Mon Sep 17 00:00:00 2001 From: hyunjium Date: Wed, 3 Apr 2024 18:20:15 +0900 Subject: [PATCH 06/22] =?UTF-8?q?[mod]=20#139=20=EC=8B=A0=EB=B0=9C=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=ED=88=AC=EB=AA=85=EB=8F=84=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0=ED=95=9C=20=EC=9D=B4=EB=AF=B8=EC=A7=80?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../drawable/img_exercise_notice_bubble.xml | 22 ++++++++ .../res/drawable/img_exercise_today_shoes.xml | 51 +++++++------------ .../main/res/layout/item_exercise_today.xml | 8 +-- 3 files changed, 42 insertions(+), 39 deletions(-) create mode 100644 app/src/main/res/drawable/img_exercise_notice_bubble.xml diff --git a/app/src/main/res/drawable/img_exercise_notice_bubble.xml b/app/src/main/res/drawable/img_exercise_notice_bubble.xml new file mode 100644 index 00000000..14d9dfff --- /dev/null +++ b/app/src/main/res/drawable/img_exercise_notice_bubble.xml @@ -0,0 +1,22 @@ + + + + + + + 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 2206cdfe..b0e57744 100644 --- a/app/src/main/res/drawable/img_exercise_today_shoes.xml +++ b/app/src/main/res/drawable/img_exercise_today_shoes.xml @@ -1,35 +1,20 @@ - - - - - - - - - - - + android:width="176dp" + android:height="188dp" + android:viewportWidth="176" + android:viewportHeight="188"> + + + + + + diff --git a/app/src/main/res/layout/item_exercise_today.xml b/app/src/main/res/layout/item_exercise_today.xml index 48267bf1..c6fc64c9 100644 --- a/app/src/main/res/layout/item_exercise_today.xml +++ b/app/src/main/res/layout/item_exercise_today.xml @@ -22,13 +22,9 @@ android:id="@+id/iv_exercise_today_shoes" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginHorizontal="-2dp" - 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="@id/cl_exercise_today_right" /> + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" /> Date: Wed, 3 Apr 2024 18:58:29 +0900 Subject: [PATCH 07/22] =?UTF-8?q?[mod]=20#139=20=EC=83=81=EB=8C=80?= =?UTF-8?q?=EB=B0=A9=EC=97=90=20=EB=A7=9E=EC=B6=B0=EC=84=9C=20=EC=95=84?= =?UTF-8?q?=EC=9D=B4=EC=BD=98=20=EC=84=A4=EC=A0=95,=20=EB=B2=84=EB=B8=94?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/response/ResponseExerciseDto.kt | 3 +- .../domain/entity/exercise/ExerciseData.kt | 1 + .../presentation/exercise/ExerciseAdapter.kt | 12 ++++-- .../presentation/exercise/ExerciseFragment.kt | 2 +- .../exercise/ExerciseViewHolder.kt | 38 ++++++++++--------- .../drawable/img_exercise_notice_bubble.xml | 22 ----------- 6 files changed, 33 insertions(+), 45 deletions(-) delete mode 100644 app/src/main/res/drawable/img_exercise_notice_bubble.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 40363cdb..c1fa3628 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 @@ -17,6 +17,7 @@ data class ResponseExerciseDto( @Serializable data class ExerciseHistoryData( @SerialName("user_type") val userType: String, + @SerialName("opponent_user_type") val opponentUserType: String, @SerialName("today_mission") val todayMission: MissionContent?, @SerialName("mission_history") val missionHistory: List?, ) { @@ -83,6 +84,6 @@ data class ResponseExerciseDto( ) } } - return ExerciseData(data.userType, list) + return ExerciseData(data.userType, data.opponentUserType, 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 6dc3e5da..d765be48 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 @@ -2,6 +2,7 @@ package sopt.motivoo.domain.entity.exercise class ExerciseData( val userType: String, + val opponentUserType: String, val exerciseItemInfoList: List, ) { sealed class 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 aa09776e..89e420a2 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseAdapter.kt @@ -7,7 +7,7 @@ import sopt.motivoo.databinding.ItemExerciseBinding import sopt.motivoo.databinding.ItemExerciseTodayBinding import sopt.motivoo.domain.entity.exercise.ExerciseData.ExerciseItemInfo -class ExerciseAdapter(private val userType: String) : +class ExerciseAdapter(private val userType: String, private val opponentUserType: String) : RecyclerView.Adapter() { private var exerciseItemInfoList: List = emptyList() @@ -30,14 +30,18 @@ class ExerciseAdapter(private val userType: String) : when (holder) { is ExerciseNoticeViewHolder -> { val noticeInfo = exerciseItemInfoList[position] - holder.onBind(noticeInfo as ExerciseItemInfo.NoticeItemInfo, userType, itemCount) + holder.onBind( + noticeInfo as ExerciseItemInfo.NoticeItemInfo, + userType, + opponentUserType, + itemCount + ) } is ExerciseEachDateInfoViewHolder -> { val dateExerciseInfo = exerciseItemInfoList[position] holder.onBind( - dateExerciseInfo as ExerciseItemInfo.EachDateItemInfo, - userType + dateExerciseInfo as ExerciseItemInfo.EachDateItemInfo, opponentUserType ) } } 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 25505834..598ebd43 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseFragment.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseFragment.kt @@ -92,7 +92,7 @@ class ExerciseFragment : BindingFragment(R.layout.fragm } private fun initAdapter(exerciseData: ExerciseData) { - val adapter = ExerciseAdapter(userType = exerciseData.userType) + val adapter = ExerciseAdapter(userType = exerciseData.userType, opponentUserType= exerciseData.opponentUserType) adapter.updateItemList(exerciseList = exerciseData.exerciseItemInfoList) binding.rvExerciseEachDateExercise.adapter = adapter } 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 4ecdf0ce..858bb15e 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt @@ -19,17 +19,17 @@ class ExerciseEachDateInfoViewHolder( fun onBind( exerciseItemInfoData: ExerciseItemInfo.EachDateItemInfo, - userType: String + opponentUserType: String, ) { - setHistory(exerciseItemInfoData, userType) + setHistory(exerciseItemInfoData, opponentUserType) } private fun setHistory( exerciseItemInfoData: ExerciseItemInfo.EachDateItemInfo, - userType: String + opponentUserType: String, ) { with(binding) { - initText(exerciseItemInfoData, binding, userType) + initText(exerciseItemInfoData, binding, opponentUserType) initImage(exerciseItemInfoData, binding) val context = binding.root.context checkStatus(exerciseItemInfoData, binding, context) @@ -40,7 +40,7 @@ class ExerciseEachDateInfoViewHolder( private fun initText( exerciseItemInfoData: ExerciseItemInfo.EachDateItemInfo, binding: ItemExerciseBinding, - userType: String, + opponentUserType: String, ) { with(binding) { tvItemExerciseDate.text = exerciseItemInfoData.date @@ -49,8 +49,8 @@ class ExerciseEachDateInfoViewHolder( tvItemExerciseMyState.text = exerciseItemInfoData.myMissionStatus tvItemExerciseParentState.text = exerciseItemInfoData.opponentMissionStatus tvItemExerciseOpponentExercise.text = - if (userType == CHILD) root.context.getString(R.string.exercise_parent_exercise) else root.context.getString( - R.string.exercise_child_exercise + if (opponentUserType == CHILD) root.context.getString(R.string.exercise_child_exercise) else root.context.getString( + R.string.exercise_parent_exercise ) } } @@ -115,20 +115,24 @@ class ExerciseEachDateInfoViewHolder( class ExerciseNoticeViewHolder(private val binding: ItemExerciseTodayBinding) : RecyclerView.ViewHolder(binding.root) { - fun onBind(exerciseNoticeData: ExerciseItemInfo.NoticeItemInfo, userType: String, itemCount: Int) { - setCharacterIcon(userType) + fun onBind( + exerciseNoticeData: ExerciseItemInfo.NoticeItemInfo, + userType: String, + opponentUserType: String, + itemCount: Int, + ) { + setCharacterIcon(userType, opponentUserType) setText(exerciseNoticeData) setEmptyHistory(itemCount) } - 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 setCharacterIcon(userType: String, opponentUserType: String) { + if (userType == CHILD) binding.ivExerciseTodayIconLeft.setImageResource(R.drawable.ic_child_left) else binding.ivExerciseTodayIconLeft.setImageResource( + R.drawable.ic_parent_left + ) + if (opponentUserType == CHILD) binding.ivExerciseTodayIconRight.setImageResource(R.drawable.ic_child_right) else binding.ivExerciseTodayIconRight.setImageResource( + R.drawable.ic_parent_right + ) } private fun setText(exerciseNoticeData: ExerciseItemInfo.NoticeItemInfo) { diff --git a/app/src/main/res/drawable/img_exercise_notice_bubble.xml b/app/src/main/res/drawable/img_exercise_notice_bubble.xml deleted file mode 100644 index 14d9dfff..00000000 --- a/app/src/main/res/drawable/img_exercise_notice_bubble.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - From 5d6a3984dafb491c958190613d1a2092d688ea37 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Wed, 3 Apr 2024 19:08:06 +0900 Subject: [PATCH 08/22] =?UTF-8?q?[mod]=20#139=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=EC=A7=A7=EC=9D=80=20=EC=AA=BD=20=EA=B8=B0=EC=A4=80?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=83=81=EC=9E=90=20=EA=BD=89=EC=B0=A8?= =?UTF-8?q?=EA=B2=8C=20=EC=B6=9C=EB=A0=A5=EB=90=98=EB=8F=84=EB=A1=9D=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 --- app/src/main/res/layout/item_exercise.xml | 12 +++++++----- app/src/main/res/layout/item_exercise_today.xml | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/layout/item_exercise.xml b/app/src/main/res/layout/item_exercise.xml index fd45d119..760021f6 100644 --- a/app/src/main/res/layout/item_exercise.xml +++ b/app/src/main/res/layout/item_exercise.xml @@ -22,27 +22,29 @@ + app:layout_constraintTop_toBottomOf="@id/tv_item_exercise_date" /> + app:layout_constraintTop_toTopOf="@id/iv_item_exercise_left_image" /> Date: Wed, 3 Apr 2024 19:41:42 +0900 Subject: [PATCH 09/22] =?UTF-8?q?[mod]=20#139=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=EB=AA=A8=EC=84=9C=EB=A6=AC=20=EB=91=A5=EA=B8=80?= =?UTF-8?q?=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 --- app/src/main/res/layout/item_exercise.xml | 4 ++++ app/src/main/res/layout/item_exercise_today.xml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/src/main/res/layout/item_exercise.xml b/app/src/main/res/layout/item_exercise.xml index 760021f6..eefe3f65 100644 --- a/app/src/main/res/layout/item_exercise.xml +++ b/app/src/main/res/layout/item_exercise.xml @@ -25,6 +25,8 @@ android:layout_height="0dp" android:layout_marginStart="16dp" android:layout_marginTop="8dp" + android:background="@drawable/shape_rectangle_radius8" + android:clipToOutline="true" android:scaleType="centerCrop" android:src="@drawable/img_success_next_exercise" app:layout_constraintDimensionRatio="1" @@ -38,6 +40,8 @@ android:layout_height="0dp" android:layout_marginStart="8dp" android:layout_marginEnd="16dp" + android:background="@drawable/shape_rectangle_radius8" + android:clipToOutline="true" android:scaleType="centerCrop" android:src="@drawable/img_success_next_exercise" app:layout_constraintBottom_toBottomOf="@id/iv_item_exercise_left_image" diff --git a/app/src/main/res/layout/item_exercise_today.xml b/app/src/main/res/layout/item_exercise_today.xml index 79060918..0f103adb 100644 --- a/app/src/main/res/layout/item_exercise_today.xml +++ b/app/src/main/res/layout/item_exercise_today.xml @@ -112,6 +112,8 @@ android:layout_height="0dp" android:layout_marginHorizontal="1dp" android:layout_marginTop="1dp" + android:background="@drawable/shape_rectangle_radius8" + android:clipToOutline="true" android:scaleType="centerCrop" app:layout_constraintDimensionRatio="1:1.1006" app:layout_constraintEnd_toEndOf="parent" @@ -165,6 +167,8 @@ android:layout_height="0dp" android:layout_marginHorizontal="1dp" android:layout_marginTop="1dp" + android:background="@drawable/shape_rectangle_radius8" + android:clipToOutline="true" android:scaleType="centerCrop" app:layout_constraintDimensionRatio="1:1.1006" app:layout_constraintEnd_toEndOf="parent" From bba903a1b1db6d39f11a938160356a3b19e2b6b2 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Wed, 3 Apr 2024 20:02:55 +0900 Subject: [PATCH 10/22] =?UTF-8?q?[chore]=20#139=20=EC=9A=B4=EB=8F=99?= =?UTF-8?q?=EC=A4=91=20=EB=B2=84=EB=B8=94=20=EB=B3=80=EA=B2=BD(=EB=94=94?= =?UTF-8?q?=EC=9E=90=EC=9D=B8=ED=8C=80=20=EC=83=89=20=EC=88=98=EC=A0=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/drawable/ic_bubble_exercising.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/drawable/ic_bubble_exercising.xml b/app/src/main/res/drawable/ic_bubble_exercising.xml index 4e27db24..a784a9bf 100644 --- a/app/src/main/res/drawable/ic_bubble_exercising.xml +++ b/app/src/main/res/drawable/ic_bubble_exercising.xml @@ -5,11 +5,11 @@ android:viewportHeight="34"> + android:fillColor="#F4F5F9"/> + android:fillColor="#F4F5F9"/> From 2ac639f82657d1d8c9892ca13600387abf907d54 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Wed, 3 Apr 2024 23:50:15 +0900 Subject: [PATCH 11/22] =?UTF-8?q?[chore]=20#139=20=EB=AC=BC=EC=9D=8C?= =?UTF-8?q?=ED=91=9C=20textview=EB=9E=91=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/item_exercise_today.xml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/item_exercise_today.xml b/app/src/main/res/layout/item_exercise_today.xml index 0f103adb..99dcbf58 100644 --- a/app/src/main/res/layout/item_exercise_today.xml +++ b/app/src/main/res/layout/item_exercise_today.xml @@ -207,8 +207,6 @@ android:layout_marginStart="20dp" android:layout_marginTop="32dp" android:layout_marginBottom="8dp" - android:drawableEnd="@drawable/ic_question" - android:drawablePadding="8dp" android:paddingVertical="5dp" android:text="@string/exercise_our_exercise_history" android:textColor="@color/gray_900_161616" @@ -216,6 +214,16 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/cl_exercise_today" /> + + Date: Thu, 4 Apr 2024 00:36:18 +0900 Subject: [PATCH 12/22] =?UTF-8?q?[feat]=20#139=20=EC=98=A4=EB=8A=98=20?= =?UTF-8?q?=EB=AF=B8=EC=85=98=EC=9D=B4=EB=9E=91=20=ED=9E=88=EC=8A=A4?= =?UTF-8?q?=ED=86=A0=EB=A6=AC=20=EB=91=98=20=EB=8B=A4=20=EC=97=86=EC=9D=84?= =?UTF-8?q?=20=EB=95=8C,=20=EB=B9=A8=EA=B0=84=EC=83=89=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=ED=99=94=EB=A9=B4=20=EB=82=98=EC=98=A4=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 --- .../motivoo/data/model/response/ResponseExerciseDto.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 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 c1fa3628..864e9c2d 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 @@ -42,9 +42,12 @@ data class ResponseExerciseDto( fun toExerciseData(): ExerciseData { fun String.removeDayOfTheWeek(): String = this.removeRange(length - 4 until length) val list: MutableList = - if (data.todayMission == null && data.missionHistory?.size!! < 1) { + if (data.todayMission == null && data.missionHistory!!.isEmpty()) { mutableListOf() - } else if (data.todayMission == null) { + } else if (data.todayMission == null && data.missionHistory!!.size == 1 && data.missionHistory[0].date.removeDayOfTheWeek() == LocalDate.now().prettyString) { + mutableListOf() + } + else if (data.todayMission == null) { mutableListOf( ExerciseItemInfo.NoticeItemInfo( null, From 10fe16b32d6b22302d530052b78d7eb01f11b707 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Thu, 4 Apr 2024 00:51:46 +0900 Subject: [PATCH 13/22] =?UTF-8?q?[chore]=20#139=20=EB=B9=88=EC=B9=B8=20?= =?UTF-8?q?=EC=A7=80=EC=9B=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sopt/motivoo/data/model/response/ResponseExerciseDto.kt | 3 +-- .../sopt/motivoo/presentation/exercise/ExerciseFragment.kt | 5 ++++- 2 files changed, 5 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 864e9c2d..c7358450 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 @@ -46,8 +46,7 @@ data class ResponseExerciseDto( mutableListOf() } else if (data.todayMission == null && data.missionHistory!!.size == 1 && data.missionHistory[0].date.removeDayOfTheWeek() == LocalDate.now().prettyString) { mutableListOf() - } - else if (data.todayMission == null) { + } else if (data.todayMission == null) { mutableListOf( ExerciseItemInfo.NoticeItemInfo( null, 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 598ebd43..559fafaf 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseFragment.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseFragment.kt @@ -92,7 +92,10 @@ class ExerciseFragment : BindingFragment(R.layout.fragm } private fun initAdapter(exerciseData: ExerciseData) { - val adapter = ExerciseAdapter(userType = exerciseData.userType, opponentUserType= exerciseData.opponentUserType) + val adapter = ExerciseAdapter( + userType = exerciseData.userType, + opponentUserType = exerciseData.opponentUserType + ) adapter.updateItemList(exerciseList = exerciseData.exerciseItemInfoList) binding.rvExerciseEachDateExercise.adapter = adapter } From 0c5e094b9259b6da609ba9453ca4d3a80893dad7 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Thu, 4 Apr 2024 00:56:48 +0900 Subject: [PATCH 14/22] =?UTF-8?q?[chore]=20#139=20=EB=B9=88=EC=B9=B8=20?= =?UTF-8?q?=EC=A7=80=EC=9B=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt | 1 - 1 file changed, 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 858bb15e..7029b1dd 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt @@ -34,7 +34,6 @@ class ExerciseEachDateInfoViewHolder( val context = binding.root.context checkStatus(exerciseItemInfoData, binding, context) } - } private fun initText( From 4e9529c204959a65553c3e49be21a63e813f3a61 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Thu, 4 Apr 2024 01:26:03 +0900 Subject: [PATCH 15/22] =?UTF-8?q?[chore]=20#139=20red=2050=20=EC=83=89=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 --- app/src/main/res/drawable/background_exercise.xml | 2 +- app/src/main/res/values/colors.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/drawable/background_exercise.xml b/app/src/main/res/drawable/background_exercise.xml index 6f80bff4..7a4e2a40 100644 --- a/app/src/main/res/drawable/background_exercise.xml +++ b/app/src/main/res/drawable/background_exercise.xml @@ -4,5 +4,5 @@ - + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 401d517d..f19bebfd 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -5,7 +5,7 @@ #FF19A3 #FFE6F5 - #FFEDEC + #FFF4F2 #FFCBC8 #FFA8A4 #FF847E From f49362d8f383c239f26382ea277659379f77e5c7 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Thu, 4 Apr 2024 02:24:35 +0900 Subject: [PATCH 16/22] =?UTF-8?q?[chore]=20#139=20=EB=AC=BC=EC=9D=8C?= =?UTF-8?q?=ED=91=9C=20padding=20=EA=B0=92=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/item_exercise_today.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/layout/item_exercise_today.xml b/app/src/main/res/layout/item_exercise_today.xml index 99dcbf58..4301a22e 100644 --- a/app/src/main/res/layout/item_exercise_today.xml +++ b/app/src/main/res/layout/item_exercise_today.xml @@ -218,7 +218,7 @@ android:id="@+id/iv_exercise_today_icon_question" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginStart="8dp" + android:padding="8dp" android:src="@drawable/ic_question" app:layout_constraintBottom_toBottomOf="@id/tv_exercise_today_our_history" app:layout_constraintStart_toEndOf="@id/tv_exercise_today_our_history" From fed92f1542d88e88100750c09054c82bbf8cb5cf Mon Sep 17 00:00:00 2001 From: hyunjium Date: Thu, 4 Apr 2024 22:50:19 +0900 Subject: [PATCH 17/22] =?UTF-8?q?[feat]=20#139=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=EB=AA=A8=EC=84=9C=EB=A6=AC=20=EB=91=A5=EA=B8=80?= =?UTF-8?q?=EA=B2=8C=20=ED=95=98=EA=B8=B0=20coil=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 3 ++ app/src/main/AndroidManifest.xml | 2 +- .../exercise/ExerciseViewHolder.kt | 33 +++++++++++++++---- app/src/main/res/layout/item_exercise.xml | 4 --- .../main/res/layout/item_exercise_today.xml | 15 ++++++--- 5 files changed, 42 insertions(+), 15 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0e479367..3bb70719 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -160,6 +160,9 @@ dependencies { // dataStore implementation 'androidx.datastore:datastore-preferences:1.0.0' + //coil + implementation("io.coil-kt:coil:2.0.0-rc03") + // test androidTestImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4' androidTestImplementation 'com.squareup.okhttp3:mockwebserver:4.10.0' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 457cf0af..7345c535 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -51,7 +51,7 @@ + android:foregroundServiceType="health" /> + + + + From ad259d01aec794a0c6abd8f0ba89508f8e324635 Mon Sep 17 00:00:00 2001 From: hyunjium Date: Fri, 5 Apr 2024 03:26:03 +0900 Subject: [PATCH 18/22] =?UTF-8?q?[chore]=20#139=20=EA=B8=80=EC=9E=90=20?= =?UTF-8?q?=EC=9E=98=EB=A6=AC=EB=8A=94=20=EB=B6=80=EB=B6=84=20=EC=95=84?= =?UTF-8?q?=EB=9E=98=EB=A1=9C=20=EB=82=B4=EB=A6=AC=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/fragment_mypage.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/layout/fragment_mypage.xml b/app/src/main/res/layout/fragment_mypage.xml index ea032d27..52443087 100644 --- a/app/src/main/res/layout/fragment_mypage.xml +++ b/app/src/main/res/layout/fragment_mypage.xml @@ -98,13 +98,14 @@ From 2cb494a6ad102c7bf6baed3ed9b0b4a036f97c4e Mon Sep 17 00:00:00 2001 From: hyunjium Date: Fri, 5 Apr 2024 23:14:10 +0900 Subject: [PATCH 19/22] =?UTF-8?q?[feat]=20#139=20=EC=9D=BC=EB=8B=A8?= =?UTF-8?q?=EC=9D=80=20=EB=A7=90=ED=92=8D=EC=84=A0=20=EA=B5=AC=ED=98=84=20?= =?UTF-8?q?1=EC=B0=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 3 + .../exercise/ExerciseViewHolder.kt | 25 ++++ .../main/res/drawable/ic_notice_triangle.xml | 13 ++ .../res/drawable/shadow_question_notice.xml | 126 ++++++++++++++++++ .../shape_rectangle_white_radius6.xml | 6 + app/src/main/res/layout/item_exercise.xml | 2 +- .../main/res/layout/item_exercise_today.xml | 13 +- .../view_exercise_today_question_notice.xml | 55 ++++++++ app/src/main/res/values/strings.xml | 5 +- 9 files changed, 233 insertions(+), 15 deletions(-) create mode 100644 app/src/main/res/drawable/ic_notice_triangle.xml create mode 100644 app/src/main/res/drawable/shadow_question_notice.xml create mode 100644 app/src/main/res/drawable/shape_rectangle_white_radius6.xml create mode 100644 app/src/main/res/layout/view_exercise_today_question_notice.xml diff --git a/app/build.gradle b/app/build.gradle index 3bb70719..21e5c575 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -163,6 +163,9 @@ dependencies { //coil implementation("io.coil-kt:coil:2.0.0-rc03") + //tooltip + implementation "com.github.skydoves:balloon:1.4.6" + // test androidTestImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4' androidTestImplementation 'com.squareup.okhttp3:mockwebserver:4.10.0' 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 9b4e3dc4..589df2df 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt @@ -1,12 +1,20 @@ package sopt.motivoo.presentation.exercise import android.content.Context +import android.graphics.Color +import android.graphics.PorterDuff +import android.graphics.PorterDuffColorFilter import android.view.View +import android.widget.FrameLayout import androidx.core.content.ContextCompat import androidx.navigation.findNavController import androidx.recyclerview.widget.RecyclerView import coil.load import coil.transform.RoundedCornersTransformation +import com.skydoves.balloon.ArrowPositionRules +import com.skydoves.balloon.Balloon +import com.skydoves.balloon.BalloonAnimation +import com.skydoves.balloon.createBalloon import sopt.motivoo.R import sopt.motivoo.databinding.ItemExerciseBinding import sopt.motivoo.databinding.ItemExerciseTodayBinding @@ -131,11 +139,28 @@ class ExerciseNoticeViewHolder(private val binding: ItemExerciseTodayBinding) : opponentUserType: String, itemCount: Int, ) { + clickQuestionMark() setCharacterIcon(userType, opponentUserType) setText(exerciseNoticeData) setEmptyHistory(itemCount) } + private fun clickQuestionMark() { + val context = binding.root.context + val balloon = Balloon.Builder(context) + .setLayout(R.layout.view_exercise_today_question_notice) + .setBackgroundColorResource(android.R.color.transparent) + .setArrowPositionRules(ArrowPositionRules.ALIGN_ANCHOR) + .setArrowPosition(0.5f) + .setArrowSize(0) + .build() + + binding.ivExerciseTodayIconQuestion.setOnClickListener { + balloon.showAlignBottom(binding.ivExerciseTodayIconQuestion,0,-15) + } + } + + private fun setCharacterIcon(userType: String, opponentUserType: String) { if (userType == CHILD) binding.ivExerciseTodayIconLeft.setImageResource(R.drawable.ic_child_left) else binding.ivExerciseTodayIconLeft.setImageResource( R.drawable.ic_parent_left diff --git a/app/src/main/res/drawable/ic_notice_triangle.xml b/app/src/main/res/drawable/ic_notice_triangle.xml new file mode 100644 index 00000000..f21fa40b --- /dev/null +++ b/app/src/main/res/drawable/ic_notice_triangle.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/app/src/main/res/drawable/shadow_question_notice.xml b/app/src/main/res/drawable/shadow_question_notice.xml new file mode 100644 index 00000000..cff84786 --- /dev/null +++ b/app/src/main/res/drawable/shadow_question_notice.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_rectangle_white_radius6.xml b/app/src/main/res/drawable/shape_rectangle_white_radius6.xml new file mode 100644 index 00000000..1799e602 --- /dev/null +++ b/app/src/main/res/drawable/shape_rectangle_white_radius6.xml @@ -0,0 +1,6 @@ + + + + + \ 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 760021f6..e501180c 100644 --- a/app/src/main/res/layout/item_exercise.xml +++ b/app/src/main/res/layout/item_exercise.xml @@ -8,7 +8,7 @@ - - - diff --git a/app/src/main/res/layout/view_exercise_today_question_notice.xml b/app/src/main/res/layout/view_exercise_today_question_notice.xml new file mode 100644 index 00000000..dbd03bbd --- /dev/null +++ b/app/src/main/res/layout/view_exercise_today_question_notice.xml @@ -0,0 +1,55 @@ + + + + + + + + + + \ 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 d22c538e..db28f2c4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -156,7 +156,6 @@ 오늘의 운동 8천걸음 걷고 \n스탠딩 랫폴다운 20번 하기 - 운동 기록은 30일간 보관 후 사라져요! 2023년 12월 25일 월요일 다음 운동은\n꼭 성공해요! 내 운동 @@ -167,6 +166,8 @@ 오늘의 운동 하러가기 오늘의 운동 선택하러가기 오늘 할 운동을 선택하세요! + 운동 기록은 30일간 보관 후 사라져요! + 우리들의 운동 기록 잠시 연결이 불안정해요 @@ -202,7 +203,5 @@ 매칭이 끊어졌어요 매칭이 끊어져 모티부를 이용할 수 없어요\n탈퇴 후 다시 가입해주세요 잠시 연결이 불안정해요 - 우리들의 운동 기록 - From f74637b023a7189832870000c5e63fb0ef8d875a Mon Sep 17 00:00:00 2001 From: hyunjium Date: Fri, 5 Apr 2024 23:17:00 +0900 Subject: [PATCH 20/22] =?UTF-8?q?[chore]=20#139=20=EC=97=90=EB=9F=AC=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 --- .../motivoo/presentation/exercise/ExerciseViewHolder.kt | 9 +-------- 1 file changed, 1 insertion(+), 8 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 589df2df..bc2aef87 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt @@ -1,11 +1,7 @@ package sopt.motivoo.presentation.exercise import android.content.Context -import android.graphics.Color -import android.graphics.PorterDuff -import android.graphics.PorterDuffColorFilter import android.view.View -import android.widget.FrameLayout import androidx.core.content.ContextCompat import androidx.navigation.findNavController import androidx.recyclerview.widget.RecyclerView @@ -13,8 +9,6 @@ import coil.load import coil.transform.RoundedCornersTransformation import com.skydoves.balloon.ArrowPositionRules import com.skydoves.balloon.Balloon -import com.skydoves.balloon.BalloonAnimation -import com.skydoves.balloon.createBalloon import sopt.motivoo.R import sopt.motivoo.databinding.ItemExerciseBinding import sopt.motivoo.databinding.ItemExerciseTodayBinding @@ -156,11 +150,10 @@ class ExerciseNoticeViewHolder(private val binding: ItemExerciseTodayBinding) : .build() binding.ivExerciseTodayIconQuestion.setOnClickListener { - balloon.showAlignBottom(binding.ivExerciseTodayIconQuestion,0,-15) + balloon.showAlignBottom(binding.ivExerciseTodayIconQuestion, 0, -15) } } - private fun setCharacterIcon(userType: String, opponentUserType: String) { if (userType == CHILD) binding.ivExerciseTodayIconLeft.setImageResource(R.drawable.ic_child_left) else binding.ivExerciseTodayIconLeft.setImageResource( R.drawable.ic_parent_left From fe104a8557546f78de9ce1a22b3de5aebfe6e93c Mon Sep 17 00:00:00 2001 From: hyunjium Date: Tue, 9 Apr 2024 01:32:09 +0900 Subject: [PATCH 21/22] =?UTF-8?q?[feat]=20#139=20=EB=A7=90=ED=92=8D?= =?UTF-8?q?=EC=84=A0=20=EA=B5=AC=ED=98=84=202=EC=B0=A8(=EB=A7=90=ED=92=8D?= =?UTF-8?q?=EC=84=A0=20=EC=9C=84=EC=B9=98=20=EC=9C=97=EC=AA=BD=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/ExerciseViewHolder.kt | 23 +++- .../main/res/drawable/ic_notice_triangle.xml | 13 -- .../res/drawable/shadow_question_notice.xml | 126 ------------------ .../view_exercise_today_question_notice.xml | 55 -------- 4 files changed, 19 insertions(+), 198 deletions(-) delete mode 100644 app/src/main/res/drawable/ic_notice_triangle.xml delete mode 100644 app/src/main/res/drawable/shadow_question_notice.xml delete mode 100644 app/src/main/res/layout/view_exercise_today_question_notice.xml 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 bc2aef87..a554f68d 100644 --- a/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt +++ b/app/src/main/java/sopt/motivoo/presentation/exercise/ExerciseViewHolder.kt @@ -9,6 +9,7 @@ import coil.load import coil.transform.RoundedCornersTransformation import com.skydoves.balloon.ArrowPositionRules import com.skydoves.balloon.Balloon +import com.skydoves.balloon.BalloonSizeSpec import sopt.motivoo.R import sopt.motivoo.databinding.ItemExerciseBinding import sopt.motivoo.databinding.ItemExerciseTodayBinding @@ -142,15 +143,29 @@ class ExerciseNoticeViewHolder(private val binding: ItemExerciseTodayBinding) : private fun clickQuestionMark() { val context = binding.root.context val balloon = Balloon.Builder(context) - .setLayout(R.layout.view_exercise_today_question_notice) - .setBackgroundColorResource(android.R.color.transparent) + .setHeight(BalloonSizeSpec.WRAP) + .setWidth(BalloonSizeSpec.WRAP) + .setTextResource(R.string.exercise_today_question_notice) + .setArrowColorResource(R.color.white_FFFFFF) + .setBackgroundColorResource(R.color.white_FFFFFF) + .setTextColorResource(R.color.gray_800_303031) + .setTextSize(15f) + .setTextTypeface(R.font.pretendard) + .setPaddingLeft(11) + .setPaddingRight(15) + .setPaddingTop(14) + .setPaddingBottom(15) + .setMarginTop(3) .setArrowPositionRules(ArrowPositionRules.ALIGN_ANCHOR) + .setIconDrawableResource(R.drawable.ic_notice) + .setCornerRadius(6f) .setArrowPosition(0.5f) - .setArrowSize(0) + .setElevation(5) + .setArrowSize(13) .build() binding.ivExerciseTodayIconQuestion.setOnClickListener { - balloon.showAlignBottom(binding.ivExerciseTodayIconQuestion, 0, -15) + balloon.showAlignTop(binding.ivExerciseTodayIconQuestion) } } diff --git a/app/src/main/res/drawable/ic_notice_triangle.xml b/app/src/main/res/drawable/ic_notice_triangle.xml deleted file mode 100644 index f21fa40b..00000000 --- a/app/src/main/res/drawable/ic_notice_triangle.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - diff --git a/app/src/main/res/drawable/shadow_question_notice.xml b/app/src/main/res/drawable/shadow_question_notice.xml deleted file mode 100644 index cff84786..00000000 --- a/app/src/main/res/drawable/shadow_question_notice.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/view_exercise_today_question_notice.xml b/app/src/main/res/layout/view_exercise_today_question_notice.xml deleted file mode 100644 index dbd03bbd..00000000 --- a/app/src/main/res/layout/view_exercise_today_question_notice.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - \ No newline at end of file From 2f25755287e440fbeba4c434753b7f0c4984a7e0 Mon Sep 17 00:00:00 2001 From: l2zh Date: Tue, 9 Apr 2024 02:12:35 +0900 Subject: [PATCH 22/22] =?UTF-8?q?[fix]=20#117=20=ED=99=88=20=EB=B6=80?= =?UTF-8?q?=EB=B6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../motivoo/presentation/home/HomeFragment.kt | 26 +++---------------- .../home/viewmodel/HomeViewModel.kt | 2 +- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/sopt/motivoo/presentation/home/HomeFragment.kt b/app/src/main/java/sopt/motivoo/presentation/home/HomeFragment.kt index bb1d2d4c..40471ca0 100644 --- a/app/src/main/java/sopt/motivoo/presentation/home/HomeFragment.kt +++ b/app/src/main/java/sopt/motivoo/presentation/home/HomeFragment.kt @@ -12,7 +12,6 @@ import android.provider.Settings import android.transition.TransitionManager import android.view.View import android.view.ViewGroup -import android.widget.Toast import androidx.activity.OnBackPressedCallback import androidx.activity.result.contract.ActivityResultContracts import androidx.core.content.ContextCompat @@ -38,7 +37,6 @@ import timber.log.Timber @AndroidEntryPoint class HomeFragment : BindingFragment(R.layout.fragment_home) { - private var isCreated = false private val viewModel: HomeViewModel by activityViewModels() lateinit var alarmManager: AlarmManager @@ -55,8 +53,9 @@ class HomeFragment : BindingFragment(R.layout.fragment_home educationGranted = true } } + if (!permissionGranted) { - if (educationGranted) intentAppSettings() // TODO :: 교육용 팝업 + if (educationGranted && viewModel.isMissionChoiceFinished.value == true) intentAppSettings() // TODO :: 교육용 팝업 else permissionDenied() } else { permissionGranted() @@ -65,7 +64,6 @@ class HomeFragment : BindingFragment(R.layout.fragment_home override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - isCreated = true binding.vm = viewModel alarmManager = context?.getSystemService(Context.ALARM_SERVICE) as AlarmManager backPressed() @@ -170,14 +168,13 @@ class HomeFragment : BindingFragment(R.layout.fragment_home } private fun checkPermissionIfUnSelectedMission() { - if (viewModel.isMissionChoiceFinished.value == false) { + if (viewModel.isMissionChoiceFinished.value != true) { requestHomePermissionRequest.launch(HOME_REQUIRED_PERMISSIONS) } } private fun checkHomeAlarmPermission(homeState: HomeState.FetchHomeData) { if (checkPermission()) { - val alarmManager = context?.getSystemService(Context.ALARM_SERVICE) as AlarmManager if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { if (!alarmManager.canScheduleExactAlarms()) { requestScheduleExactAlarm() @@ -238,16 +235,6 @@ class HomeFragment : BindingFragment(R.layout.fragment_home } } - override fun onResume() { - super.onResume() - if (isCreated) { - isCreated = false - } else { - initHomePermissionsState() - viewModel.postMissionTodayChoice() - } - } - private fun initHomePermissionsState() { checkPermission().also { if (it) permissionGranted() @@ -262,11 +249,6 @@ class HomeFragment : BindingFragment(R.layout.fragment_home } private fun permissionDenied() { - Toast.makeText( - requireContext(), - "Permission request denied", - Toast.LENGTH_SHORT - ).show() updateBlurEffect() viewModel.isPermissionGranted.value = false } @@ -281,7 +263,6 @@ class HomeFragment : BindingFragment(R.layout.fragment_home binding.motivooOtherPieChart.updateBlurEffect() binding.ivMissionCompleted.updateBlurEffect() binding.ivStepCount.updateBlurEffect() - binding.tvExercisePercent.updateBlurEffect() } private fun removeBlurEffect() { @@ -289,7 +270,6 @@ class HomeFragment : BindingFragment(R.layout.fragment_home binding.motivooOtherPieChart.removeBlurEffect() binding.ivMissionCompleted.removeBlurEffect() binding.ivStepCount.removeBlurEffect() - binding.tvExercisePercent.removeBlurEffect() } private fun navigateToExerciseMethodNotion() { diff --git a/app/src/main/java/sopt/motivoo/presentation/home/viewmodel/HomeViewModel.kt b/app/src/main/java/sopt/motivoo/presentation/home/viewmodel/HomeViewModel.kt index 58299a19..595905df 100644 --- a/app/src/main/java/sopt/motivoo/presentation/home/viewmodel/HomeViewModel.kt +++ b/app/src/main/java/sopt/motivoo/presentation/home/viewmodel/HomeViewModel.kt @@ -38,7 +38,7 @@ class HomeViewModel @Inject constructor( val userType = MutableLiveData() val anotherUserType = MutableLiveData() val isPermissionGranted = MutableLiveData() - val isMissionChoiceFinished = MutableLiveData(false) + val isMissionChoiceFinished = MutableLiveData() val isCompletedStepCount = MutableLiveData() val isCompletedMission = MutableLiveData() val isHighFive = MutableLiveData()