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,6 +187,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
// Handle views on fragments
|
// Handle views on fragments
|
||||||
navController.addOnDestinationChangedListener { _, navDestination, _ ->
|
navController.addOnDestinationChangedListener { _, navDestination, _ ->
|
||||||
|
if (navDestination !is FloatingWindow) {
|
||||||
when (navDestination.id) {
|
when (navDestination.id) {
|
||||||
in topLevelFrags -> {
|
in topLevelFrags -> {
|
||||||
B.searchFab.visibility = View.VISIBLE
|
B.searchFab.visibility = View.VISIBLE
|
||||||
@@ -201,6 +203,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun hideTopLevelOnlyViews() {
|
private fun hideTopLevelOnlyViews() {
|
||||||
B.searchFab.visibility = View.GONE
|
B.searchFab.visibility = View.GONE
|
||||||
|
|||||||
Reference in New Issue
Block a user