Skip to content

Commit

Permalink
[FEAT] 맵 화면 QA 진행 (#49)
Browse files Browse the repository at this point in the history
* refactor : 맵 관련 컴포넌트 분리

* fix : bottomBar 관리 로직 변경

* fix : 지도화면에서 지도 아이콘 클릭 방지

지도 생명주기가 깨짐

* design : 현재 위치 섀도우 추가

* design : 지도 아이템 주소 Ellipsis 적용

* design : 내가 좋아요한 와인샵 개수 출력

* design : 와인 샵 제목 짤림 수정

* design : 디테일 화면 거리 및 운영 시간 디테일 수정

* design : 디테일 화면 이동 분리

* fix : bottomBar 관리 매니저 추가
  • Loading branch information
dlgocks1 authored Feb 17, 2024
1 parent de76384 commit 4bb1762
Show file tree
Hide file tree
Showing 13 changed files with 356 additions and 132 deletions.
10 changes: 7 additions & 3 deletions app/src/main/java/com/teamwiney/winey/WineyNavHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import com.teamwiney.core.common.navigation.AuthDestinations
import com.teamwiney.core.common.navigation.TopLevelDestination
import com.teamwiney.core.common.rememberWineyAppState
import com.teamwiney.core.common.rememberWineyBottomSheetState
import com.teamwiney.map.mapGraph
import com.teamwiney.home.homeGraph
import com.teamwiney.map.mapGraph
import com.teamwiney.mypage.myPageGraph
import com.teamwiney.noteGraph
import com.teamwiney.ui.components.BottomNavigationBar
Expand Down Expand Up @@ -55,7 +55,7 @@ fun WineyNavHost() {
},
bottomBar = {
AnimatedVisibility(
appState.shouldShowBottomBar,
appState.bottomBarState.value,
enter = slideInVertically { it },
exit = slideOutVertically { it },
) {
Expand Down Expand Up @@ -142,7 +142,11 @@ private fun WineyBottomNavigationBar(
unselectedIcon = destination.unselectedIcon,
selectedContentColor = selectedContentColor,
unselectedContentColor = unselectedContentColor,
onClick = { onNavigateToDestination(destination) },
onClick = {
if (!selected) {
onNavigateToDestination(destination)
}
},
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package com.teamwiney.core.common
import androidx.compose.material.ScaffoldState
import androidx.compose.material.rememberScaffoldState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.Stable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.navigation.NavDestination
Expand All @@ -23,13 +25,15 @@ import kotlinx.coroutines.launch

@Composable
fun rememberWineyAppState(
bottomBarState: MutableState<Boolean> = mutableStateOf(false),
navController: NavHostController = rememberNavController(),
scaffoldState: ScaffoldState = rememberScaffoldState(),
scope: CoroutineScope = rememberCoroutineScope(),
cameraPositionState: CameraPositionState = rememberCameraPositionState()
): WineyAppState {
return remember(Unit) {
WineyAppState(
bottomBarState,
navController,
scaffoldState,
scope,
Expand All @@ -40,6 +44,7 @@ fun rememberWineyAppState(

@Stable
class WineyAppState(
val bottomBarState: MutableState<Boolean>,
val navController: NavHostController,
val scaffoldState: ScaffoldState,
val scope: CoroutineScope,
Expand All @@ -55,6 +60,9 @@ class WineyAppState(
@Composable get() = currentDestination?.route ==
topLevelDestination.find { it.route == currentDestination?.route }?.route

fun updateBottomBarVisibility(visibility: Boolean) {
bottomBarState.value = visibility
}

fun showSnackbar(message: String) = scope.launch {
scaffoldState.snackbarHostState.showSnackbar(message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ fun HomeScreen(
LaunchedEffect(true) {
viewModel.getRecommendWines()
viewModel.getWineTips()
appState.updateBottomBarVisibility(true)

effectFlow.collectLatest { effect ->
when (effect) {
Expand Down
1 change: 1 addition & 0 deletions feature/map/src/main/java/com/teamwiney/map/MapContract.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class MapContract {
val movingCameraPosition: MovingCameraWrapper = MovingCameraWrapper.DEFAULT,
val selectedMarkar: WineShop? = null,
val selectedShopCategory: ShopCategory = ShopCategory.ALL,
val previousCateogy: ShopCategory? = null
) : UiState

sealed class Event : UiEvent {
Expand Down
Loading

0 comments on commit 4bb1762

Please sign in to comment.