android: apply padding correctly

This commit is contained in:
Harsh Shandilya 2022-08-03 00:12:18 +05:30
parent ff19b36a9d
commit 73580be6e9
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80

View file

@ -155,8 +155,9 @@ fun LobstersApp(
}, },
) { paddingValues -> ) { paddingValues ->
MaterialMotionNavHost( MaterialMotionNavHost(
navController, navController = navController,
startDestination = Destinations.startDestination.getRoute(), startDestination = Destinations.startDestination.getRoute(),
modifier = Modifier.padding(paddingValues),
) { ) {
val uri = LobstersApi.BASE_URL val uri = LobstersApi.BASE_URL
composable( composable(
@ -171,7 +172,6 @@ fun LobstersApp(
isPostSaved = viewModel::isPostSaved, isPostSaved = viewModel::isPostSaved,
reloadPosts = viewModel::refreshHottestPosts, reloadPosts = viewModel::refreshHottestPosts,
postActions = postActions, postActions = postActions,
modifier = Modifier.padding(bottom = paddingValues.calculateBottomPadding()),
) )
} }
composable( composable(
@ -184,7 +184,6 @@ fun LobstersApp(
isPostSaved = viewModel::isPostSaved, isPostSaved = viewModel::isPostSaved,
reloadPosts = viewModel::refreshNewestPosts, reloadPosts = viewModel::refreshNewestPosts,
postActions = postActions, postActions = postActions,
modifier = Modifier.padding(bottom = paddingValues.calculateBottomPadding()),
) )
} }
composable(Destinations.Saved.getRoute()) { composable(Destinations.Saved.getRoute()) {
@ -193,7 +192,6 @@ fun LobstersApp(
items = savedPosts, items = savedPosts,
listState = savedListState, listState = savedListState,
postActions = postActions, postActions = postActions,
modifier = Modifier.padding(bottom = paddingValues.calculateBottomPadding()),
) )
} }
composable( composable(
@ -210,7 +208,6 @@ fun LobstersApp(
CommentsPage( CommentsPage(
postId = postId, postId = postId,
getDetails = viewModel::getPostComments, getDetails = viewModel::getPostComments,
modifier = Modifier.padding(bottom = paddingValues.calculateBottomPadding()),
postActions = postActions, postActions = postActions,
) )
} }
@ -223,7 +220,6 @@ fun LobstersApp(
UserProfile( UserProfile(
username = username, username = username,
getProfile = viewModel::getUserProfile, getProfile = viewModel::getUserProfile,
modifier = Modifier.padding(bottom = paddingValues.calculateBottomPadding()),
) )
} }
} }