Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,52 @@ fabric.properties

# End of https://www.toptal.com/developers/gitignore/api/android,androidstudio,gradle,kotlin,java

# Created by https://www.toptal.com/developers/gitignore/api/macos
# Edit at https://www.toptal.com/developers/gitignore?templates=macos

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

# End of https://www.toptal.com/developers/gitignore/api/macos

# 개인 프롬프트 파일
.daegeun
.daegeun/**

# oh-my-openagent files
.sisyphus
.sisyphus/**

# antigravity cli files
.antigravitycli
.antigravitycli/**
132 changes: 88 additions & 44 deletions app/src/main/java/com/lyrics/feelin/navigation/FeelinNavHost.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package com.lyrics.feelin.navigation

import android.util.Log
import androidx.activity.compose.BackHandler
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.calculateEndPadding
import androidx.compose.foundation.layout.calculateStartPadding
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
Expand All @@ -17,8 +21,13 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.pointer.PointerEventPass
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.semantics.stateDescription
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
Expand All @@ -38,6 +47,7 @@ import com.lyrics.feelin.core.designsystem.icon.MyPageActiveIcon
import com.lyrics.feelin.core.designsystem.icon.MyPageInactiveIcon
import com.lyrics.feelin.core.designsystem.icon.NoteSearchingActiveIcon
import com.lyrics.feelin.core.designsystem.icon.NoteSearchingInactiveIcon
import com.lyrics.feelin.presentation.designsystem.theme.LocalFeelinColors
import com.lyrics.feelin.presentation.util.openExternalBrowser
import com.lyrics.feelin.presentation.view.community.CommunityMainScreen
import com.lyrics.feelin.presentation.view.login.LoginScreen
Expand Down Expand Up @@ -318,7 +328,11 @@ private fun NavGraphBuilder.myPageNavGraph(navController: NavHostController) {
}
}

MainScaffold(navController = navController, selectedIndex = 2) {
MainScaffold(
navController = navController,
selectedIndex = 2,
isBlockingLoading = logoutStatus == MyPageLogoutStatus.LOADING
) {
SettingScreen(
onBackClick = { navController.popBackStack() },
onUserInfoClick = { navController.navigate(FeelinDestination.UserInfo.route) },
Expand All @@ -329,7 +343,6 @@ private fun NavGraphBuilder.myPageNavGraph(navController: NavHostController) {
onExternalBrowserClick = { url ->
context.openExternalBrowser(url)
},
isLogoutLoading = logoutStatus == MyPageLogoutStatus.LOADING,
)
}
}
Expand Down Expand Up @@ -367,6 +380,7 @@ private fun NavGraphBuilder.internalWebViewScreen(navController: NavHostControll
private fun MainScaffold(
navController: NavHostController,
selectedIndex: Int,
isBlockingLoading: Boolean = false,
content: @Composable () -> Unit
) {
var selectedBottomBarIndex by remember { mutableIntStateOf(selectedIndex) }
Expand All @@ -388,51 +402,81 @@ private fun MainScaffold(
)
}

Scaffold(
modifier = Modifier.fillMaxSize(),
bottomBar = {
FeelinBottomNavigation(
modifier = Modifier.windowInsetsPadding(WindowInsets.navigationBars),
items = bottomBarItems,
selectedIndex = selectedBottomBarIndex,
onItemSelect = { index ->
selectedBottomBarIndex = index
val destination = when (index) {
0 -> FeelinDestination.HomeGraph.route
1 -> FeelinDestination.NoteSearchGraph.route
2 -> FeelinDestination.MyPageGraph.route
else -> FeelinDestination.HomeGraph.route
}
navController.navigate(destination) {
popUpTo(FeelinDestination.MainGraph.route) {
saveState = true
Box(modifier = Modifier.fillMaxSize()) {
Scaffold(
modifier = Modifier.fillMaxSize(),
bottomBar = {
FeelinBottomNavigation(
modifier = Modifier.windowInsetsPadding(WindowInsets.navigationBars),
items = bottomBarItems,
selectedIndex = selectedBottomBarIndex,
onItemSelect = { index ->
selectedBottomBarIndex = index
val destination = when (index) {
0 -> FeelinDestination.HomeGraph.route
1 -> FeelinDestination.NoteSearchGraph.route
2 -> FeelinDestination.MyPageGraph.route
else -> FeelinDestination.HomeGraph.route
}
launchSingleTop = true
restoreState = true
}
},
)
},
contentWindowInsets = WindowInsets(0)
) { paddingValues ->
// WindowInsets.navigationBars가 30dp 이하인 경우 Scaffold paddingValues 사용
var bottomPadding = WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding()
if (bottomPadding <= 30.dp) {
bottomPadding = paddingValues.calculateBottomPadding()
navController.navigate(destination) {
popUpTo(FeelinDestination.MainGraph.route) {
saveState = true
}
launchSingleTop = true
restoreState = true
}
},
)
},
contentWindowInsets = WindowInsets(0)
) { paddingValues ->
// WindowInsets.navigationBars가 30dp 이하인 경우 Scaffold paddingValues 사용
var bottomPadding = WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding()
if (bottomPadding <= 30.dp) {
bottomPadding = paddingValues.calculateBottomPadding()
}
Log.d("FeelinNavHost", "MainScaffold: bottomPadding=$bottomPadding")

Comment on lines +438 to +439
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이번 기능의 구현 범위를 넘어서는 변경이어서 반영하지 않습니다.

Box(
modifier = Modifier
.fillMaxSize()
.padding(
top = paddingValues.calculateTopPadding(),
start = paddingValues.calculateStartPadding(LayoutDirection.Ltr),
end = paddingValues.calculateEndPadding(LayoutDirection.Ltr),
bottom = bottomPadding
)
Comment thread
gdaegeun539 marked this conversation as resolved.
) {
content()
}
}
Log.d("FeelinNavHost", "MainScaffold: bottomPadding=$bottomPadding")

Box(
modifier = Modifier
.fillMaxSize()
.padding(
top = paddingValues.calculateTopPadding(),
start = paddingValues.calculateEndPadding(LayoutDirection.Ltr),
end = paddingValues.calculateEndPadding(LayoutDirection.Ltr),
bottom = bottomPadding
)
) {
content()
BackHandler(enabled = isBlockingLoading) { }

if (isBlockingLoading) {
val feelinColors = LocalFeelinColors.current

Box(
modifier = Modifier
.fillMaxSize()
.background(feelinColors.dim)
.clearAndSetSemantics {
stateDescription = "로딩 중입니다"
}
.pointerInput(Unit) {
awaitPointerEventScope {
while (true) {
val event = awaitPointerEvent(PointerEventPass.Initial)
event.changes.forEach { pointerInputChange ->
pointerInputChange.consume()
}
}
}
},
contentAlignment = Alignment.Center,
) {
CircularProgressIndicator()
}
Comment thread
gdaegeun539 marked this conversation as resolved.
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
Expand All @@ -24,10 +23,7 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.pointer.PointerEventPass
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.lyrics.feelin.R
Expand All @@ -46,7 +42,6 @@ fun SettingScreen(
onInternalWebViewClick: (String) -> Unit,
onExternalBrowserClick: (String) -> Unit,
modifier: Modifier = Modifier,
isLogoutLoading: Boolean = false,
) {
val feelinColors = LocalFeelinColors.current
var isLogoutDialogVisible by rememberSaveable { mutableStateOf(false) }
Expand Down Expand Up @@ -131,38 +126,6 @@ fun SettingScreen(
Spacer(modifier = Modifier.height(22.dp))
}
}

if (isLogoutLoading) {
// FIXME(@이대근): 화면 전역으로 오버레이가 적용되지 않아 하단바를 선택할 수 있음 2026.05.17.
LogoutLoadingOverlay()
}
}
}

@Composable
private fun LogoutLoadingOverlay(
modifier: Modifier = Modifier,
) {
val feelinColors = LocalFeelinColors.current

Box(
modifier = modifier
.fillMaxSize()
.background(feelinColors.dim)
.clearAndSetSemantics { }
.pointerInput(Unit) {
awaitPointerEventScope {
while (true) {
val event = awaitPointerEvent(PointerEventPass.Initial)
event.changes.forEach { pointerInputChange ->
pointerInputChange.consume()
}
}
}
},
contentAlignment = Alignment.Center,
) {
CircularProgressIndicator()
}
}

Expand Down
Loading