Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

중첩 NavHost에 대한 BackSwipe 문의 #75

Open
ienground opened this issue Jan 10, 2025 · 1 comment
Open

중첩 NavHost에 대한 BackSwipe 문의 #75

ienground opened this issue Jan 10, 2025 · 1 comment
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@ienground
Copy link

ienground commented Jan 10, 2025

안녕하세요!
NavHost A의 composable 중 한 루트를 "B"라고 하겠습니다.
B에는 다른 NavHost B가 있는데요, B의 composable 중 한 루트를 "C"(ScreenC) (startDestination)라고 하면
A에서 navigate (B)를 했을 때, B가 담고 있는 NavHost B가 실행되고 그 중 startDestination인 ScreenC가 화면에 뜨는 상태가 됩니다.
B의 다른 composable 중 다른 루트를 "D"라고 하고, ScreenC에서 NavHostB의 controller를 이용하여 navigate (D)를 하면 현재 D가 화면에 뜬 상태입니다.
여기서 BackSwipe를 했을 때, 저는 이전 화면인 C가 뜨기를 기대하나 실제로는 NavHost B 자체가 나가지며 A로 돌아갑니다.

navigate entry를 로그로 띄워놓으신 것 같아서 상황과 같이 보여드리면,
[A]
A에서 시간 지난 후 B로 로딩
[A, B]
[C]
C에서 D 클릭 시
[C, D]
반쯤 BackSwipe했을 때 entity changed: B
그리고 나가면
[A]
[C]
이렇게 됩니다.

@easternkite
Copy link
Owner

easternkite commented Jan 10, 2025

@ienground
현재 중첩 EunGabiNavHost에 대한 케이스가 고려가 안되어있습니다.
말씀해주신 부분은 테스트 후에 반영하겠습니다.

그때까지 Single NavHost 형태로 사용 부탁드리겠습니다.

fun EunGabiGraphBuilder.bRoute() {
    screenC()
    screenD()
}

fun EunGabiGraphBuilder.screenC() {
    composable(...) { ... }
}

fun EunGabiGraphBuilder.screenD() {
    composable(...) { ... }
}

@easternkite easternkite self-assigned this Jan 12, 2025
@easternkite easternkite added bug Something isn't working enhancement New feature or request labels Jan 12, 2025
@ienground ienground changed the title 이중 NavHost에 대한 BackSwipe 문의 중첩 NavHost에 대한 BackSwipe 문의 Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants