mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-18 03:17:03 +05:30
Add bottom padding to list composables
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
5b66b440ce
commit
2778c88d3a
1 changed files with 5 additions and 1 deletions
|
@ -3,6 +3,7 @@ package dev.msfjarvis.lobsters.ui.main
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.compose.foundation.Text
|
import androidx.compose.foundation.Text
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||||
import androidx.compose.material.BottomNavigation
|
import androidx.compose.material.BottomNavigation
|
||||||
import androidx.compose.material.BottomNavigationItem
|
import androidx.compose.material.BottomNavigationItem
|
||||||
|
@ -11,6 +12,7 @@ import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.Providers
|
import androidx.compose.runtime.Providers
|
||||||
import androidx.compose.runtime.collectAsState
|
import androidx.compose.runtime.collectAsState
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.platform.setContent
|
import androidx.compose.ui.platform.setContent
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.viewinterop.viewModel
|
import androidx.compose.ui.viewinterop.viewModel
|
||||||
|
@ -60,7 +62,7 @@ fun LobstersApp() {
|
||||||
bottomBar = {
|
bottomBar = {
|
||||||
LobstersBottomNav(navController, destinations)
|
LobstersBottomNav(navController, destinations)
|
||||||
},
|
},
|
||||||
) {
|
) { innerPadding ->
|
||||||
val hottestPostsListState = rememberLazyListState()
|
val hottestPostsListState = rememberLazyListState()
|
||||||
NavHost(navController, startDestination = Destination.Hottest.route) {
|
NavHost(navController, startDestination = Destination.Hottest.route) {
|
||||||
composable(Destination.Hottest.route) {
|
composable(Destination.Hottest.route) {
|
||||||
|
@ -69,12 +71,14 @@ fun LobstersApp() {
|
||||||
listState = hottestPostsListState,
|
listState = hottestPostsListState,
|
||||||
overscrollAction = viewModel::getMorePosts,
|
overscrollAction = viewModel::getMorePosts,
|
||||||
saveAction = viewModel::savePost,
|
saveAction = viewModel::savePost,
|
||||||
|
modifier = Modifier.padding(bottom = innerPadding.bottom),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
composable(Destination.Saved.route) {
|
composable(Destination.Saved.route) {
|
||||||
SavedPosts(
|
SavedPosts(
|
||||||
posts = savedPosts,
|
posts = savedPosts,
|
||||||
saveAction = viewModel::removeSavedPost,
|
saveAction = viewModel::removeSavedPost,
|
||||||
|
modifier = Modifier.padding(bottom = innerPadding.bottom),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue