Skip to content

Commit

Permalink
Merge pull request #31 from MONEYMONG/feature/moneymong-502-피드백-링크-추가
Browse files Browse the repository at this point in the history
Feature/moneymong 502 피드백 링크 추가
  • Loading branch information
Heonbyeong authored Aug 23, 2024
2 parents 0fd31b4 + 4782af1 commit dfbaba3
Show file tree
Hide file tree
Showing 12 changed files with 249 additions and 36 deletions.
13 changes: 8 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,33 @@
tools:targetApi="31">
<meta-data
android:name="com.kakao.sdk.AppKey"
android:value="@string/native_app_key"/>
android:value="@string/native_app_key" />

<activity
android:name=".MainActivity"
android:exported="true"
android:label="${appLabel}"
android:windowSoftInputMode="adjustResize"
android:screenOrientation="portrait"
android:theme="@style/Theme.Moneymongandroid"
android:screenOrientation="portrait">
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
<activity
android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:host="oauth"
<data
android:host="oauth"
android:scheme="@string/kakao_native_app_key" />
</intent-filter>

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 {
Expand All @@ -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)
}
}
}

Expand Down Expand Up @@ -99,6 +109,7 @@ fun AgencySearchScreen(
viewModel.navigateToJoin(agencyId)
}
},
onClickFeedbackItem = viewModel::onClickAskFeedback,
isLoading = state.isLoading,
isError = state.isError,
errorMessage = state.errorMessage,
Expand Down Expand Up @@ -132,6 +143,7 @@ private fun AgencySearchContentView(
modifier: Modifier = Modifier,
pagingItems: LazyPagingItems<Agency>,
onClickItem: (agencyId: Long) -> Unit,
onClickFeedbackItem: () -> Unit,
isLoading: Boolean,
isError: Boolean,
errorMessage: String,
Expand Down Expand Up @@ -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
)
}
}
Expand All @@ -176,13 +190,19 @@ private fun AgencySearchContentView(
private fun ContentViewWithAgencies(
modifier: Modifier = Modifier,
pagingItems: LazyPagingItems<Agency>,
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 }
) {
Expand Down Expand Up @@ -221,6 +241,7 @@ private fun ContentViewWithAgencies(
private fun ContentViewWithoutAgencies(
modifier: Modifier = Modifier,
pagingItems: LazyPagingItems<Agency>,
onClickFeedbackItem: () -> Unit
) {

when (pagingItems.loadState.refresh) {
Expand All @@ -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
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,6 @@ class AgencySearchViewModel @Inject constructor(
state.copy(visibleWarningDialog = visible)
}
}

fun onClickAskFeedback() = eventEmit(AgencySearchSideEffect.FollowAsk)
}
Original file line number Diff line number Diff line change
@@ -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 {
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -35,6 +39,7 @@ fun MyMongScreen(
navigateToLogin: () -> Unit,
) {
val state by viewModel.collectAsState()
val context = LocalContext.current

viewModel.collectSideEffect {
when (it) {
Expand All @@ -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)
}
}
}

Expand Down Expand Up @@ -94,12 +104,16 @@ 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,
navigateToWithdrawal = viewModel::navigateToWithdrawal,
showLogoutDialog = { viewModel.changeLogoutDialogVisibility(true) }
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ sealed interface MyMongSideEffect : SideEffect {
data object NavigateToPrivacyPolicy : MyMongSideEffect
data object NavigateToTermsOfUse : MyMongSideEffect
data object NavigateToLogin : MyMongSideEffect
data object FollowKakaoChannel : MyMongSideEffect
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ class MyMongViewModel @Inject constructor(
}
}

fun onClickKakaoChannel() = eventEmit(MyMongSideEffect.FollowKakaoChannel)

private suspend fun clearLocalData() {
saveAgencyIdUseCase(0)
saveUserIdUseCase(0)
Expand Down
Loading

0 comments on commit dfbaba3

Please sign in to comment.