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

[AN/USER] 안드로이드 네비게이션을 적용한다. (#758) #781

Merged
merged 40 commits into from
Mar 13, 2024
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
64e8759
feat: 학교 상세 도메인 모델 추가
EmilyCh0 Feb 9, 2024
8469319
feat: SchoolRepository 정의
EmilyCh0 Feb 9, 2024
5ef793a
feat: 테스트용 FakeSchool 추가
EmilyCh0 Feb 9, 2024
2aa3b2b
feat: SchoolDefaultRepository 임시 구현 (Fake 데이터 리턴)
EmilyCh0 Feb 9, 2024
61d0ffe
feat: 학교 상세 dto 추가
EmilyCh0 Feb 10, 2024
b48c2bf
feat: SchoolDetailUiState 정의
EmilyCh0 Feb 10, 2024
6eb05c6
feat: SchoolDetailViewModel 구현
EmilyCh0 Feb 10, 2024
d6cd393
feat: SchoolDetailFragment 구현
EmilyCh0 Feb 12, 2024
bc6da8e
feat: UiState 분리
EmilyCh0 Feb 12, 2024
d1f1f2b
feat: FakeSchool 소셜미디어 데이터 추가
EmilyCh0 Feb 17, 2024
f74935f
feat: SchoolDetailFragment 뷰 수정
EmilyCh0 Feb 17, 2024
5e724f6
move: 패키지 위치 변경
EmilyCh0 Feb 17, 2024
3832327
feat: 상단 뒤로 가기 버튼
EmilyCh0 Feb 18, 2024
cc91707
feat: schoolId 추가
EmilyCh0 Feb 18, 2024
a025518
fix: dday view 수정
EmilyCh0 Feb 18, 2024
b555447
feat: 북마크
EmilyCh0 Feb 20, 2024
60357d6
Merge branch 'dev' into feat/#697
EmilyCh0 Feb 20, 2024
2a85266
fix: resolve conflict
EmilyCh0 Feb 20, 2024
702afb4
refactor: ktlint check
EmilyCh0 Feb 20, 2024
48848ad
refactor: ktlint check
EmilyCh0 Feb 20, 2024
7a30d1c
refactor: Fake 리포지토리명 변경
EmilyCh0 Feb 24, 2024
f1c5aec
refactor: id 카멜케이스로 수정
EmilyCh0 Feb 24, 2024
52824ad
refactor: FakeSchoolRepository 주석 삭제
EmilyCh0 Feb 24, 2024
99f08bc
chore(presentation): 네비게이션 의존성 추가
re4rk Feb 24, 2024
99f71f4
feat(home): 네비게이션 그래프 추가
re4rk Feb 24, 2024
15d7e1e
chore(presentation): safeargs 추가
re4rk Feb 25, 2024
a20b566
feat(presentation): 컨트롤러 사용하도록 추가
re4rk Feb 25, 2024
3c508c6
feat(presentation): 탭마다 스택이 쌓이도록 변경
re4rk Feb 25, 2024
924436c
feat(presentation): 네비게이션 적용
re4rk Feb 25, 2024
5bebc61
Merge remote-tracking branch 'origin/dev' into feat/#758
re4rk Mar 5, 2024
160cd19
Merge remote-tracking branch 'origin/dev' into feat/#758
re4rk Mar 8, 2024
a1618b0
refactor(Artist): 네비게이션 시 리프래시 되지 않도록 수정
re4rk Mar 8, 2024
aef1700
refactor(FestivalDetail): 네비게이션 시 리프래시 되지 않도록 수정
re4rk Mar 8, 2024
722c78b
refactor(FestivalDetail): 불필요한 코드 제거
re4rk Mar 9, 2024
1e5d425
refactor(FestivalDetail): 불필요한 코드 제거
re4rk Mar 9, 2024
9794fe7
refactor(SchoolDetail): 사용하지 않는 모듈 제거
re4rk Mar 13, 2024
9f720ad
refactor(presentation): 불필요한 바인드 분기 제거
re4rk Mar 13, 2024
89b9b80
refactor(home): 화면마다 변경되게 변경
re4rk Mar 13, 2024
18973de
refactor(home): 화면 이동이 모두 백스택에 쌓이도록 변경
re4rk Mar 13, 2024
ac3c717
feat: 축제 목록에서 축제 상세 이동 시 애니메이션 추가
SeongHoonC Mar 13, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.setupWithNavController
import com.festago.festago.presentation.R
import com.festago.festago.presentation.databinding.ActivityHomeBinding
import com.festago.festago.presentation.ui.artistdetail.ArtistDetailFragment
import com.festago.festago.presentation.ui.festivaldetail.FestivalDetailFragment
import com.festago.festago.presentation.ui.schooldetail.SchoolDetailFragment
import com.festago.festago.presentation.util.setOnApplyWindowInsetsCompatListener
import com.festago.festago.presentation.util.setStatusBarMode
import com.google.android.material.bottomnavigation.BottomNavigationView
Expand All @@ -40,7 +37,7 @@ class HomeActivity : AppCompatActivity() {
bottomNavigationView.setupWithNavController(navController)
Copy link
Member

Choose a reason for hiding this comment

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

네비게이션 버튼을 클릭해서 이동할때는 괜찮은데 뒤로가기 누르면 홈에 쌓였던 것들이 초기화되네요..흠 왜 그런걸까요?

Copy link
Member

Choose a reason for hiding this comment

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

NavigationUI 내부적으로 첫번째 destination으로 popup 하게 되어있어서 그런 것 같아요.
bottom navigation menu item에 menuCategory를 secondary로 두면 탭 이동도 백스택 관리할 수 있어요! 아래 링크 참고
https://hide1202.github.io/android/navigation-backstack/

Copy link
Member

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.

베르

  • 사실 네비게이션 버튼 이동 시에 뒤로가기 누르면 홈에 쌓인 것들이 초기화 되는 것처럼 보이지만 그 상태에서 다시 홈을 누르면 홈의 스택이 다시 올라옵니다!
    해시
  • 네비게이션 전략은 다양하게 선택될 수 있을 것같은데 해시가 링크해준게 좋다고 생각해서 반영했습니다!


initBackPressedDispatcher()
initBackStackListener()
initDestinationChangedListener()
WindowCompat.setDecorFitsSystemWindows(window, false)

binding.root.setOnApplyWindowInsetsCompatListener { view, windowInsets ->
Expand All @@ -60,17 +57,16 @@ class HomeActivity : AppCompatActivity() {
setContentView(binding.root)
}

private fun initBackStackListener() {
supportFragmentManager.addOnBackStackChangedListener {
val isLight = when (supportFragmentManager.findFragmentById(R.id.fcvHomeContainer)) {
is ArtistDetailFragment,
is FestivalDetailFragment,
is SchoolDetailFragment,
-> false
private fun initDestinationChangedListener() {
navController.addOnDestinationChangedListener { _, destination, _ ->
Copy link
Member

Choose a reason for hiding this comment

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

addOnDestinationChangedListener 도 있군요! 또 배워갑니다!

when (destination.id) {
R.id.artistDetailFragment,
R.id.festivalDetailFragment,
R.id.schoolDetailFragment,
-> setStatusBarMode(isLight = false, backgroundColor = Color.TRANSPARENT)

else -> true
else -> setStatusBarMode(isLight = true, backgroundColor = Color.TRANSPARENT)
}
setStatusBarMode(isLight = isLight, backgroundColor = Color.TRANSPARENT)
}
}

Expand Down