diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index dd7193698..77a3af4d2 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -18,20 +18,6 @@
android:usesCleartextTraffic="true"
tools:targetApi="31">
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/feature/src/main/ic_terning_launcher-playstore.png b/feature/src/main/ic_terning_launcher-playstore.png
deleted file mode 100644
index b26ab08db..000000000
Binary files a/feature/src/main/ic_terning_launcher-playstore.png and /dev/null differ
diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt
index 10f4479af..e6a88254b 100644
--- a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt
+++ b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt
@@ -1,5 +1,7 @@
package com.terning.feature.mypage.mypage
+import android.content.Context
+import androidx.browser.customtabs.CustomTabsIntent
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
@@ -25,6 +27,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
+import androidx.core.net.toUri
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.LocalLifecycleOwner
import androidx.lifecycle.compose.collectAsStateWithLifecycle
@@ -46,6 +49,11 @@ import com.terning.core.state.UiState
import com.terning.feature.R
import com.terning.feature.mypage.component.MyPageProfile
import com.terning.feature.mypage.mypage.component.MyPageItem
+import com.terning.feature.mypage.mypage.util.MyPageDefaults.NOTICE_URL
+import com.terning.feature.mypage.mypage.util.MyPageDefaults.OPINION_URL
+import com.terning.feature.mypage.mypage.util.MyPageDefaults.PERSONAL_URL
+import com.terning.feature.mypage.mypage.util.MyPageDefaults.SERVICE_URL
+import com.terning.feature.mypage.mypage.util.MyPageDefaults.VERSION
@Composable
fun MyPageRoute(
@@ -73,7 +81,7 @@ fun MyPageRoute(
}
}
- LaunchedEffect(true) {
+ LaunchedEffect(key1 = true) {
viewModel.getProfile()
}
@@ -87,6 +95,12 @@ fun MyPageRoute(
)
is MyPageSideEffect.ShowToast -> context.toast(sideEffect.message)
+ is MyPageSideEffect.NavigateToNoticeWebView -> navigateToNoticeWebView(context)
+ is MyPageSideEffect.NavigateToOpinionWebView -> navigateToOpinionWebView(context)
+ is MyPageSideEffect.NavigateToServiceWebView -> navigateToServiceWebView(context)
+ is MyPageSideEffect.NavigateToPersonalWebView -> navigateToPersonalWebView(
+ context
+ )
}
}
}
@@ -123,13 +137,13 @@ fun MyPageRoute(
is UiState.Success -> {
MyPageScreen(
paddingValues = paddingValues,
- onEditClick = { viewModel.navigateToProfileEdit() },
+ onEditClick = viewModel::navigateToProfileEdit,
onLogoutClick = { viewModel.fetchShowLogoutBottomSheet(true) },
onQuitClick = { viewModel.fetchShowQuitBottomSheet(true) },
onNoticeClick = { viewModel.fetchShowNotice(true) },
onOpinionClick = { viewModel.fetchShowOpinion(true) },
- onServiceClick = {},
- onPersonalClick = {},
+ onServiceClick = { viewModel.fetchShowService(true) },
+ onPersonalClick = { viewModel.fetchShowPersonal(true) },
name = state.name,
profileImage = state.profileImage
)
@@ -145,15 +159,14 @@ fun MyPageRoute(
}
}
- if (state.showNotice) {
- viewModel.navigateToNoticeWebView(context)
- viewModel.fetchShowNotice(false)
- }
+ if (state.showNotice) viewModel.fetchShowNotice(false)
+
+ if (state.showOpinion) viewModel.fetchShowOpinion(false)
+
+ if (state.showService) viewModel.fetchShowService(false)
+
+ if (state.showPersonal) viewModel.fetchShowPersonal(false)
- if (state.showOpinion) {
- viewModel.navigateToOpinionWebView(context)
- viewModel.fetchShowOpinion(false)
- }
}
@Composable
@@ -385,7 +398,21 @@ fun ServiceInfo(
}
}
-private const val VERSION = "1.0.2"
+private fun navigateToNoticeWebView(context: Context) {
+ CustomTabsIntent.Builder().build().launchUrl(context, NOTICE_URL.toUri())
+}
+
+private fun navigateToOpinionWebView(context: Context) {
+ CustomTabsIntent.Builder().build().launchUrl(context, OPINION_URL.toUri())
+}
+
+private fun navigateToServiceWebView(context: Context) {
+ CustomTabsIntent.Builder().build().launchUrl(context, SERVICE_URL.toUri())
+}
+
+private fun navigateToPersonalWebView(context: Context) {
+ CustomTabsIntent.Builder().build().launchUrl(context, PERSONAL_URL.toUri())
+}
@Preview(showBackground = true)
@Composable
diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageSideEffect.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageSideEffect.kt
index edeb627ea..fa8f43cf1 100644
--- a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageSideEffect.kt
+++ b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageSideEffect.kt
@@ -4,5 +4,9 @@ import androidx.annotation.StringRes
sealed class MyPageSideEffect {
data object NavigateToProfileEdit : MyPageSideEffect()
+ data object NavigateToNoticeWebView : MyPageSideEffect()
+ data object NavigateToOpinionWebView : MyPageSideEffect()
+ data object NavigateToServiceWebView : MyPageSideEffect()
+ data object NavigateToPersonalWebView : MyPageSideEffect()
data class ShowToast(@StringRes val message: Int) : MyPageSideEffect()
}
\ No newline at end of file
diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageState.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageState.kt
index 24f76c1ae..921031d8c 100644
--- a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageState.kt
+++ b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageState.kt
@@ -7,9 +7,11 @@ data class MyPageState(
val isGetSuccess: UiState = UiState.Loading,
val name: String = "",
val profileImage: String = "",
- val authType : String ="",
+ val authType: String = "",
val showNotice: Boolean = false,
val showOpinion: Boolean = false,
- val showLogoutBottomSheet : Boolean = false,
- val showQuitBottomSheet : Boolean = false,
+ val showService: Boolean = false,
+ val showPersonal: Boolean = false,
+ val showLogoutBottomSheet: Boolean = false,
+ val showQuitBottomSheet: Boolean = false,
)
\ No newline at end of file
diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageViewModel.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageViewModel.kt
index 485419852..1bec5979f 100644
--- a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageViewModel.kt
+++ b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageViewModel.kt
@@ -4,8 +4,6 @@ import android.content.Context
import android.content.Intent
import android.os.Handler
import android.os.Looper
-import androidx.browser.customtabs.CustomTabsIntent
-import androidx.core.net.toUri
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.jakewharton.processphoenix.ProcessPhoenix
@@ -112,39 +110,42 @@ class MyPageViewModel @Inject constructor(
}
fun fetchShowNotice(show: Boolean) {
- _state.value = _state.value.copy(showNotice = show)
+ viewModelScope.launch {
+ _sideEffects.emit(MyPageSideEffect.NavigateToNoticeWebView)
+ _state.value = _state.value.copy(showNotice = show)
+ }
}
fun fetchShowOpinion(show: Boolean) {
- _state.value = _state.value.copy(showOpinion = show)
+ viewModelScope.launch {
+ _sideEffects.emit(MyPageSideEffect.NavigateToOpinionWebView)
+ _state.value = _state.value.copy(showOpinion = show)
+ }
}
- fun fetchShowLogoutBottomSheet(show: Boolean) {
- _state.value = _state.value.copy(showLogoutBottomSheet = show)
+ fun fetchShowService(show: Boolean) {
+ viewModelScope.launch {
+ _sideEffects.emit(MyPageSideEffect.NavigateToServiceWebView)
+ _state.value = _state.value.copy(showService = show)
+ }
}
- fun fetchShowQuitBottomSheet(show: Boolean) {
- _state.value = _state.value.copy(showQuitBottomSheet = show)
+ fun fetchShowPersonal(show: Boolean) {
+ viewModelScope.launch {
+ _sideEffects.emit(MyPageSideEffect.NavigateToPersonalWebView)
+ _state.value = _state.value.copy(showPersonal = show)
+ }
}
- fun navigateToNoticeWebView(context: Context) {
- val url = NOTICE_URL.toUri()
- val customTabsIntent = CustomTabsIntent.Builder().build()
- customTabsIntent.launchUrl(context, url)
+ fun fetchShowLogoutBottomSheet(show: Boolean) {
+ _state.value = _state.value.copy(showLogoutBottomSheet = show)
}
- fun navigateToOpinionWebView(context: Context) {
- val url = OPINION_URL.toUri()
- val customTabsIntent = CustomTabsIntent.Builder().build()
- customTabsIntent.launchUrl(context, url)
+ fun fetchShowQuitBottomSheet(show: Boolean) {
+ _state.value = _state.value.copy(showQuitBottomSheet = show)
}
fun navigateToProfileEdit() =
viewModelScope.launch { _sideEffects.emit(MyPageSideEffect.NavigateToProfileEdit) }
- companion object {
- private const val NOTICE_URL =
- "https://abundant-quiver-13f.notion.site/69109213e7db4873be6b9600f2f5163a"
- private const val OPINION_URL = "https://forms.gle/AaLpVptfg6cATYWa7"
- }
}
\ No newline at end of file
diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/component/MyPageItem.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/component/MyPageItem.kt
index ca15cd033..ff272a144 100644
--- a/feature/src/main/java/com/terning/feature/mypage/mypage/component/MyPageItem.kt
+++ b/feature/src/main/java/com/terning/feature/mypage/mypage/component/MyPageItem.kt
@@ -12,6 +12,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.terning.core.designsystem.component.image.TerningImage
+import com.terning.core.designsystem.theme.Grey350
import com.terning.core.designsystem.theme.TerningPointTheme
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.extension.noRippleClickable
@@ -51,7 +52,8 @@ fun MyPageItem(
Text(
text = version,
modifier = modifier.padding(end = 16.dp),
- style = TerningTheme.typography.button4
+ style = TerningTheme.typography.button4,
+ color = Grey350
)
else TerningImage(painter = R.drawable.ic_my_page_go_detail)
}
diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/util/MyPageDefaults.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/util/MyPageDefaults.kt
new file mode 100644
index 000000000..27900ee20
--- /dev/null
+++ b/feature/src/main/java/com/terning/feature/mypage/mypage/util/MyPageDefaults.kt
@@ -0,0 +1,12 @@
+package com.terning.feature.mypage.mypage.util
+
+object MyPageDefaults {
+ const val VERSION = "1.1.0"
+ const val NOTICE_URL =
+ "https://abundant-quiver-13f.notion.site/Android-49b3cc2390ee4dc389e25a5097736944"
+ const val OPINION_URL = "https://forms.gle/AaLpVptfg6cATYWa7"
+ const val SERVICE_URL =
+ "https://abundant-quiver-13f.notion.site/69109213e7db4873be6b9600f2f5163a?pvs=4"
+ const val PERSONAL_URL =
+ "https://abundant-quiver-13f.notion.site/130cf1915fe7471e9aaf29cab306be3b?pvs=4"
+}
\ No newline at end of file
diff --git a/feature/src/main/res/values/strings.xml b/feature/src/main/res/values/strings.xml
index f07b97a46..8c283460c 100644
--- a/feature/src/main/res/values/strings.xml
+++ b/feature/src/main/res/values/strings.xml
@@ -1,6 +1,6 @@
- 터닝(terning)
+ terning
서버통신에 성공했어요
서버통신에 실패했어요
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 2d60e8d41..6bfbedc9d 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -2,8 +2,8 @@
compileSdk = "34"
minSdk = "28"
targetSdk = "34"
-versionName = "1.0.2"
-versionCode = "10002"
+versionName = "1.1.0"
+versionCode = "10100"
kotlinCompilerExtensionVersion = "1.5.0"
jvmTarget = "1.8"