File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
presentation/src/main/java/com/whyranoid/presentation Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 1
1
package com.whyranoid.presentation
2
2
3
3
import android.os.Bundle
4
+ import android.view.View
4
5
import androidx.appcompat.app.AppCompatActivity
5
6
import androidx.navigation.fragment.NavHostFragment
6
7
import androidx.navigation.ui.NavigationUI
@@ -22,6 +23,15 @@ class MainActivity : AppCompatActivity() {
22
23
supportFragmentManager.findFragmentById(R .id.fragment_container) as NavHostFragment
23
24
val navController = navHostFragment.navController
24
25
26
+ navController.addOnDestinationChangedListener { _, destination, _ ->
27
+ when (destination.id) {
28
+ R .id.communityFragment, R .id.runningStartFragment, R .id.myRunFragment ->
29
+ binding.bottomNavigation.visibility = View .VISIBLE
30
+
31
+ else -> binding.bottomNavigation.visibility = View .GONE
32
+ }
33
+ }
34
+
25
35
NavigationUI .setupWithNavController(binding.bottomNavigation, navController)
26
36
}
27
37
}
You can’t perform that action at this time.
0 commit comments