Skip to content

Conversation

parkcheayeon
Copy link
Collaborator

모듈간 기본 네비게이션 구현하였습니다

  1. StopListFragment에 버튼 2개 추가
  2. 버튼 클릭 시 StopDetailFragment로 이동하며 String을 StopDetailFragment로 전달
  3. StopDetailFragment에서 전달받은 String을 화면에 표시
  4. Back 키로 다시 StopListFragment로 돌아가는 기능 구현

feature module간 이동이 불가해서 feature 모듈별로 nav graph를 생성하였고,
개별 모듈의 그래프를 최상위 네비게이션 그래프에 추가하였고, 딥링크를 사용하였습니다

@parkcheayeon parkcheayeon requested a review from Dukoo1 December 28, 2024 16:59
@parkcheayeon parkcheayeon self-assigned this Dec 28, 2024
@parkcheayeon parkcheayeon linked an issue Dec 28, 2024 that may be closed by this pull request
@Dukoo1
Copy link
Collaborator

Dukoo1 commented Dec 29, 2024

This is for #1

@@ -34,6 +34,8 @@ android {
}

dependencies {
implementation "androidx.navigation:navigation-fragment-ktx:$rootProject.navigationVersion"
Copy link
Collaborator

Choose a reason for hiding this comment

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

rootProject buildscript 에 버젼을 선언하는 방식을 예전에 많이 썼었는데요.(저희 회사도 아직 이렇게 씁니다)
요즘엔 version catalog라고 해서 libs.versions.toml에 선언하는 방식을 권장하더라구요. 사용은 아래 libs.androidx.core.ktx 처럼 하구요.
minSdk, compileSdk도 비슷하게 쓸 수 있습니다.

이 프로젝트에선 version catalog 방식으로 통일해보시면 어때요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

네! 해당방식 적용해보겠습니다

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

version catalog 방식으로 통일해서 추가 커밋하였습니다

}

private fun navigateToStopDetail(data: String) {
val uri = "android-app://com.chaeny.busoda/fragment_stop_detail?data=$data".toUri()
Copy link
Collaborator

Choose a reason for hiding this comment

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

문서에 맞춰서 딥링크를 잘 구현해주셨네요.
이 방식에도 장단점이 있는데요.(뭘까요?)
일단 멀티모듈 기본구조는 완성하셨으니, 이대로 가시죠.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

해당 방식의 장점으로는 모듈 간 의존성이 필요 없고, 앱 외부에서도 URI를 통해 접근할 수 있습니다
단점으로는
전달 가능한 데이터가 단순 문자열로 제한되고, 데이터가 노출될 수 있어 보안에 취약합니다
그리고 오타로 인한 런타임 오류가 발생할 수 있고 유지보수가 용이하지 않습니다

Copy link
Collaborator

Choose a reason for hiding this comment

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

오. 보안취약까지는 생각못했네요~

Copy link

@Dukoo1 Dukoo1 merged commit 1d5c8e8 into main Dec 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

모듈간 기본 네비게이션 구현
2 participants