diff --git a/base/src/main/java/org/robojackets/apiary/base/ui/dialog/DetailsDialog.kt b/base/src/main/java/org/robojackets/apiary/base/ui/dialog/DetailsDialog.kt index add2b5d..b18f018 100644 --- a/base/src/main/java/org/robojackets/apiary/base/ui/dialog/DetailsDialog.kt +++ b/base/src/main/java/org/robojackets/apiary/base/ui/dialog/DetailsDialog.kt @@ -7,6 +7,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +@Suppress("LongParameterList") @Composable fun DetailsDialog( icon: @Composable () -> Unit, @@ -17,6 +18,7 @@ fun DetailsDialog( modifier: Modifier = Modifier, confirmButton: @Composable () -> Unit = {}, dismissButton: @Composable () -> Unit, + detailsShouldRender: (idx: Int) -> Boolean = { true } ) { AlertDialog( onDismissRequest = onDismissRequest, @@ -25,9 +27,11 @@ fun DetailsDialog( title = title, text = { Column { - details.map { - HorizontalDivider() - it() + details.forEachIndexed { idx, it -> + if (detailsShouldRender(idx)) { + HorizontalDivider() + it() + } } HorizontalDivider() } diff --git a/build.gradle.kts b/build.gradle.kts index 00c8162..f94e18e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ buildscript { } dependencies { classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0") - classpath("com.android.tools.build:gradle:8.5.2") + classpath("com.android.tools.build:gradle:8.6.0-rc01") classpath("com.google.dagger:hilt-android-gradle-plugin:2.51.1") // This version needs to // match the version for other Hilt dependencies defined in Dependencies.kt classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1") @@ -34,7 +34,7 @@ plugins { id("io.gitlab.arturbosch.detekt").version("1.23.0") id("com.autonomousapps.dependency-analysis").version("1.21.0") id("com.github.ben-manes.versions").version("0.46.0") - id("com.android.library") version "8.5.2" apply false + id("com.android.library") version "8.6.0-rc01" apply false id("org.jetbrains.kotlin.android") version "1.9.0" apply false } diff --git a/merchandise/src/main/java/org/robojackets/apiary/merchandise/ui/MerchandiseDistributionScreen.kt b/merchandise/src/main/java/org/robojackets/apiary/merchandise/ui/MerchandiseDistributionScreen.kt index ca48165..1ca8dcd 100644 --- a/merchandise/src/main/java/org/robojackets/apiary/merchandise/ui/MerchandiseDistributionScreen.kt +++ b/merchandise/src/main/java/org/robojackets/apiary/merchandise/ui/MerchandiseDistributionScreen.kt @@ -38,6 +38,18 @@ fun MerchandiseDistributionScreen( prioritizeRetryButton = true, ) } + state.error != null -> { + ErrorMessageWithRetry( + title = state.error ?: "Merchandise distribution is temporarily unavailable", + onRetry = { + viewModel.loadMerchandiseItems( + forceRefresh = true, + selectedItemId = merchandiseItemId + ) + }, + prioritizeRetryButton = false, + ) + } state.loadingMerchandiseItems || state.selectedItem == null -> LoadingSpinner() else -> MerchandiseDistribution( state = state, diff --git a/merchandise/src/main/java/org/robojackets/apiary/merchandise/ui/pickupdialog/ConfirmPickupDialog.kt b/merchandise/src/main/java/org/robojackets/apiary/merchandise/ui/pickupdialog/ConfirmPickupDialog.kt index f988bd5..1630ed1 100644 --- a/merchandise/src/main/java/org/robojackets/apiary/merchandise/ui/pickupdialog/ConfirmPickupDialog.kt +++ b/merchandise/src/main/java/org/robojackets/apiary/merchandise/ui/pickupdialog/ConfirmPickupDialog.kt @@ -43,12 +43,21 @@ fun ConfirmPickupDialog( } } ), + detailsShouldRender = { idx -> + when (idx) { + 1 -> userShirtSize != null + else -> true + } + }, confirmButton = { Button( onClick = { onConfirm() }, - colors = ButtonDefaults.buttonColors(containerColor = success, contentColor = Color.White) + colors = ButtonDefaults.buttonColors( + containerColor = success, + contentColor = Color.White + ) ) { Text("Mark picked up") }