Skip to content

Commit

Permalink
fix: padding values scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
jvsena42 committed Dec 21, 2023
1 parent 6b8f969 commit 1c1d5d3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,16 @@ private fun ScreenProducts(
}
}
) { paddingValues ->
MakeList(uiState, Modifier.padding(paddingValues) , onAction)
MakeList(uiState, Modifier.padding(paddingValues), onAction)
}
}

@Composable
private fun MakeList(uiState: ProductsUIState, modifier: Modifier , onAction: (ScreenActions) -> Unit) {
private fun MakeList(
uiState: ProductsUIState,
modifier: Modifier,
onAction: (ScreenActions) -> Unit
) {
val list by uiState.productsList.collectAsState()

if (list.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.bulletapps.candypricer.presentation.ui.scenes.main.user.supplies

import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.*
import androidx.compose.material.MaterialTheme.colors
Expand Down Expand Up @@ -105,20 +106,24 @@ private fun ScreenContent(
)
}
}
) {
MakeList(uiState, onAction)
) { paddingValues ->
MakeList(uiState, Modifier.padding(paddingValues), onAction)
}
}

@Composable
private fun MakeList(uiState: SuppliesUIState, onAction: (ScreenActions) -> Unit) {
private fun MakeList(
uiState: SuppliesUIState,
modifier: Modifier,
onAction: (ScreenActions) -> Unit
) {
val list by uiState.suppliesList.collectAsState()

if (list.isEmpty()) {
TextEmpty(stringResource(R.string.add_supply_and_start_pricing))
} else {
LazyColumn(
modifier = Modifier
modifier = modifier
.fillMaxWidth()
.fillMaxHeight(),
horizontalAlignment = Alignment.CenterHorizontally,
Expand Down

0 comments on commit 1c1d5d3

Please sign in to comment.