From 9ad20866cb55b2eaadc5122ddb34f635a28e0836 Mon Sep 17 00:00:00 2001 From: Kevin Schildhorn Date: Wed, 11 Dec 2024 16:19:40 -0500 Subject: [PATCH] Adding placeholder images --- shared/build.gradle.kts | 6 ++++++ .../commonMain/composeResources/drawable/error.xml | 9 +++++++++ .../composeResources/drawable/photo_camera.xml | 9 +++++++++ .../fotopresenter/ui/atoms/FotoTypography.kt | 14 ++++++-------- .../composables/grid/ImageDirectoryGridCell.kt | 7 +++++++ .../commonMain/resources/drawable/photo_camera.xml | 9 +++++++++ 6 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 shared/src/commonMain/composeResources/drawable/error.xml create mode 100644 shared/src/commonMain/composeResources/drawable/photo_camera.xml create mode 100644 shared/src/commonMain/resources/drawable/photo_camera.xml diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index c457cd9..dd478e5 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -147,3 +147,9 @@ sqldelight { } } } + +compose.resources { + publicResClass = false + packageOfResClass = "com.kevinschildhorn.fotopresenter" + generateResClass = auto +} diff --git a/shared/src/commonMain/composeResources/drawable/error.xml b/shared/src/commonMain/composeResources/drawable/error.xml new file mode 100644 index 0000000..9c10d33 --- /dev/null +++ b/shared/src/commonMain/composeResources/drawable/error.xml @@ -0,0 +1,9 @@ + + + diff --git a/shared/src/commonMain/composeResources/drawable/photo_camera.xml b/shared/src/commonMain/composeResources/drawable/photo_camera.xml new file mode 100644 index 0000000..58350f0 --- /dev/null +++ b/shared/src/commonMain/composeResources/drawable/photo_camera.xml @@ -0,0 +1,9 @@ + + + diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/atoms/FotoTypography.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/atoms/FotoTypography.kt index 4ee641b..8f5f880 100644 --- a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/atoms/FotoTypography.kt +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/atoms/FotoTypography.kt @@ -8,16 +8,14 @@ import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.sp -import fotopresenter.shared.generated.resources.Res -import fotopresenter.shared.generated.resources.quicksand_bold -import fotopresenter.shared.generated.resources.quicksand_light -import fotopresenter.shared.generated.resources.quicksand_medium -import fotopresenter.shared.generated.resources.quicksand_regular -import fotopresenter.shared.generated.resources.quicksand_semibold -import org.jetbrains.compose.resources.ExperimentalResourceApi +import com.kevinschildhorn.fotopresenter.Res +import com.kevinschildhorn.fotopresenter.quicksand_bold +import com.kevinschildhorn.fotopresenter.quicksand_light +import com.kevinschildhorn.fotopresenter.quicksand_medium +import com.kevinschildhorn.fotopresenter.quicksand_regular +import com.kevinschildhorn.fotopresenter.quicksand_semibold import org.jetbrains.compose.resources.Font -@OptIn(ExperimentalResourceApi::class) @Composable fun QuicksandFontFamily() = FontFamily( diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/directory/composables/grid/ImageDirectoryGridCell.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/directory/composables/grid/ImageDirectoryGridCell.kt index 566d3f7..3b3bcff 100644 --- a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/directory/composables/grid/ImageDirectoryGridCell.kt +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/directory/composables/grid/ImageDirectoryGridCell.kt @@ -1,13 +1,18 @@ package com.kevinschildhorn.fotopresenter.ui.screens.directory.composables.grid import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.layout.ContentScale import coil3.compose.AsyncImage +import com.kevinschildhorn.fotopresenter.Res +import com.kevinschildhorn.fotopresenter.error +import com.kevinschildhorn.fotopresenter.photo_camera import com.kevinschildhorn.fotopresenter.ui.atoms.fotoColors import com.kevinschildhorn.fotopresenter.ui.screens.directory.DirectoryGridCellState +import org.jetbrains.compose.resources.painterResource @Composable fun ImageDirectoryGridCell( @@ -20,6 +25,8 @@ fun ImageDirectoryGridCell( contentDescription = imageContent.name, contentScale = ContentScale.Crop, modifier = Modifier.fillMaxSize().background(fotoColors.surface), + error = painterResource(Res.drawable.error), + placeholder = painterResource(Res.drawable.photo_camera), ) } } diff --git a/shared/src/commonMain/resources/drawable/photo_camera.xml b/shared/src/commonMain/resources/drawable/photo_camera.xml new file mode 100644 index 0000000..58350f0 --- /dev/null +++ b/shared/src/commonMain/resources/drawable/photo_camera.xml @@ -0,0 +1,9 @@ + + +