From 37ca31f752a64d3476c2ad36fd84be0c839e2858 Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Fri, 29 Mar 2024 14:27:15 +0900 Subject: [PATCH 01/11] =?UTF-8?q?[FEAT]=20SuggestionDashboard=20Scrreen,?= =?UTF-8?q?=20Inputs,=20Ouputs,=20UiEffect=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20(#221)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/SuggestionDashboardScreen.kt | 12 ++++++++++++ .../contract/SuggestionDashboardInputs.kt | 9 +++++++++ .../contract/SuggestionDashboardOutputs.kt | 11 +++++++++++ .../contract/SuggestionDashboardUiEffect.kt | 7 +++++++ 4 files changed, 39 insertions(+) create mode 100644 feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt create mode 100644 feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/contract/SuggestionDashboardInputs.kt create mode 100644 feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/contract/SuggestionDashboardOutputs.kt create mode 100644 feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/contract/SuggestionDashboardUiEffect.kt diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt new file mode 100644 index 00000000..3a99c35a --- /dev/null +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt @@ -0,0 +1,12 @@ +package com.lgtm.android.mission_suggestion.ui.dashboard.presentation + +import androidx.compose.runtime.Composable +import androidx.hilt.navigation.compose.hiltViewModel +import com.lgtm.android.mission_suggestion.ui.dashboard.SuggestionDashboardViewModel + +@Composable +fun SuggestionDashboardScreen( + viewModel: SuggestionDashboardViewModel = hiltViewModel() +) { + /* suggestionDashboard screen 정의 */ +} \ No newline at end of file diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/contract/SuggestionDashboardInputs.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/contract/SuggestionDashboardInputs.kt new file mode 100644 index 00000000..cde4ecfe --- /dev/null +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/contract/SuggestionDashboardInputs.kt @@ -0,0 +1,9 @@ +package com.lgtm.android.mission_suggestion.ui.dashboard.presentation.contract + +interface SuggestionDashboardInputs { + fun likeSuggestion() + fun cancelLikeSuggestion() + fun moveToCreateSuggestion() + fun moveToSuggestionDetail(suggestionId: Int) + fun goBack() +} \ No newline at end of file diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/contract/SuggestionDashboardOutputs.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/contract/SuggestionDashboardOutputs.kt new file mode 100644 index 00000000..83186521 --- /dev/null +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/contract/SuggestionDashboardOutputs.kt @@ -0,0 +1,11 @@ +package com.lgtm.android.mission_suggestion.ui.dashboard.presentation.contract + +import com.lgtm.android.common_ui.util.UiState +import com.lgtm.domain.mission_suggestion.SuggestionContent +import kotlinx.coroutines.flow.SharedFlow +import kotlinx.coroutines.flow.StateFlow + +interface SuggestionDashboardOutputs { + val suggestionDashboardState: StateFlow>> + val suggestionDashboardUiEffect: SharedFlow +} \ No newline at end of file diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/contract/SuggestionDashboardUiEffect.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/contract/SuggestionDashboardUiEffect.kt new file mode 100644 index 00000000..bf2c76ee --- /dev/null +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/contract/SuggestionDashboardUiEffect.kt @@ -0,0 +1,7 @@ +package com.lgtm.android.mission_suggestion.ui.dashboard.presentation.contract + +sealed class SuggestionDashboardUiEffect { + object GoBack: SuggestionDashboardUiEffect() + object CreateSuggestion: SuggestionDashboardUiEffect() + data class SuggestionDetail(val suggestionId: Int): SuggestionDashboardUiEffect() +} \ No newline at end of file From a1f0a5d2949274bec9085bd5daa3f7715805aebd Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Fri, 29 Mar 2024 14:47:48 +0900 Subject: [PATCH 02/11] =?UTF-8?q?[FIX]=20detailUiffect=20mutableSharedFlow?= =?UTF-8?q?=20->=20sharedFlow=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 --- .../mission_suggestion/ui/detail/SuggestionDetailViewModel.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/detail/SuggestionDetailViewModel.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/detail/SuggestionDetailViewModel.kt index 62c71a6f..791db50b 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/detail/SuggestionDetailViewModel.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/detail/SuggestionDetailViewModel.kt @@ -17,6 +17,7 @@ import com.lgtm.domain.repository.SuggestionRepository import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch import javax.inject.Inject @@ -32,7 +33,7 @@ class SuggestionDetailViewModel @Inject constructor( get() = _detailState private val _detailUiEffect: MutableSharedFlow = MutableSharedFlow(replay = 0) - override val detailUiEffect: MutableSharedFlow + override val detailUiEffect: SharedFlow get() = _detailUiEffect /* 미션 제안 상세 내용 */ From 6573c046b566cd66fd31e11f952e51206a603fbf Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Sat, 30 Mar 2024 15:26:47 +0900 Subject: [PATCH 03/11] =?UTF-8?q?[FEAT]=20mission=20suggestion=20sdui=20co?= =?UTF-8?q?mponent=20compose=EB=A1=9C=20migration=20(#221)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/dashboard/sdui/SuggestionContent.kt | 82 +++++++++++++++++++ .../ui/dashboard/sdui/SuggestionInfo.kt | 47 +++++++++++ .../ui/dashboard/sdui/SuggstionListEmpty.kt | 40 +++++++++ 3 files changed, 169 insertions(+) create mode 100644 feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggestionContent.kt create mode 100644 feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggestionInfo.kt create mode 100644 feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggstionListEmpty.kt diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggestionContent.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggestionContent.kt new file mode 100644 index 00000000..d95853bc --- /dev/null +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggestionContent.kt @@ -0,0 +1,82 @@ +package com.lgtm.android.mission_suggestion.ui.dashboard.sdui + +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Divider +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import com.lgtm.android.common_ui.components.buttons.LikeButton +import com.lgtm.android.common_ui.components.texts.DateTimeText +import com.lgtm.android.common_ui.model.SuggestionUI +import com.lgtm.android.common_ui.theme.LGTMTheme +import com.lgtm.android.common_ui.util.throttleClickable + +@Composable +fun SuggestionContent( + suggestionUI: SuggestionUI, + onSuggestionClick: (Int) -> Unit +) { + Column( + modifier = Modifier + .fillMaxWidth() + .background( + color = LGTMTheme.colors.white, + shape = RoundedCornerShape(20.dp), + ) + .border( + width = 1.dp, + color = LGTMTheme.colors.gray_2, + shape = RoundedCornerShape(20.dp), + ) + .padding( + horizontal = 20.dp, + vertical = 16.dp + ) + .throttleClickable(true) { onSuggestionClick(suggestionUI.suggestionId) } + ) { + Text( + text = suggestionUI.title, + color = LGTMTheme.colors.black, + style = LGTMTheme.typography.body2, + maxLines = 2, + overflow = TextOverflow.Ellipsis + ) + + Divider( + modifier = Modifier + .padding(top = 16.dp) + .background(color = LGTMTheme.colors.gray_2) + ) + + Text( + modifier = Modifier.padding(top = 10.dp), + text = suggestionUI.description, + color = LGTMTheme.colors.black, + style = LGTMTheme.typography.body3R, + maxLines = 3, + overflow = TextOverflow.Ellipsis + ) + + Row( + modifier = Modifier.padding(top = 10.dp).fillMaxWidth(), + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically + ) { + DateTimeText(date = suggestionUI.date, time = suggestionUI.time) + LikeButton(likeNum = suggestionUI.likeNum, isLiked = suggestionUI.isLiked) { + + } + } + + } +} \ No newline at end of file diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggestionInfo.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggestionInfo.kt new file mode 100644 index 00000000..a5e2ab17 --- /dev/null +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggestionInfo.kt @@ -0,0 +1,47 @@ +package com.lgtm.android.mission_suggestion.ui.dashboard.sdui + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import com.lgtm.android.common_ui.theme.LGTMTheme +import com.lgtm.domain.mission_suggestion.SuggestionHeaderVO + +@Composable +fun SuggestionInfo( + suggestionHeader: SuggestionHeaderVO +) { + Column( + modifier = Modifier + .fillMaxWidth() + .background( + color = LGTMTheme.colors.gray_7, + shape = RoundedCornerShape(20.dp) + ) + .padding( + horizontal = 20.dp, + vertical = 16.dp + ) + ) { + Text( + text = suggestionHeader.title, + style = LGTMTheme.typography.body2, + color = LGTMTheme.colors.white + ) + Text( + modifier = Modifier.padding( + top = 8.dp, + start = 4.dp, + end = 4.dp + ), + text = suggestionHeader.description, + style = LGTMTheme.typography.body2, + color = LGTMTheme.colors.white + ) + } +} \ No newline at end of file diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggstionListEmpty.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggstionListEmpty.kt new file mode 100644 index 00000000..4d6a75de --- /dev/null +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggstionListEmpty.kt @@ -0,0 +1,40 @@ +package com.lgtm.android.mission_suggestion.ui.dashboard.sdui + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import com.lgtm.android.common_ui.R +import com.lgtm.android.common_ui.theme.LGTMTheme + +@Composable +fun SuggestionListEmpty() { + Column( + modifier = Modifier + .fillMaxWidth() + .background( + color = LGTMTheme.colors.gray_3, + ), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Image( + modifier = Modifier.padding(top = 43.dp), + painter = painterResource(id = R.drawable.img_empty_gray_1), + contentDescription = null + ) + Text( + modifier = Modifier.padding(top = 5.dp), + text = stringResource(id = R.string.no_recommendation_yet), + style = LGTMTheme.typography.body2, + color = LGTMTheme.colors.gray_6 + ) + } +} \ No newline at end of file From 76b812de0c3e5a8e912d430137f311ff99388d3f Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Sat, 30 Mar 2024 15:27:35 +0900 Subject: [PATCH 04/11] =?UTF-8?q?[FEAT]=20=EA=B8=B0=EC=A1=B4=20mission=20s?= =?UTF-8?q?uggestion=20sdui=20viewHolder=20=EB=B0=8F=20layout=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20(#221)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapter/MissionSuggestionAdapter.kt | 44 ------ .../MissionSuggestionBaseViewHolder.kt | 11 -- .../MissionSuggestionContentViewHolder.kt | 22 --- .../MissionSuggestionEmptyViewHolder.kt | 12 -- .../MissionSuggestionHeaderViewHolder.kt | 13 -- .../viewholder/SuggestionViewHolderFactory.kt | 33 ----- .../res/layout/item_mission_suggestion.xml | 128 ------------------ .../layout/item_mission_suggestion_empty.xml | 36 ----- .../layout/item_mission_suggestion_info.xml | 48 ------- 9 files changed, 347 deletions(-) delete mode 100644 common-ui/src/main/java/com/lgtm/android/common_ui/adapter/MissionSuggestionAdapter.kt delete mode 100644 common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/MissionSuggestionBaseViewHolder.kt delete mode 100644 common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/MissionSuggestionContentViewHolder.kt delete mode 100644 common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/MissionSuggestionEmptyViewHolder.kt delete mode 100644 common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/MissionSuggestionHeaderViewHolder.kt delete mode 100644 common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/SuggestionViewHolderFactory.kt delete mode 100644 common-ui/src/main/res/layout/item_mission_suggestion.xml delete mode 100644 common-ui/src/main/res/layout/item_mission_suggestion_empty.xml delete mode 100644 common-ui/src/main/res/layout/item_mission_suggestion_info.xml diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/adapter/MissionSuggestionAdapter.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/adapter/MissionSuggestionAdapter.kt deleted file mode 100644 index ee53bc5d..00000000 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/adapter/MissionSuggestionAdapter.kt +++ /dev/null @@ -1,44 +0,0 @@ -package com.lgtm.android.common_ui.adapter - -import android.view.ViewGroup -import androidx.recyclerview.widget.ListAdapter -import com.lgtm.android.common_ui.util.ItemDiffCallback -import com.lgtm.android.common_ui.viewholder.MissionSuggestionBaseViewHolder -import com.lgtm.android.common_ui.viewholder.MissionSuggestionContentViewHolder -import com.lgtm.android.common_ui.viewholder.getSuggestionViewHolder -import com.lgtm.domain.mission_suggestion.SuggestionContent -import com.lgtm.domain.mission_suggestion.SuggestionViewType - -class MissionSuggestionAdapter( - private val onSuggestionClickListener: (Int) -> Unit -): ListAdapter( - ItemDiffCallback( - onContentsTheSame = { old, new -> old == new }, - onItemsTheSame = { old, new -> old == new } - ) -) { - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MissionSuggestionBaseViewHolder { - val viewHolder = getSuggestionViewHolder(parent, SuggestionViewType.getViewTypeByOrdinal(viewType)) - - when(viewType) { - SuggestionViewType.CONTENT.ordinal -> setOnSuggestionClickListener(viewHolder) - else -> Unit - } - - return viewHolder - } - - override fun onBindViewHolder(holder: MissionSuggestionBaseViewHolder, position: Int) { - holder.onBind(getItem(position)) - } - - override fun getItemViewType(position: Int): Int { - return getItem(position).viewType.ordinal - } - - private fun setOnSuggestionClickListener(viewHolder: MissionSuggestionBaseViewHolder) { - viewHolder as MissionSuggestionContentViewHolder - viewHolder.setNavigateToSuggestionDetail(onSuggestionClickListener) - } -} \ No newline at end of file diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/MissionSuggestionBaseViewHolder.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/MissionSuggestionBaseViewHolder.kt deleted file mode 100644 index 43e5e572..00000000 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/MissionSuggestionBaseViewHolder.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.lgtm.android.common_ui.viewholder - -import androidx.databinding.ViewDataBinding -import androidx.recyclerview.widget.RecyclerView -import com.lgtm.domain.mission_suggestion.SuggestionContent - -abstract class MissionSuggestionBaseViewHolder( - binding: ViewDataBinding -): RecyclerView.ViewHolder(binding.root) { - abstract fun onBind(item: SuggestionContent) -} \ No newline at end of file diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/MissionSuggestionContentViewHolder.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/MissionSuggestionContentViewHolder.kt deleted file mode 100644 index de7d3691..00000000 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/MissionSuggestionContentViewHolder.kt +++ /dev/null @@ -1,22 +0,0 @@ -package com.lgtm.android.common_ui.viewholder - -import com.lgtm.android.common_ui.databinding.ItemMissionSuggestionBinding -import com.lgtm.android.common_ui.model.SuggestionUI -import com.lgtm.android.common_ui.util.setOnThrottleClickListener -import com.lgtm.domain.mission_suggestion.SuggestionContent - -class MissionSuggestionContentViewHolder( - private val binding: ItemMissionSuggestionBinding -): MissionSuggestionBaseViewHolder(binding) { - private lateinit var navigateToSuggestionDetail: (Int) -> Unit - - override fun onBind(item: SuggestionContent) { - item as SuggestionUI - binding.data = item - binding.clMissionSuggestion.setOnThrottleClickListener { navigateToSuggestionDetail(item.suggestionId) } - } - - fun setNavigateToSuggestionDetail(navigateToSuggestionDetail: (Int) -> Unit) { - this.navigateToSuggestionDetail = navigateToSuggestionDetail - } -} \ No newline at end of file diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/MissionSuggestionEmptyViewHolder.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/MissionSuggestionEmptyViewHolder.kt deleted file mode 100644 index 97e81440..00000000 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/MissionSuggestionEmptyViewHolder.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.lgtm.android.common_ui.viewholder - -import com.lgtm.android.common_ui.databinding.ItemMissionSuggestionEmptyBinding -import com.lgtm.domain.mission_suggestion.SuggestionContent - -class MissionSuggestionEmptyViewHolder ( - binding: ItemMissionSuggestionEmptyBinding -): MissionSuggestionBaseViewHolder(binding) { - override fun onBind(item: SuggestionContent) { - /* no-op */ - } -} \ No newline at end of file diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/MissionSuggestionHeaderViewHolder.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/MissionSuggestionHeaderViewHolder.kt deleted file mode 100644 index 93a10003..00000000 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/MissionSuggestionHeaderViewHolder.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.lgtm.android.common_ui.viewholder - -import com.lgtm.android.common_ui.databinding.ItemMissionSuggestionInfoBinding -import com.lgtm.domain.mission_suggestion.SuggestionContent -import com.lgtm.domain.mission_suggestion.SuggestionHeaderVO - -class MissionSuggestionHeaderViewHolder( - private val binding: ItemMissionSuggestionInfoBinding -): MissionSuggestionBaseViewHolder(binding) { - override fun onBind(item: SuggestionContent) { - binding.data = item as SuggestionHeaderVO - } -} \ No newline at end of file diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/SuggestionViewHolderFactory.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/SuggestionViewHolderFactory.kt deleted file mode 100644 index e12ab3cd..00000000 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/SuggestionViewHolderFactory.kt +++ /dev/null @@ -1,33 +0,0 @@ -package com.lgtm.android.common_ui.viewholder - -import android.view.LayoutInflater -import android.view.ViewGroup -import androidx.databinding.DataBindingUtil -import androidx.databinding.ViewDataBinding -import com.lgtm.android.common_ui.R -import com.lgtm.android.common_ui.databinding.ItemMissionSuggestionBinding -import com.lgtm.android.common_ui.databinding.ItemMissionSuggestionEmptyBinding -import com.lgtm.android.common_ui.databinding.ItemMissionSuggestionInfoBinding -import com.lgtm.domain.mission_suggestion.SuggestionViewType - -fun getSuggestionViewHolder(parent: ViewGroup, viewType: SuggestionViewType): MissionSuggestionBaseViewHolder { - val layout = getLayoutByViewType(viewType) - val binding: ViewDataBinding = DataBindingUtil.inflate(LayoutInflater.from(parent.context), layout, parent, false) - - return when(viewType) { - SuggestionViewType.CONTENT -> MissionSuggestionContentViewHolder(binding as ItemMissionSuggestionBinding) - SuggestionViewType.HEADER -> MissionSuggestionHeaderViewHolder(binding as ItemMissionSuggestionInfoBinding) - SuggestionViewType.EMPTY -> MissionSuggestionEmptyViewHolder(binding as ItemMissionSuggestionEmptyBinding) - } - -} - -fun getLayoutByViewType(viewType: SuggestionViewType): Int { - - return when(viewType) { - SuggestionViewType.CONTENT -> R.layout.item_mission_suggestion - SuggestionViewType.HEADER -> R.layout.item_mission_suggestion_info - SuggestionViewType.EMPTY -> R.layout.item_mission_suggestion_empty - } - -} \ No newline at end of file diff --git a/common-ui/src/main/res/layout/item_mission_suggestion.xml b/common-ui/src/main/res/layout/item_mission_suggestion.xml deleted file mode 100644 index f5ca8f37..00000000 --- a/common-ui/src/main/res/layout/item_mission_suggestion.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/common-ui/src/main/res/layout/item_mission_suggestion_empty.xml b/common-ui/src/main/res/layout/item_mission_suggestion_empty.xml deleted file mode 100644 index 1d3e22b7..00000000 --- a/common-ui/src/main/res/layout/item_mission_suggestion_empty.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/common-ui/src/main/res/layout/item_mission_suggestion_info.xml b/common-ui/src/main/res/layout/item_mission_suggestion_info.xml deleted file mode 100644 index ac82d60f..00000000 --- a/common-ui/src/main/res/layout/item_mission_suggestion_info.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file From c4f21822ab046f6261f6f49ba9c51466a18b6e68 Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Sat, 30 Mar 2024 15:31:23 +0900 Subject: [PATCH 05/11] =?UTF-8?q?[FEAT]=20suggestionDashboard=20viewModel(?= =?UTF-8?q?inputs,=20outputs),=20activity(BaseComposeActivity)=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#221)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/SuggestionDashboardActivity.kt | 92 +++++++-------- .../dashboard/SuggestionDashboardViewModel.kt | 51 ++++++-- .../layout/activity_suggestion_dashboard.xml | 111 ------------------ 3 files changed, 84 insertions(+), 170 deletions(-) delete mode 100644 feature/mission_suggestion/src/main/res/layout/activity_suggestion_dashboard.xml diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardActivity.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardActivity.kt index 4517e338..34749c27 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardActivity.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardActivity.kt @@ -2,75 +2,63 @@ package com.lgtm.android.mission_suggestion.ui.dashboard import android.os.Bundle import androidx.activity.viewModels -import com.lgtm.android.common_ui.R.dimen -import com.lgtm.android.common_ui.adapter.MissionSuggestionAdapter -import com.lgtm.android.common_ui.base.BaseActivity -import com.lgtm.android.common_ui.util.ItemDecorationUtil -import com.lgtm.android.common_ui.util.setOnThrottleClickListener -import com.lgtm.android.mission_suggestion.R -import com.lgtm.android.mission_suggestion.databinding.ActivitySuggestionDashboardBinding +import androidx.compose.runtime.Composable +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.lifecycleScope +import androidx.lifecycle.repeatOnLifecycle +import com.lgtm.android.common_ui.base.BaseComposeActivity +import com.lgtm.android.common_ui.theme.LGTMTheme +import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.contract.SuggestionDashboardUiEffect import dagger.hilt.android.AndroidEntryPoint +import kotlinx.coroutines.launch @AndroidEntryPoint -class SuggestionDashboardActivity : BaseActivity(R.layout.activity_suggestion_dashboard) { +class SuggestionDashboardActivity : BaseComposeActivity() { private val suggestionDashboardViewModel by viewModels() - private lateinit var missionSuggestionAdapter: MissionSuggestionAdapter + override fun initializeViewModel() { viewModel = suggestionDashboardViewModel } - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setupBindingData() - addDashboardItemDecoration() - observeMissionSuggestion() - initAdapter() - setBackButtonClickListener() - setCreateSuggestionButtonClickListener() - } - - override fun onResume() { - super.onResume() - suggestionDashboardViewModel.fetchSuggestionList() - } - - private fun setupBindingData() { - binding.viewModel = suggestionDashboardViewModel - } - - private fun observeMissionSuggestion() { - suggestionDashboardViewModel.suggestionList.observe(this) { - missionSuggestionAdapter.submitList(it) + @Composable + override fun Content() { + LGTMTheme { + // TODO: SuggestionDashboardScreen 배치 } } - private fun addDashboardItemDecoration() { - val topMarginItemDecoration = ItemDecorationUtil.TopMarginItemDecoration(dimen.item_top_margin) - binding.rvMissionSuggestion.addItemDecoration(topMarginItemDecoration) - } - - private fun initAdapter() { - missionSuggestionAdapter = MissionSuggestionAdapter(::onClickSuggestionItem) - binding.rvMissionSuggestion.adapter = missionSuggestionAdapter + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + observeUiEffect() + fetchSuggestionList() } - private fun onClickSuggestionItem(suggestionId: Int) { - moveToSuggestionDetail(suggestionId) + private fun fetchSuggestionList() { + suggestionDashboardViewModel.fetchSuggestionList() } - private fun moveToSuggestionDetail(suggestionId: Int) { - lgtmNavigator.navigateToSuggestionDetail(this, suggestionId) - } + private fun observeUiEffect() { + lifecycleScope.launch { + repeatOnLifecycle(Lifecycle.State.STARTED) { + suggestionDashboardViewModel.suggestionDashboardUiEffect.collect { effect -> + when (effect) { + is SuggestionDashboardUiEffect.GoBack -> { + finish() + } - private fun setBackButtonClickListener() { - binding.ivBack.setOnThrottleClickListener { - finish() - } - } + is SuggestionDashboardUiEffect.CreateSuggestion -> { + lgtmNavigator.navigateToCreateSuggestion(this@SuggestionDashboardActivity) + } - private fun setCreateSuggestionButtonClickListener() { - binding.btnCreateSuggestion.setOnThrottleClickListener { - lgtmNavigator.navigateToCreateSuggestion(this) + is SuggestionDashboardUiEffect.SuggestionDetail -> { + lgtmNavigator.navigateToSuggestionDetail( + this@SuggestionDashboardActivity, + effect.suggestionId + ) + } + } + } + } } } } \ No newline at end of file diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardViewModel.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardViewModel.kt index be89399c..6d43de03 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardViewModel.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardViewModel.kt @@ -2,13 +2,15 @@ package com.lgtm.android.mission_suggestion.ui.dashboard import android.content.ContentValues.TAG import android.util.Log -import androidx.lifecycle.LiveData -import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope import com.google.firebase.crashlytics.ktx.crashlytics import com.google.firebase.ktx.Firebase import com.lgtm.android.common_ui.base.BaseViewModel import com.lgtm.android.common_ui.model.mapper.toUiModel +import com.lgtm.android.common_ui.util.UiState +import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.contract.SuggestionDashboardInputs +import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.contract.SuggestionDashboardOutputs +import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.contract.SuggestionDashboardUiEffect import com.lgtm.domain.constants.Role import com.lgtm.domain.mission_suggestion.SuggestionContent import com.lgtm.domain.mission_suggestion.SuggestionVO @@ -16,6 +18,10 @@ import com.lgtm.domain.mission_suggestion.SuggestionViewType import com.lgtm.domain.repository.AuthRepository import com.lgtm.domain.usecase.SuggestionUseCase import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.flow.MutableSharedFlow +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.SharedFlow +import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch import javax.inject.Inject @@ -23,18 +29,23 @@ import javax.inject.Inject class SuggestionDashboardViewModel @Inject constructor( private val suggestionUseCase: SuggestionUseCase, authRepository: AuthRepository -): BaseViewModel() { +): BaseViewModel(), SuggestionDashboardInputs, SuggestionDashboardOutputs { - val suggestionBtnVisibility: Boolean = authRepository.getMemberType() == Role.REVIEWEE + val createBtnVisibility: Boolean = authRepository.getMemberType() == Role.REVIEWEE - private val _suggestionList = MutableLiveData>() - val suggestionList: LiveData> = _suggestionList + private val _suggestionDashboardState = MutableStateFlow>>(UiState.Init) + override val suggestionDashboardState: StateFlow>> + get() = _suggestionDashboardState + + private val _suggestionDashboardUiEffect: MutableSharedFlow = MutableSharedFlow(replay = 0) + override val suggestionDashboardUiEffect: SharedFlow + get() = _suggestionDashboardUiEffect fun fetchSuggestionList() { viewModelScope.launch(lgtmErrorHandler) { suggestionUseCase.getSuggestionList() .onSuccess { - _suggestionList.postValue(convertToUiModel(it)) + _suggestionDashboardState.value = UiState.Success(data = convertToUiModel(it)) Log.d(TAG, "getSuggestion: $it") }.onFailure { Firebase.crashlytics.recordException(it) @@ -52,4 +63,30 @@ class SuggestionDashboardViewModel @Inject constructor( } } + override fun likeSuggestion() { + TODO("Not yet implemented") + } + + override fun cancelLikeSuggestion() { + TODO("Not yet implemented") + } + + override fun moveToCreateSuggestion() { + viewModelScope.launch(lgtmErrorHandler) { + _suggestionDashboardUiEffect.emit(SuggestionDashboardUiEffect.CreateSuggestion) + } + } + + override fun moveToSuggestionDetail(suggestionId: Int) { + viewModelScope.launch(lgtmErrorHandler) { + _suggestionDashboardUiEffect.emit(SuggestionDashboardUiEffect.SuggestionDetail(suggestionId)) + } + } + + override fun goBack() { + viewModelScope.launch(lgtmErrorHandler) { + _suggestionDashboardUiEffect.emit(SuggestionDashboardUiEffect.GoBack) + } + } + } \ No newline at end of file diff --git a/feature/mission_suggestion/src/main/res/layout/activity_suggestion_dashboard.xml b/feature/mission_suggestion/src/main/res/layout/activity_suggestion_dashboard.xml deleted file mode 100644 index 2deb202a..00000000 --- a/feature/mission_suggestion/src/main/res/layout/activity_suggestion_dashboard.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From d0e1150259bfba1ebffed2f3c15818ccb72a7126 Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Sat, 30 Mar 2024 15:33:00 +0900 Subject: [PATCH 06/11] =?UTF-8?q?[FEAT]=20suggestionDashboard=20sdui=20?= =?UTF-8?q?=ED=8F=B4=EB=8D=94=20presentation=EC=9C=BC=EB=A1=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=20(#221)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/dashboard/{ => presentation}/sdui/SuggestionContent.kt | 2 +- .../ui/dashboard/{ => presentation}/sdui/SuggestionInfo.kt | 2 +- .../ui/dashboard/{ => presentation}/sdui/SuggstionListEmpty.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/{ => presentation}/sdui/SuggestionContent.kt (97%) rename feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/{ => presentation}/sdui/SuggestionInfo.kt (94%) rename feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/{ => presentation}/sdui/SuggstionListEmpty.kt (94%) diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggestionContent.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggestionContent.kt similarity index 97% rename from feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggestionContent.kt rename to feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggestionContent.kt index d95853bc..3deb227e 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggestionContent.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggestionContent.kt @@ -1,4 +1,4 @@ -package com.lgtm.android.mission_suggestion.ui.dashboard.sdui +package com.lgtm.android.mission_suggestion.ui.dashboard.presentation.sdui import androidx.compose.foundation.background import androidx.compose.foundation.border diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggestionInfo.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggestionInfo.kt similarity index 94% rename from feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggestionInfo.kt rename to feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggestionInfo.kt index a5e2ab17..96e5c3e0 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggestionInfo.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggestionInfo.kt @@ -1,4 +1,4 @@ -package com.lgtm.android.mission_suggestion.ui.dashboard.sdui +package com.lgtm.android.mission_suggestion.ui.dashboard.presentation.sdui import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggstionListEmpty.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggstionListEmpty.kt similarity index 94% rename from feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggstionListEmpty.kt rename to feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggstionListEmpty.kt index 4d6a75de..352d6d9e 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/sdui/SuggstionListEmpty.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggstionListEmpty.kt @@ -1,4 +1,4 @@ -package com.lgtm.android.mission_suggestion.ui.dashboard.sdui +package com.lgtm.android.mission_suggestion.ui.dashboard.presentation.sdui import androidx.compose.foundation.Image import androidx.compose.foundation.background From c339829ab12efb1e8dc7b062f6d988d809dc62d4 Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Sat, 30 Mar 2024 15:34:17 +0900 Subject: [PATCH 07/11] =?UTF-8?q?[FEAT]=20suggestionDashboardScreen=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20(#221)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/SuggestionDashboardActivity.kt | 3 +- .../presentation/SuggestionDashboardScreen.kt | 207 +++++++++++++++++- 2 files changed, 208 insertions(+), 2 deletions(-) diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardActivity.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardActivity.kt index 34749c27..71ce32af 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardActivity.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardActivity.kt @@ -8,6 +8,7 @@ import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import com.lgtm.android.common_ui.base.BaseComposeActivity import com.lgtm.android.common_ui.theme.LGTMTheme +import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.SuggestionDashboardScreen import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.contract.SuggestionDashboardUiEffect import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.launch @@ -23,7 +24,7 @@ class SuggestionDashboardActivity : BaseComposeActivity() { @Composable override fun Content() { LGTMTheme { - // TODO: SuggestionDashboardScreen 배치 + SuggestionDashboardScreen() } } diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt index 3a99c35a..73002ac1 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt @@ -1,12 +1,217 @@ package com.lgtm.android.mission_suggestion.ui.dashboard.presentation +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.shadow +import androidx.compose.ui.layout.layout +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.offset +import androidx.compose.ui.zIndex +import androidx.constraintlayout.compose.ConstraintLayout import androidx.hilt.navigation.compose.hiltViewModel +import androidx.lifecycle.compose.collectAsStateWithLifecycle +import com.lgtm.android.common_ui.R +import com.lgtm.android.common_ui.components.buttons.BackButton +import com.lgtm.android.common_ui.model.SuggestionUI +import com.lgtm.android.common_ui.theme.LGTMTheme +import com.lgtm.android.common_ui.util.UiState +import com.lgtm.android.common_ui.util.throttleClickable import com.lgtm.android.mission_suggestion.ui.dashboard.SuggestionDashboardViewModel +import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.sdui.SuggestionContent +import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.sdui.SuggestionInfo +import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.sdui.SuggestionListEmpty +import com.lgtm.domain.mission_suggestion.SuggestionContent +import com.lgtm.domain.mission_suggestion.SuggestionHeaderVO +import com.lgtm.domain.mission_suggestion.SuggestionViewType + +const val LAZYCOLUMN_PADDING = 20 @Composable fun SuggestionDashboardScreen( viewModel: SuggestionDashboardViewModel = hiltViewModel() ) { - /* suggestionDashboard screen 정의 */ + val suggestionDashboardState: UiState> by viewModel.suggestionDashboardState.collectAsStateWithLifecycle() + + ConstraintLayout( + modifier = Modifier + .background(color = LGTMTheme.colors.gray_3) + .fillMaxSize() + ) { + val (suggestionSection, createBtn) = createRefs() + + Column( + modifier = Modifier.constrainAs(suggestionSection){ + top.linkTo(parent.top) + start.linkTo(parent.start) + end.linkTo(parent.end) + bottom.linkTo(parent.bottom) + } + ) { + SuggestionHeader{ viewModel.goBack() } + + when(suggestionDashboardState) { + is UiState.Init -> { /* no-op */ } + is UiState.Success -> { + SuggestionList( + modifier = Modifier + .layout { measurable, constraints -> + val placeable = measurable.measure(constraints.offset(vertical = LAZYCOLUMN_PADDING*2.dp.roundToPx())) + layout( + placeable.width, + placeable.height + ){ placeable.place(0, 0) } + }, + suggestionList = (suggestionDashboardState as UiState.Success).data, + onSuggestionClick = viewModel::moveToSuggestionDetail + ) + } + is UiState.Failure -> { /* no-op */ } + } + } + + CreateSuggestionButton( + modifier = Modifier.constrainAs(createBtn) { + bottom.linkTo(parent.bottom, margin = 25.dp) + start.linkTo(parent.start) + end.linkTo(parent.end) + }, + visibility = viewModel.createBtnVisibility + ) { viewModel.moveToCreateSuggestion() } + } +} + +/* 헤더 부분 */ +@Composable +fun SuggestionHeader( + modifier: Modifier = Modifier, + onBackButtonClick: () -> Unit +) { + ConstraintLayout( + modifier = modifier + .fillMaxWidth() + .background( + color = LGTMTheme.colors.white, + shape = RoundedCornerShape( + bottomStart = 20.dp, + bottomEnd = 20.dp + ) + ) + .shadow( + elevation = 1.dp, + shape = RoundedCornerShape( + bottomStart = 20.dp, + bottomEnd = 20.dp + ) + ) + .zIndex(1f) + ) { + val (backBtn, title) = createRefs() + + BackButton( + modifier = Modifier.constrainAs(backBtn) { + top.linkTo(parent.top, margin = 30.dp) + start.linkTo(parent.start, margin = 20.dp) + bottom.linkTo(parent.bottom, margin = 20.dp) + } + ) { onBackButtonClick() } + + Text( + modifier = Modifier.constrainAs(title) { + top.linkTo(parent.top) + start.linkTo(parent.start) + end.linkTo(parent.end) + bottom.linkTo(parent.bottom) + }, + text = stringResource(id = R.string.mission_recommendation), + color = LGTMTheme.colors.black, + style = LGTMTheme.typography.body1B + ) + } +} + +/* 미션 제안 리스트 부분 */ + +@Composable +fun SuggestionList( + modifier: Modifier = Modifier, + suggestionList: List, + onSuggestionClick: (Int) -> Unit +) { + LazyColumn( + modifier = modifier.fillMaxWidth(), + verticalArrangement = Arrangement.spacedBy(5.dp) + ) { + items(suggestionList.size) { index -> + // 첫 번째 요소 위에 Spacer 배치 + if (index == 0) { + Spacer(modifier = Modifier.height(25.dp)) + } + getSuggestionViewByType(suggestionList[index], onSuggestionClick) + // 마지막 요소 아래에 Spacer 배치 + if (index == suggestionList.size - 1) { + Spacer(modifier = Modifier.height(20.dp)) + } + } + } +} + +@Composable +fun getSuggestionViewByType( + suggestionContent: SuggestionContent, + onSuggestionClick: (Int) -> Unit +) { + when(suggestionContent.viewType) { + SuggestionViewType.HEADER -> SuggestionInfo(suggestionContent as SuggestionHeaderVO) + SuggestionViewType.CONTENT -> SuggestionContent(suggestionContent as SuggestionUI, onSuggestionClick) + SuggestionViewType.EMPTY -> SuggestionListEmpty() + } +} + +/* 미션 제안 생성 */ + +@Composable +fun CreateSuggestionButton( + modifier: Modifier = Modifier, + visibility: Boolean, + onCreateSuggestionClick: () -> Unit +) { + if (visibility) { + Box( + modifier = modifier + .fillMaxWidth() + .padding(horizontal = 20.dp) + .background( + color = LGTMTheme.colors.green, + shape = RoundedCornerShape(5.dp) + ) + .zIndex(10f) + .throttleClickable(true) { + onCreateSuggestionClick() + }, + contentAlignment = Alignment.Center, + ) { + Text( + modifier = Modifier + .padding(vertical = 14.dp), + text = stringResource(id = R.string.recommend_mission), + style = LGTMTheme.typography.body1M, + color = LGTMTheme.colors.black + ) + } + } } \ No newline at end of file From 4025d3c8a98181e1bcec0e12a6a8d17f9cca7e2e Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Sat, 30 Mar 2024 16:25:20 +0900 Subject: [PATCH 08/11] =?UTF-8?q?[FEAT]=20=EC=A2=8B=EC=95=84=EC=9A=94=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20suggestionDashboard=20viewModel=EC=97=90?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=20(#221)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/SuggestionDashboardViewModel.kt | 46 +++++++++++++++++-- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardViewModel.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardViewModel.kt index 6d43de03..dbf1aa49 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardViewModel.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardViewModel.kt @@ -6,6 +6,7 @@ import androidx.lifecycle.viewModelScope import com.google.firebase.crashlytics.ktx.crashlytics import com.google.firebase.ktx.Firebase import com.lgtm.android.common_ui.base.BaseViewModel +import com.lgtm.android.common_ui.model.SuggestionUI import com.lgtm.android.common_ui.model.mapper.toUiModel import com.lgtm.android.common_ui.util.UiState import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.contract.SuggestionDashboardInputs @@ -16,6 +17,7 @@ import com.lgtm.domain.mission_suggestion.SuggestionContent import com.lgtm.domain.mission_suggestion.SuggestionVO import com.lgtm.domain.mission_suggestion.SuggestionViewType import com.lgtm.domain.repository.AuthRepository +import com.lgtm.domain.repository.SuggestionRepository import com.lgtm.domain.usecase.SuggestionUseCase import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableSharedFlow @@ -28,6 +30,7 @@ import javax.inject.Inject @HiltViewModel class SuggestionDashboardViewModel @Inject constructor( private val suggestionUseCase: SuggestionUseCase, + private val suggestionRepository: SuggestionRepository, authRepository: AuthRepository ): BaseViewModel(), SuggestionDashboardInputs, SuggestionDashboardOutputs { @@ -41,6 +44,7 @@ class SuggestionDashboardViewModel @Inject constructor( override val suggestionDashboardUiEffect: SharedFlow get() = _suggestionDashboardUiEffect + /* 미션 제안 fetch 기능 */ fun fetchSuggestionList() { viewModelScope.launch(lgtmErrorHandler) { suggestionUseCase.getSuggestionList() @@ -63,14 +67,48 @@ class SuggestionDashboardViewModel @Inject constructor( } } - override fun likeSuggestion() { - TODO("Not yet implemented") + /* 미션 제안 좋아요 기능 */ + + override fun likeSuggestion(index: Int, suggestionId: Int) { + viewModelScope.launch(lgtmErrorHandler) { + suggestionRepository.likeSuggestion(suggestionId) + .onSuccess { + updateLikeState(index, it.likeNum, it.isLiked) + Log.d(TAG, "likeSuggestion: $it") + }.onFailure { + Firebase.crashlytics.recordException(it) + Log.e(TAG, "likeSuggestion: $it") + } + } } - override fun cancelLikeSuggestion() { - TODO("Not yet implemented") + override fun cancelLikeSuggestion(index: Int, suggestionId: Int) { + viewModelScope.launch(lgtmErrorHandler) { + suggestionRepository.cancelLikeSuggestion(suggestionId) + .onSuccess { + updateLikeState(index, it.likeNum, it.isLiked) + Log.d(TAG, "cancelLikeSuggestion: $it") + }.onFailure { + Firebase.crashlytics.recordException(it) + Log.e(TAG, "cancelLikeSuggestion: $it") + } + } } + private fun updateLikeState(index: Int, likeNum: String, isLike: Boolean) { + if (suggestionDashboardState.value is UiState.Success) { + val suggestions = (suggestionDashboardState.value as UiState.Success).data.toMutableList() + val suggestion = suggestions[index] as SuggestionUI + suggestions[index] = suggestion.copy( + likeNum = likeNum, + isLiked = isLike + ) + _suggestionDashboardState.value = UiState.Success(data = suggestions) + } + } + + /* uiEffect 핸들 */ + override fun moveToCreateSuggestion() { viewModelScope.launch(lgtmErrorHandler) { _suggestionDashboardUiEffect.emit(SuggestionDashboardUiEffect.CreateSuggestion) From df31c15d46da1eec6c56002ed84962ed5f522b1c Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Sat, 30 Mar 2024 16:25:45 +0900 Subject: [PATCH 09/11] =?UTF-8?q?[FEAT]=20suggestionDashboard=20=EC=A2=8B?= =?UTF-8?q?=EC=95=84=EC=9A=94=20=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84=20?= =?UTF-8?q?(#221)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/SuggestionDashboardActivity.kt | 4 ++++ .../presentation/SuggestionDashboardScreen.kt | 23 +++++++++++++------ .../contract/SuggestionDashboardInputs.kt | 4 ++-- .../presentation/sdui/SuggestionContent.kt | 16 ++++++++++--- 4 files changed, 35 insertions(+), 12 deletions(-) diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardActivity.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardActivity.kt index 71ce32af..240fafbe 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardActivity.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/SuggestionDashboardActivity.kt @@ -31,6 +31,10 @@ class SuggestionDashboardActivity : BaseComposeActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) observeUiEffect() + } + + override fun onResume() { + super.onResume() fetchSuggestionList() } diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt index 73002ac1..bcee06f6 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt @@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height @@ -55,12 +56,13 @@ fun SuggestionDashboardScreen( val (suggestionSection, createBtn) = createRefs() Column( - modifier = Modifier.constrainAs(suggestionSection){ + modifier = Modifier.fillMaxHeight().constrainAs(suggestionSection){ top.linkTo(parent.top) start.linkTo(parent.start) end.linkTo(parent.end) bottom.linkTo(parent.bottom) - } + }, + verticalArrangement = Arrangement.Top ) { SuggestionHeader{ viewModel.goBack() } @@ -77,7 +79,9 @@ fun SuggestionDashboardScreen( ){ placeable.place(0, 0) } }, suggestionList = (suggestionDashboardState as UiState.Success).data, - onSuggestionClick = viewModel::moveToSuggestionDetail + onSuggestionClick = viewModel::moveToSuggestionDetail, + onSuggestionLike = viewModel::likeSuggestion, + onSuggestionCancelLike = viewModel::cancelLikeSuggestion ) } is UiState.Failure -> { /* no-op */ } @@ -150,7 +154,9 @@ fun SuggestionHeader( fun SuggestionList( modifier: Modifier = Modifier, suggestionList: List, - onSuggestionClick: (Int) -> Unit + onSuggestionClick: (Int) -> Unit, + onSuggestionLike: (Int, Int) -> Unit, + onSuggestionCancelLike: (Int, Int) -> Unit ) { LazyColumn( modifier = modifier.fillMaxWidth(), @@ -161,7 +167,7 @@ fun SuggestionList( if (index == 0) { Spacer(modifier = Modifier.height(25.dp)) } - getSuggestionViewByType(suggestionList[index], onSuggestionClick) + getSuggestionViewByType(index, suggestionList[index], onSuggestionClick, onSuggestionLike, onSuggestionCancelLike) // 마지막 요소 아래에 Spacer 배치 if (index == suggestionList.size - 1) { Spacer(modifier = Modifier.height(20.dp)) @@ -172,12 +178,15 @@ fun SuggestionList( @Composable fun getSuggestionViewByType( + index: Int, suggestionContent: SuggestionContent, - onSuggestionClick: (Int) -> Unit + onSuggestionClick: (Int) -> Unit, + onSuggestionLike: (Int, Int) -> Unit, + onSuggestionCancelLike: (Int, Int) -> Unit ) { when(suggestionContent.viewType) { SuggestionViewType.HEADER -> SuggestionInfo(suggestionContent as SuggestionHeaderVO) - SuggestionViewType.CONTENT -> SuggestionContent(suggestionContent as SuggestionUI, onSuggestionClick) + SuggestionViewType.CONTENT -> SuggestionContent(index, suggestionContent as SuggestionUI, onSuggestionClick, onSuggestionLike, onSuggestionCancelLike) SuggestionViewType.EMPTY -> SuggestionListEmpty() } } diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/contract/SuggestionDashboardInputs.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/contract/SuggestionDashboardInputs.kt index cde4ecfe..971049c3 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/contract/SuggestionDashboardInputs.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/contract/SuggestionDashboardInputs.kt @@ -1,8 +1,8 @@ package com.lgtm.android.mission_suggestion.ui.dashboard.presentation.contract interface SuggestionDashboardInputs { - fun likeSuggestion() - fun cancelLikeSuggestion() + fun likeSuggestion(index: Int, suggestionId: Int) + fun cancelLikeSuggestion(index: Int, suggestionId: Int) fun moveToCreateSuggestion() fun moveToSuggestionDetail(suggestionId: Int) fun goBack() diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggestionContent.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggestionContent.kt index 3deb227e..96169799 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggestionContent.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggestionContent.kt @@ -23,8 +23,11 @@ import com.lgtm.android.common_ui.util.throttleClickable @Composable fun SuggestionContent( + index: Int, suggestionUI: SuggestionUI, - onSuggestionClick: (Int) -> Unit + onSuggestionClick: (Int) -> Unit, + onSuggestionLike: (Int, Int) -> Unit, + onSuggestionCancelLike: (Int, Int) -> Unit ) { Column( modifier = Modifier @@ -42,7 +45,10 @@ fun SuggestionContent( horizontal = 20.dp, vertical = 16.dp ) - .throttleClickable(true) { onSuggestionClick(suggestionUI.suggestionId) } + .throttleClickable( + enabled = true, + onClick = { onSuggestionClick(suggestionUI.suggestionId) } + ) ) { Text( text = suggestionUI.title, @@ -74,7 +80,11 @@ fun SuggestionContent( ) { DateTimeText(date = suggestionUI.date, time = suggestionUI.time) LikeButton(likeNum = suggestionUI.likeNum, isLiked = suggestionUI.isLiked) { - + if (suggestionUI.isLiked) { + onSuggestionCancelLike(index, suggestionUI.suggestionId) + } else { + onSuggestionLike(index, suggestionUI.suggestionId) + } } } From c3c88171d5826e3efc185282014349e95b4080fa Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Sat, 30 Mar 2024 16:32:59 +0900 Subject: [PATCH 10/11] =?UTF-8?q?[FEAT]=20suggestionList=EC=97=90=20fillMa?= =?UTF-8?q?xHeight=20=EC=A0=81=EC=9A=A9=20(#221)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/dashboard/presentation/SuggestionDashboardScreen.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt index bcee06f6..b88de156 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt @@ -71,6 +71,7 @@ fun SuggestionDashboardScreen( is UiState.Success -> { SuggestionList( modifier = Modifier + .fillMaxHeight() .layout { measurable, constraints -> val placeable = measurable.measure(constraints.offset(vertical = LAZYCOLUMN_PADDING*2.dp.roundToPx())) layout( From ddda5ed5e3f0f39701bca11ef084b48cfd9e2a07 Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Sat, 30 Mar 2024 16:35:18 +0900 Subject: [PATCH 11/11] =?UTF-8?q?[FEAT]=20=EB=A9=80=ED=8B=B0=20=EB=B7=B0?= =?UTF-8?q?=ED=83=80=EC=9E=85=20=ED=8F=B4=EB=8D=94=20sdui=20->=20item?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=9B=8C=EB=94=A9=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?(#221)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/dashboard/presentation/SuggestionDashboardScreen.kt | 6 +++--- .../presentation/{sdui => item}/SuggestionContent.kt | 2 +- .../dashboard/presentation/{sdui => item}/SuggestionInfo.kt | 2 +- .../presentation/{sdui => item}/SuggstionListEmpty.kt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) rename feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/{sdui => item}/SuggestionContent.kt (99%) rename feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/{sdui => item}/SuggestionInfo.kt (99%) rename feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/{sdui => item}/SuggstionListEmpty.kt (99%) diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt index b88de156..eaa694d9 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/SuggestionDashboardScreen.kt @@ -33,9 +33,9 @@ import com.lgtm.android.common_ui.theme.LGTMTheme import com.lgtm.android.common_ui.util.UiState import com.lgtm.android.common_ui.util.throttleClickable import com.lgtm.android.mission_suggestion.ui.dashboard.SuggestionDashboardViewModel -import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.sdui.SuggestionContent -import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.sdui.SuggestionInfo -import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.sdui.SuggestionListEmpty +import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.item.SuggestionContent +import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.item.SuggestionInfo +import com.lgtm.android.mission_suggestion.ui.dashboard.presentation.item.SuggestionListEmpty import com.lgtm.domain.mission_suggestion.SuggestionContent import com.lgtm.domain.mission_suggestion.SuggestionHeaderVO import com.lgtm.domain.mission_suggestion.SuggestionViewType diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggestionContent.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/item/SuggestionContent.kt similarity index 99% rename from feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggestionContent.kt rename to feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/item/SuggestionContent.kt index 96169799..97deee55 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggestionContent.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/item/SuggestionContent.kt @@ -1,4 +1,4 @@ -package com.lgtm.android.mission_suggestion.ui.dashboard.presentation.sdui +package com.lgtm.android.mission_suggestion.ui.dashboard.presentation.item import androidx.compose.foundation.background import androidx.compose.foundation.border diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggestionInfo.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/item/SuggestionInfo.kt similarity index 99% rename from feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggestionInfo.kt rename to feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/item/SuggestionInfo.kt index 96e5c3e0..4262806e 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggestionInfo.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/item/SuggestionInfo.kt @@ -1,4 +1,4 @@ -package com.lgtm.android.mission_suggestion.ui.dashboard.presentation.sdui +package com.lgtm.android.mission_suggestion.ui.dashboard.presentation.item import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column diff --git a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggstionListEmpty.kt b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/item/SuggstionListEmpty.kt similarity index 99% rename from feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggstionListEmpty.kt rename to feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/item/SuggstionListEmpty.kt index 352d6d9e..84b46f1a 100644 --- a/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/sdui/SuggstionListEmpty.kt +++ b/feature/mission_suggestion/src/main/java/com/lgtm/android/mission_suggestion/ui/dashboard/presentation/item/SuggstionListEmpty.kt @@ -1,4 +1,4 @@ -package com.lgtm.android.mission_suggestion.ui.dashboard.presentation.sdui +package com.lgtm.android.mission_suggestion.ui.dashboard.presentation.item import androidx.compose.foundation.Image import androidx.compose.foundation.background