Skip to content

Commit

Permalink
[BUG] 03.09 QA 진행 (#62)
Browse files Browse the repository at this point in the history
* design : 워딩 수정

* fix : 빈티지 or 가격 하나만 입력 가능하도록

* refactor : winTip -> webView화면 변경

* design : FAQ 상단바 추가

* fix :  탈퇴 이유가 초기화 수정

* design : 계정 탈퇴 상단바 패딩 수정

* design : 노드 작성 완료 화면 작성 중
  • Loading branch information
dlgocks1 authored Mar 9, 2024
1 parent f4608fb commit fbe2f50
Show file tree
Hide file tree
Showing 15 changed files with 190 additions and 53 deletions.
29 changes: 29 additions & 0 deletions app/src/main/java/com/teamwiney/winey/WineyNavHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.navigation.NavDestination
import androidx.navigation.NavType
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.navArgument
import com.teamwiney.analysis.analysisGraph
import com.teamwiney.auth.authGraph
import com.teamwiney.core.common.WineyAppState
Expand All @@ -29,6 +32,7 @@ import com.teamwiney.core.common.navigation.MapDestinations
import com.teamwiney.core.common.navigation.TopLevelDestination
import com.teamwiney.core.common.rememberWineyAppState
import com.teamwiney.core.common.rememberWineyBottomSheetState
import com.teamwiney.home.WebViewScreen
import com.teamwiney.home.homeGraph
import com.teamwiney.map.mapGraph
import com.teamwiney.mypage.myPageGraph
Expand Down Expand Up @@ -101,6 +105,31 @@ fun WineyNavHost() {
appState = appState,
bottomSheetState = bottomSheetState
)

composable(
route = "${HomeDestinations.WEB_VIEW}?url={url}&title={title}&subTitle={subTitle}",
arguments = listOf(
navArgument("url") {
type = NavType.StringType
defaultValue = ""
},
navArgument("title") {
type = NavType.StringType
defaultValue = ""
},
navArgument("subTitle") {
type = NavType.StringType
defaultValue = ""
}
)
) { entry ->
WebViewScreen(
appState = appState,
url = entry.arguments?.getString("url") ?: "",
title = entry.arguments?.getString("title") ?: "",
subTitle = entry.arguments?.getString("subTitle") ?: ""
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object HomeDestinations {
const val HOME = "home"
const val WINE_DETAIL = "detail"
const val WINE_TIP = "wineTip"
const val WINE_TIP_DETAIL = "wineTipDetail"
const val WEB_VIEW = "webView"

object Analysis {
const val ROUTE = "analysis"
Expand Down Expand Up @@ -63,6 +63,7 @@ object NoteDestinations {
const val INFO_FLAVOR = "infoFlavor"
const val INFO_VINTAGE_AND_PRICE = "infoVintageAndPrice"
const val INFO_STANDARD_FLAVOR = "infoStandardFlavor"
const val COMPLETE = "noteWriteComplete"
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ private fun AnalysisProgressContent(
color = WineyTheme.colors.main_3
)
) {
append("성경님 ")
append("나의 ")
}
append("테이스팅 노트를\n분석중이예요!")
append("테이스팅 노트를\n 분석 중이에요!")
},
style = WineyTheme.typography.title1.copy(
color = WineyTheme.colors.gray_50
Expand Down
15 changes: 1 addition & 14 deletions feature/home/src/main/java/com/teamwiney/home/HomeNavigation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,7 @@ fun NavGraphBuilder.homeGraph(
)
}

composable(
route = "${HomeDestinations.WINE_TIP_DETAIL}?url={url}",
arguments = listOf(
navArgument("url") {
type = NavType.StringType
defaultValue = ""
}
)
) { entry ->
WebViewScreen(
appState = appState,
url = entry.arguments?.getString("url") ?: ""
)
}


composable(
route = "${HomeDestinations.WINE_DETAIL}?id={wineId}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class HomeViewModel @Inject constructor(
}

is HomeContract.Event.ShowTipDetail -> {
postEffect(HomeContract.Effect.NavigateTo("${HomeDestinations.WINE_TIP_DETAIL}?url=${event.url}"))
postEffect(HomeContract.Effect.NavigateTo("${HomeDestinations.WEB_VIEW}?url=${event.url}&title=${"와인 초보자를 위한 "}&subTitle=${"TIP"}"))
}

is HomeContract.Event.ShowAnalysis -> {
Expand Down
14 changes: 10 additions & 4 deletions feature/home/src/main/java/com/teamwiney/home/WebViewScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ import com.teamwiney.ui.theme.WineyTheme
@Composable
fun WebViewScreen(
appState: WineyAppState,
url: String = ""
url: String = "",
title: String = "",
subTitle: String = ""
) {

ManageBottomBarState(appState = appState)

Column(
modifier = Modifier
.fillMaxSize()
Expand All @@ -36,9 +38,9 @@ fun WebViewScreen(
) {
TopBar(
annotatedContent = buildAnnotatedString {
append("와인 초보를 위한 ")
append(title)
withStyle(style = SpanStyle(WineyTheme.colors.main_2)) {
append("TIP")
append(subTitle)
}
},
leadingIconOnClick = {
Expand All @@ -62,6 +64,10 @@ fun WebViewContent(
)
webViewClient = WebViewClient()
settings.javaScriptEnabled = true
settings.setSupportMultipleWindows(false)
settings.domStorageEnabled = true
settings.useWideViewPort = true
settings.loadWithOverviewMode = true
loadUrl(url)
}
}, update = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ fun TipContent(
wineTips: LazyPagingItems<WineTip>
) {

val title = "와인 초보자를 위한 "
val subTitle = "TIP"
LazyVerticalGrid(
columns = GridCells.Fixed(2),
contentPadding = PaddingValues(horizontal = 24.dp, vertical = 10.dp),
Expand All @@ -95,7 +97,7 @@ fun TipContent(
title = it.title,
thumbnail = it.thumbnail,
onClick = {
appState.navigate("${HomeDestinations.WINE_TIP_DETAIL}?url=${it.url}")
appState.navigate("${HomeDestinations.WEB_VIEW}?url=${it.url}&title=${title}&subTitle=${subTitle}")
}
)
}
Expand Down
23 changes: 8 additions & 15 deletions feature/mypage/src/main/java/com/teamwiney/mypage/MyPageScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.teamwiney.mypage
import android.content.Context
import android.content.Intent
import android.net.Uri
import androidx.browser.customtabs.CustomTabsIntent
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
import androidx.compose.foundation.border
Expand Down Expand Up @@ -42,6 +41,7 @@ import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.teamwiney.core.common.WineyAppState
import com.teamwiney.core.common.model.WineGrade
import com.teamwiney.core.common.navigation.HomeDestinations
import com.teamwiney.core.common.navigation.MyPageDestinations
import com.teamwiney.core.common.util.Constants.FAQ_URL
import com.teamwiney.data.network.model.response.WineGradeStandard
Expand Down Expand Up @@ -76,7 +76,7 @@ fun MyPageScreen(
appState.showSnackbar(effect.message)
}

else -> { }
else -> {}
}
}
}
Expand Down Expand Up @@ -148,16 +148,7 @@ fun MyPageScreen(
}
HeightSpacer(height = 5.dp)
MyProfileMenuItem(menu = "FAQ") {
val builder = CustomTabsIntent.Builder()

builder.setShowTitle(true)
builder.setInstantAppsEnabled(true)

val customBuilder = builder.build()
customBuilder.launchUrl(
context,
Uri.parse(FAQ_URL)
)
appState.navigate("${HomeDestinations.WEB_VIEW}?url=${FAQ_URL}&title=${"FAQ"}&subTitle=${""}")
}
MyProfileAppVersionItem()
}
Expand Down Expand Up @@ -322,8 +313,10 @@ fun MyPageGrade(
}
}
} else {
val nextGrade = gradeData.getOrNull(currentGradeIdx + 1)?.name ?: WineGrade.GLASS
val nextGradeMinCount = gradeData.getOrNull(currentGradeIdx + 1)?.minCount ?: 0
val nextGrade =
gradeData.getOrNull(currentGradeIdx + 1)?.name ?: WineGrade.GLASS
val nextGradeMinCount =
gradeData.getOrNull(currentGradeIdx + 1)?.minCount ?: 0
val remainingNoteCount = nextGradeMinCount - noteCount

buildAnnotatedString {
Expand Down Expand Up @@ -389,7 +382,7 @@ fun MyProfileMenuItem(
color = WineyTheme.colors.gray_400
)
)

Icon(
modifier = Modifier
.size(24.dp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -81,6 +82,7 @@ fun MyPageAccountScreen(
Column(
modifier = Modifier
.fillMaxSize()
.statusBarsPadding()
.background(WineyTheme.colors.background_1)
) {
TopBar(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Text
Expand Down Expand Up @@ -61,7 +62,7 @@ fun MyPageWithdrawalConfirmScreen(
}
}

else -> { }
else -> {}
}
}
}
Expand All @@ -71,6 +72,7 @@ fun MyPageWithdrawalConfirmScreen(
Column(
modifier = Modifier
.fillMaxSize()
.statusBarsPadding()
.background(WineyTheme.colors.background_1)
) {
TopBar(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ fun MyPageWithdrawalReasonSelectScreen(
val effectFlow = viewModel.effect

LaunchedEffect(true) {
viewModel.updateWithdrawalReason("이유를 선택해주세요.")

effectFlow.collectLatest { effect ->
when (effect) {
Expand All @@ -75,7 +74,7 @@ fun MyPageWithdrawalReasonSelectScreen(
}
}

else -> { }
else -> {}
}
}
}
Expand Down Expand Up @@ -115,7 +114,7 @@ fun MyPageWithdrawalReasonSelectScreen(
)
HeightSpacer(height = 30.dp)
Text(
text ="계정을 삭제하려는\n이유를 알려주세요.",
text = "계정을 삭제하려는\n이유를 알려주세요.",
style = WineyTheme.typography.title2.copy(
color = WineyTheme.colors.gray_50
)
Expand Down Expand Up @@ -153,9 +152,9 @@ fun MyPageWithdrawalReasonSelectScreen(
text = "다음",
onClick = { appState.navigate(MyPageDestinations.WITHDRAWAL_CONFIRM) },
enabled = (
(uiState.isWithdrawalReasonDirectInput && uiState.withdrawalReasonDirectInput.isNotEmpty()) ||
(!uiState.isWithdrawalReasonDirectInput && uiState.withdrawalReason != "이유를 선택해주세요.")
),
(uiState.isWithdrawalReasonDirectInput && uiState.withdrawalReasonDirectInput.isNotEmpty()) ||
(!uiState.isWithdrawalReasonDirectInput && uiState.withdrawalReason != "이유를 선택해주세요.")
),
modifier = Modifier.padding(bottom = 20.dp)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ fun NoteWineInfoVintageAndPriceScreen(
disableBackgroundColor = WineyTheme.colors.gray_900,
disableTextColor = WineyTheme.colors.gray_600,
enableTextColor = WineyTheme.colors.gray_50,
enabled = uiState.wineNote.price.isNotEmpty() && uiState.wineNote.vintage.isNotEmpty(),
enabled = uiState.wineNote.price.isNotEmpty() || uiState.wineNote.vintage.isNotEmpty(),
onClick = {
appState.navController.navigate(NoteDestinations.Write.INFO_COLOR_SMELL)
}
Expand Down
Loading

0 comments on commit fbe2f50

Please sign in to comment.