diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ffe80bf0..f72dfcdb 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -24,15 +24,15 @@ tools:targetApi="31"> + android:value="@string/native_app_key" /> + android:windowSoftInputMode="adjustResize"> @@ -40,14 +40,17 @@ - + - diff --git a/core/design-system/src/main/res/drawable/img_agency_feedback.png b/core/design-system/src/main/res/drawable/img_agency_feedback.png new file mode 100644 index 00000000..e1795fe0 Binary files /dev/null and b/core/design-system/src/main/res/drawable/img_agency_feedback.png differ diff --git a/core/design-system/src/main/res/drawable/img_kakao_feedback.png b/core/design-system/src/main/res/drawable/img_kakao_feedback.png new file mode 100644 index 00000000..405006c8 Binary files /dev/null and b/core/design-system/src/main/res/drawable/img_kakao_feedback.png differ diff --git a/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchScreen.kt b/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchScreen.kt index 8796ae61..8e3592d9 100644 --- a/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchScreen.kt +++ b/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchScreen.kt @@ -1,5 +1,7 @@ package com.moneymong.moneymong.feature.agency.search +import android.content.Intent +import android.net.Uri import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -18,6 +20,7 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp @@ -36,12 +39,13 @@ import com.moneymong.moneymong.design_system.component.tooltip.MDSToolTipPositio import com.moneymong.moneymong.design_system.error.ErrorDialog import com.moneymong.moneymong.design_system.error.ErrorItem import com.moneymong.moneymong.design_system.error.ErrorScreen -import com.moneymong.moneymong.design_system.theme.Body4 +import com.moneymong.moneymong.design_system.theme.Body3 import com.moneymong.moneymong.design_system.theme.Gray01 -import com.moneymong.moneymong.design_system.theme.Gray08 +import com.moneymong.moneymong.design_system.theme.Gray07 import com.moneymong.moneymong.design_system.theme.MMHorizontalSpacing import com.moneymong.moneymong.design_system.theme.Red03 import com.moneymong.moneymong.feature.agency.search.component.AgencySearchTopBar +import com.moneymong.moneymong.feature.agency.search.item.AgencyFeedbackItem import com.moneymong.moneymong.feature.agency.search.item.AgencyItem import org.orbitmvi.orbit.compose.collectAsState import org.orbitmvi.orbit.compose.collectSideEffect @@ -54,6 +58,7 @@ fun AgencySearchScreen( navigateAgencyJoin: (agencyId: Long) -> Unit ) { val state by viewModel.collectAsState() + val context = LocalContext.current val pagingItems = viewModel.agencies.collectAsLazyPagingItems() viewModel.collectSideEffect { @@ -65,6 +70,11 @@ fun AgencySearchScreen( is AgencySearchSideEffect.NavigateToAgencyJoin -> { navigateAgencyJoin(it.agencyId) } + + is AgencySearchSideEffect.FollowAsk -> { + val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://asked.kr/moneymong")) + context.startActivity(intent) + } } } @@ -99,6 +109,7 @@ fun AgencySearchScreen( viewModel.navigateToJoin(agencyId) } }, + onClickFeedbackItem = viewModel::onClickAskFeedback, isLoading = state.isLoading, isError = state.isError, errorMessage = state.errorMessage, @@ -132,6 +143,7 @@ private fun AgencySearchContentView( modifier: Modifier = Modifier, pagingItems: LazyPagingItems, onClickItem: (agencyId: Long) -> Unit, + onClickFeedbackItem: () -> Unit, isLoading: Boolean, isError: Boolean, errorMessage: String, @@ -159,13 +171,15 @@ private fun AgencySearchContentView( if (pagingItems.itemCount == 0) { ContentViewWithoutAgencies( modifier = modifier, - pagingItems = pagingItems + pagingItems = pagingItems, + onClickFeedbackItem = onClickFeedbackItem ) } else { ContentViewWithAgencies( modifier = modifier, pagingItems = pagingItems, - onClickItem = onClickItem + onClickItem = onClickItem, + onClickFeedbackItem = onClickFeedbackItem ) } } @@ -176,13 +190,19 @@ private fun AgencySearchContentView( private fun ContentViewWithAgencies( modifier: Modifier = Modifier, pagingItems: LazyPagingItems, - onClickItem: (agencyId: Long) -> Unit + onClickItem: (agencyId: Long) -> Unit, + onClickFeedbackItem: () -> Unit ) { LazyColumn( modifier = modifier, verticalArrangement = Arrangement.spacedBy(12.dp), contentPadding = PaddingValues(vertical = 4.dp) ) { + item { + AgencyFeedbackItem( + onClick = onClickFeedbackItem + ) + } items( count = pagingItems.itemCount, key = pagingItems.itemKey { it.id } ) { @@ -221,6 +241,7 @@ private fun ContentViewWithAgencies( private fun ContentViewWithoutAgencies( modifier: Modifier = Modifier, pagingItems: LazyPagingItems, + onClickFeedbackItem: () -> Unit ) { when (pagingItems.loadState.refresh) { @@ -238,25 +259,33 @@ private fun ContentViewWithoutAgencies( } is LoadState.NotLoading -> { - Column( - modifier = modifier, - verticalArrangement = Arrangement.spacedBy( - space = 8.dp, - alignment = Alignment.CenterVertically - ), - horizontalAlignment = Alignment.CenterHorizontally - ) { - Image( - modifier = Modifier.size(size = 80.dp), - painter = painterResource(id = R.drawable.img_agency), - contentDescription = "agency image", - ) - Text( - text = "아직 등록된 소속이 없어요\n하단 버튼을 통해 등록해보세요", - textAlign = TextAlign.Center, - color = Gray08, - style = Body4 + Box(modifier = Modifier.fillMaxSize()) { + AgencyFeedbackItem( + modifier = Modifier + .align(Alignment.TopCenter) + .padding(top = 10.dp), + onClick = onClickFeedbackItem ) + Column( + modifier = modifier.fillMaxSize(), + verticalArrangement = Arrangement.spacedBy( + space = 4.dp, + alignment = Alignment.CenterVertically + ), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Image( + modifier = Modifier.size(size = 80.dp), + painter = painterResource(id = R.drawable.img_agency), + contentDescription = "agency image", + ) + Text( + text = "아직 등록된 소속이 없어요\n하단 버튼을 통해 등록해보세요", + textAlign = TextAlign.Center, + color = Gray07, + style = Body3 + ) + } } } } diff --git a/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchSideEffect.kt b/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchSideEffect.kt index 4934e6e8..84fd3c20 100644 --- a/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchSideEffect.kt +++ b/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchSideEffect.kt @@ -5,4 +5,5 @@ import com.moneymong.moneymong.common.base.SideEffect sealed interface AgencySearchSideEffect : SideEffect { data class NavigateToRegister(val isUniversityStudent: Boolean) : AgencySearchSideEffect data class NavigateToAgencyJoin(val agencyId: Long) : AgencySearchSideEffect + data object FollowAsk : AgencySearchSideEffect } \ No newline at end of file diff --git a/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchViewModel.kt b/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchViewModel.kt index c27bcd1e..0f7ff711 100644 --- a/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchViewModel.kt +++ b/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchViewModel.kt @@ -87,4 +87,6 @@ class AgencySearchViewModel @Inject constructor( state.copy(visibleWarningDialog = visible) } } + + fun onClickAskFeedback() = eventEmit(AgencySearchSideEffect.FollowAsk) } \ No newline at end of file diff --git a/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/item/AgencyFeedbackItem.kt b/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/item/AgencyFeedbackItem.kt new file mode 100644 index 00000000..ddcd7e40 --- /dev/null +++ b/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/item/AgencyFeedbackItem.kt @@ -0,0 +1,87 @@ +package com.moneymong.moneymong.feature.agency.search.item + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Brush +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.moneymong.moneymong.design_system.theme.Body4 +import com.moneymong.moneymong.design_system.theme.White +import com.moneymong.moneymong.design_system.R +import com.moneymong.moneymong.design_system.theme.Blue04 +import com.moneymong.moneymong.design_system.theme.Body2 +import com.moneymong.moneymong.design_system.theme.SkyBlue01 + +@Composable +fun AgencyFeedbackItem( + modifier: Modifier = Modifier, + onClick: () -> Unit +) { + val colorStops = arrayOf( + 0.0f to Color(0xFF9181F6), + 0.31f to Color(0xFF5562FF), + 0.67f to Color(0xFFC7C2FF), + 1f to Color(0xFFC4EAFF) + ) + + Row( + modifier = modifier + .fillMaxWidth() + .clip(RoundedCornerShape(16.dp)) + .background(Brush.horizontalGradient(colorStops = colorStops)) + .clickable { onClick() } + .padding(horizontal = 18.dp, vertical = 16.dp), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.Center + ) { + Text( + text = "머니몽에게 의견 제안하기", + style = Body4, + color = White + ) + Spacer(modifier = Modifier.width(2.dp)) + Image( + modifier = Modifier.size(36.dp), + painter = painterResource(id = R.drawable.img_agency_feedback), + contentDescription = null + ) + Spacer(modifier = Modifier.width(2.dp)) + Box( + modifier = Modifier + .clip(RoundedCornerShape(100.dp)) + .background(SkyBlue01) + ) { + Text( + modifier = Modifier.padding(horizontal = 8.dp, vertical = 6.dp), + text = "스벅 기프티콘", + style = Body2, + color = Blue04 + ) + } + } +} + +@Preview(showBackground = true) +@Composable +fun AgencyFeedbackItemPreview() { + AgencyFeedbackItem { + } +} \ No newline at end of file diff --git a/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/MyMongScreen.kt b/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/MyMongScreen.kt index c4bb3f91..74d1a373 100644 --- a/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/MyMongScreen.kt +++ b/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/MyMongScreen.kt @@ -1,5 +1,7 @@ package com.moneymong.moneymong.feature.mymong.main +import android.content.Intent +import android.net.Uri import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer @@ -12,6 +14,7 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import com.moneymong.moneymong.design_system.R @@ -20,6 +23,7 @@ import com.moneymong.moneymong.design_system.error.ErrorDialog import com.moneymong.moneymong.design_system.theme.Gray01 import com.moneymong.moneymong.design_system.theme.MMHorizontalSpacing import com.moneymong.moneymong.feature.mymong.main.component.MyMongTopBar +import com.moneymong.moneymong.feature.mymong.main.view.MyMongFeedbackView import com.moneymong.moneymong.feature.mymong.main.view.MyMongInfoView import com.moneymong.moneymong.feature.mymong.main.view.MyMongSettingView import org.orbitmvi.orbit.compose.collectAsState @@ -35,6 +39,7 @@ fun MyMongScreen( navigateToLogin: () -> Unit, ) { val state by viewModel.collectAsState() + val context = LocalContext.current viewModel.collectSideEffect { when (it) { @@ -53,6 +58,11 @@ fun MyMongScreen( is MyMongSideEffect.NavigateToLogin -> { navigateToLogin() } + + is MyMongSideEffect.FollowKakaoChannel -> { + val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://pf.kakao.com/_zDsyG")) + context.startActivity(intent) + } } } @@ -94,7 +104,11 @@ fun MyMongScreen( grade = state.grade, getInfo = viewModel::getInfo ) - Spacer(modifier = Modifier.height(24.dp)) + Spacer(modifier = Modifier.height(16.dp)) + MyMongFeedbackView( + onClick = viewModel::onClickKakaoChannel + ) + Spacer(modifier = Modifier.height(16.dp)) MyMongSettingView( navigateToTermsOfUse = viewModel::navigateToTermsOfUse, navigateToPrivacyPolicy = viewModel::navigateToPriPolicyButton, @@ -102,4 +116,4 @@ fun MyMongScreen( showLogoutDialog = { viewModel.changeLogoutDialogVisibility(true) } ) } -} +} \ No newline at end of file diff --git a/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/MyMongSideEffect.kt b/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/MyMongSideEffect.kt index 3546c0ba..6b53802e 100644 --- a/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/MyMongSideEffect.kt +++ b/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/MyMongSideEffect.kt @@ -7,4 +7,5 @@ sealed interface MyMongSideEffect : SideEffect { data object NavigateToPrivacyPolicy : MyMongSideEffect data object NavigateToTermsOfUse : MyMongSideEffect data object NavigateToLogin : MyMongSideEffect + data object FollowKakaoChannel : MyMongSideEffect } \ No newline at end of file diff --git a/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/MyMongViewModel.kt b/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/MyMongViewModel.kt index 83f225cb..a93db28e 100644 --- a/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/MyMongViewModel.kt +++ b/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/MyMongViewModel.kt @@ -94,6 +94,8 @@ class MyMongViewModel @Inject constructor( } } + fun onClickKakaoChannel() = eventEmit(MyMongSideEffect.FollowKakaoChannel) + private suspend fun clearLocalData() { saveAgencyIdUseCase(0) saveUserIdUseCase(0) diff --git a/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/view/MyMongFeedbackView.kt b/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/view/MyMongFeedbackView.kt new file mode 100644 index 00000000..907f7e5c --- /dev/null +++ b/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/view/MyMongFeedbackView.kt @@ -0,0 +1,80 @@ +package com.moneymong.moneymong.feature.mymong.main.view + +import androidx.compose.foundation.Image +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.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.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.text.font.FontWeight +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.moneymong.moneymong.design_system.component.button.MDSButton +import com.moneymong.moneymong.design_system.component.button.MDSButtonSize +import com.moneymong.moneymong.design_system.component.button.MDSButtonType +import com.moneymong.moneymong.design_system.theme.Body4 +import com.moneymong.moneymong.design_system.theme.Gray08 +import com.moneymong.moneymong.design_system.R +import com.moneymong.moneymong.design_system.theme.White +import com.moneymong.moneymong.feature.mymong.main.util.myMongRoundRectShadow + +@Composable +fun MyMongFeedbackView( + modifier: Modifier = Modifier, + onClick: () -> Unit +) { + Box( + modifier = modifier + .myMongRoundRectShadow() + .background(color = White, shape = RoundedCornerShape(16.dp)) + ) { + Row( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 16.dp), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween + ) { + Column { + Text( + text = "머니몽에게 자유롭게\n문의 해보세요!", + style = Body4.copy(fontWeight = FontWeight.Bold), + color = Gray08 + ) + Spacer(modifier = Modifier.height(8.dp)) + MDSButton( + modifier = Modifier.padding(end = 10.dp), + text = "머니몽 팀에게 카톡하기", + size = MDSButtonSize.SMALL, + type = MDSButtonType.SECONDARY, + contentHorizontalPadding = 12.dp, + onClick = onClick + ) + } + Image( + modifier = Modifier.size(134.dp), + painter = painterResource(id = R.drawable.img_kakao_feedback), + contentDescription = null + ) + } + } +} + +@Preview(showBackground = true) +@Composable +fun MyMongFeedbackPreview() { + MyMongFeedbackView { + + } +} \ No newline at end of file diff --git a/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/view/MyMongSettingView.kt b/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/view/MyMongSettingView.kt index 4142be59..6e2f6865 100644 --- a/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/view/MyMongSettingView.kt +++ b/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/view/MyMongSettingView.kt @@ -51,12 +51,6 @@ internal fun MyMongSettingView( }.versionName Column(modifier = modifier.fillMaxWidth()) { - Text( - text = "내 설정", - color = Gray10, - style = Body4 - ) - Spacer(modifier = Modifier.height(8.dp)) Column( modifier = Modifier .fillMaxWidth()