Skip to content

Commit

Permalink
fix: Fixed the home screen not being reset.
Browse files Browse the repository at this point in the history
  • Loading branch information
CreativeCodeCat committed May 23, 2024
1 parent e53b2ea commit 80c9ccd
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ class MainActivity : AppCompatActivity() {
preferenceViewModel.setShowStatusBar(preferenceHelper.showStatusBar)
preferenceViewModel.showStatusBarLiveData.observe(this) {
if (it) appHelper.showStatusBar(this.window)
else appHelper.hideStatusBar(this.window) }
else appHelper.hideStatusBar(this.window)
}
}

private fun setupNavController() {
// Find the NavHostFragment
val navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment_content_main) as NavHostFragment
val navHostFragment =
supportFragmentManager.findFragmentById(R.id.nav_host_fragment_content_main) as NavHostFragment

// Retrieve the NavController
val navController = navHostFragment.navController
Expand Down Expand Up @@ -113,6 +115,7 @@ class MainActivity : AppCompatActivity() {

override fun onResume() {
super.onResume()
backToHomeScreen()
setupDataBase()
observeUI()
}
Expand Down

0 comments on commit 80c9ccd

Please sign in to comment.