MainActivity: Don't hide views on dialogs
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -38,6 +38,7 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.graphics.ColorUtils
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.navigation.FloatingWindow
|
||||
import androidx.navigation.NavController
|
||||
import androidx.navigation.fragment.NavHostFragment
|
||||
import androidx.navigation.ui.AppBarConfiguration
|
||||
@@ -186,17 +187,19 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
// Handle views on fragments
|
||||
navController.addOnDestinationChangedListener { _, navDestination, _ ->
|
||||
when (navDestination.id) {
|
||||
in topLevelFrags -> {
|
||||
B.searchFab.visibility = View.VISIBLE
|
||||
B.navView.visibility = View.VISIBLE
|
||||
B.toolbar.visibility = View.VISIBLE
|
||||
}
|
||||
R.id.appDetailsFragment -> {
|
||||
hideTopLevelOnlyViews()
|
||||
}
|
||||
else -> {
|
||||
hideTopLevelOnlyViews()
|
||||
if (navDestination !is FloatingWindow) {
|
||||
when (navDestination.id) {
|
||||
in topLevelFrags -> {
|
||||
B.searchFab.visibility = View.VISIBLE
|
||||
B.navView.visibility = View.VISIBLE
|
||||
B.toolbar.visibility = View.VISIBLE
|
||||
}
|
||||
R.id.appDetailsFragment -> {
|
||||
hideTopLevelOnlyViews()
|
||||
}
|
||||
else -> {
|
||||
hideTopLevelOnlyViews()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user