Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.rememberScrollState
Expand Down Expand Up @@ -49,11 +50,13 @@ fun WooPosOrderDetails(
.padding(
start = WooPosSpacing.Medium.value,
end = WooPosSpacing.Medium.value,
top = WooPosSpacing.XLarge.value,
bottom = WooPosSpacing.XLarge.value
)
) {
Row {
Row(
modifier = Modifier.heightIn(min = WOO_POS_ORDERS_TOOLBAR_HEIGHT),
verticalAlignment = Alignment.CenterVertically
) {
WooPosText(
text = details.number,
style = WooPosTypography.Heading,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,21 @@ import com.woocommerce.android.ui.woopos.common.composeui.designsystem.WooPosThe
import com.woocommerce.android.ui.woopos.common.composeui.designsystem.WooPosTypography

@Composable
fun WooPosOrdersLoadingState() {
fun WooPosOrdersLoadingScreen() {
Row(modifier = Modifier.fillMaxSize()) {
WooPosOrdersListLoadingPane(
modifier = Modifier
.weight(0.3f)
.fillMaxHeight()
.background(MaterialTheme.colorScheme.surfaceBright)
.padding(top = WOO_POS_ORDERS_TOOLBAR_HEIGHT)
.padding(top = WooPosSpacing.XLarge.value)
)

OrderDetailsLoadingPane(
modifier = Modifier
.weight(0.7f)
.fillMaxHeight()
.background(MaterialTheme.colorScheme.surface)
.padding(top = WooPosSpacing.Large.value)
)
}
}
Expand Down Expand Up @@ -127,14 +125,16 @@ private fun OrderDetailsLoadingPane(modifier: Modifier = Modifier) {
Column(
modifier = modifier
.fillMaxSize()
.padding(WooPosSpacing.Medium.value)
.padding(horizontal = WooPosSpacing.Medium.value)
) {
Row(
modifier = Modifier
.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween
) {
Column {
Spacer(modifier = Modifier.height(WooPosSpacing.Small.value))

WooPosShimmerText(
text = "Order #123",
style = WooPosTypography.Heading.style,
Expand Down Expand Up @@ -301,6 +301,6 @@ private fun TotalLoadingItem() {
@Composable
fun WooPosOrdersLoadingStatePreview() {
WooPosTheme {
WooPosOrdersLoadingState()
WooPosOrdersLoadingScreen()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ private fun WooPosOrdersScreen(
) {
BackHandler { onBackClicked() }

Box(modifier = Modifier.fillMaxSize()) {
Box(
modifier = Modifier
.fillMaxSize()
.statusBarsPadding()
) {
when (state) {
is WooPosOrdersState.Content -> OrdersContent(
state = state,
Expand All @@ -152,7 +156,7 @@ private fun WooPosOrdersScreen(
onRetryClicked = onOrdersLoadingErrorRetryButtonClicked
)

is WooPosOrdersState.Loading -> WooPosOrdersLoadingState()
is WooPosOrdersState.Loading -> WooPosOrdersLoadingScreen()
}

if (state.searchInputState is WooPosSearchInputState.Closed) {
Expand Down Expand Up @@ -234,9 +238,7 @@ private fun OrdersListPane(
state = state.searchInputState,
searchIconBackgroundColor = MaterialTheme.colorScheme.surface,
onEvent = onSearchEvent,
modifier = Modifier
.statusBarsPadding()
.align(Alignment.CenterEnd)
modifier = Modifier.align(Alignment.CenterEnd)
)
}

Expand Down