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.content.ContextCompat
|
||||||
import androidx.core.graphics.ColorUtils
|
import androidx.core.graphics.ColorUtils
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import androidx.navigation.FloatingWindow
|
||||||
import androidx.navigation.NavController
|
import androidx.navigation.NavController
|
||||||
import androidx.navigation.fragment.NavHostFragment
|
import androidx.navigation.fragment.NavHostFragment
|
||||||
import androidx.navigation.ui.AppBarConfiguration
|
import androidx.navigation.ui.AppBarConfiguration
|
||||||
@@ -186,17 +187,19 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
// Handle views on fragments
|
// Handle views on fragments
|
||||||
navController.addOnDestinationChangedListener { _, navDestination, _ ->
|
navController.addOnDestinationChangedListener { _, navDestination, _ ->
|
||||||
when (navDestination.id) {
|
if (navDestination !is FloatingWindow) {
|
||||||
in topLevelFrags -> {
|
when (navDestination.id) {
|
||||||
B.searchFab.visibility = View.VISIBLE
|
in topLevelFrags -> {
|
||||||
B.navView.visibility = View.VISIBLE
|
B.searchFab.visibility = View.VISIBLE
|
||||||
B.toolbar.visibility = View.VISIBLE
|
B.navView.visibility = View.VISIBLE
|
||||||
}
|
B.toolbar.visibility = View.VISIBLE
|
||||||
R.id.appDetailsFragment -> {
|
}
|
||||||
hideTopLevelOnlyViews()
|
R.id.appDetailsFragment -> {
|
||||||
}
|
hideTopLevelOnlyViews()
|
||||||
else -> {
|
}
|
||||||
hideTopLevelOnlyViews()
|
else -> {
|
||||||
|
hideTopLevelOnlyViews()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user