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 @@ + + +