fix: remove bottom nav padding on server detail screen
Scaffold's innerPadding reserved NavigationBar height even when the bar was hidden (on detail screens). Content like the services list had extra empty space at the bottom. Fix: build custom PaddingValues that only includes bottom padding when inLoggedInArea is true.
This commit is contained in:
@@ -20,6 +20,9 @@ import androidx.compose.material.icons.filled.*
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.ui.platform.LocalLayoutDirection
|
||||
import androidx.compose.ui.unit.LayoutDirection
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||
@@ -228,7 +231,14 @@ fun AppRoot() {
|
||||
startDestination = if (isLoggedIn) Screen.Dashboard.route else Screen.Login.route,
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(innerPadding),
|
||||
.padding(
|
||||
PaddingValues(
|
||||
start = 0.dp,
|
||||
top = innerPadding.calculateTopPadding(),
|
||||
end = 0.dp,
|
||||
bottom = if (inLoggedInArea) innerPadding.calculateBottomPadding() else 0.dp
|
||||
)
|
||||
),
|
||||
enterTransition = { slideInHorizontally(initialOffsetX = { it / 4 }) + fadeIn(animationSpec = tween(300)) },
|
||||
exitTransition = { fadeOut(animationSpec = tween(200)) },
|
||||
popEnterTransition = { fadeIn(animationSpec = tween(200)) },
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user