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] fix: 사용자 불편사항 및 오동작 해결(#980 #983 #984) #981

Merged
merged 5 commits into from
May 19, 2024
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.core.view.WindowCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsControllerCompat
import androidx.navigation.NavController
import androidx.navigation.NavOptions
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.setupWithNavController
import com.festago.festago.presentation.R
Expand Down Expand Up @@ -60,9 +61,23 @@ class HomeActivity : AppCompatActivity() {
(supportFragmentManager.findFragmentById(R.id.fcvHomeContainer) as NavHostFragment).navController
val bottomNavigationView = findViewById<BottomNavigationView>(R.id.nvHome)
bottomNavigationView.setupWithNavController(navController)

setBottomNavPopUpBackstack(bottomNavigationView)
setNavColor()
}

private fun setBottomNavPopUpBackstack(bottomNavigationView: BottomNavigationView) {
bottomNavigationView.setOnItemSelectedListener {
val options = NavOptions.Builder()
.setPopUpTo(R.id.main_graph_xml, false)
.setLaunchSingleTop(true)
.build()

navController.navigate(it.itemId, null, options)
true
}
}

private fun setNavColor() {
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
window.navigationBarColor = ContextCompat.getColor(this, android.R.color.white)
Expand Down
Loading