Skip to content

Commit

Permalink
Adding placeholder images
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinSchildhorn committed Dec 11, 2024
1 parent 4569daf commit 9ad2086
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 8 deletions.
6 changes: 6 additions & 0 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,9 @@ sqldelight {
}
}
}

compose.resources {
publicResClass = false
packageOfResClass = "com.kevinschildhorn.fotopresenter"
generateResClass = auto
}
9 changes: 9 additions & 0 deletions shared/src/commonMain/composeResources/drawable/error.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:pathData="M480,680q17,0 28.5,-11.5T520,640q0,-17 -11.5,-28.5T480,600q-17,0 -28.5,11.5T440,640q0,17 11.5,28.5T480,680ZM440,520h80v-240h-80v240ZM480,880q-83,0 -156,-31.5T197,763q-54,-54 -85.5,-127T80,480q0,-83 31.5,-156T197,197q54,-54 127,-85.5T480,80q83,0 156,31.5T763,197q54,54 85.5,127T880,480q0,83 -31.5,156T763,763q-54,54 -127,85.5T480,880Z"
android:fillColor="#5f6368"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:pathData="M480,700q75,0 127.5,-52.5T660,520q0,-75 -52.5,-127.5T480,340q-75,0 -127.5,52.5T300,520q0,75 52.5,127.5T480,700ZM480,620q-42,0 -71,-29t-29,-71q0,-42 29,-71t71,-29q42,0 71,29t29,71q0,42 -29,71t-71,29ZM160,840q-33,0 -56.5,-23.5T80,760v-480q0,-33 23.5,-56.5T160,200h126l74,-80h240l74,80h126q33,0 56.5,23.5T880,280v480q0,33 -23.5,56.5T800,840L160,840ZM160,760h640v-480L638,280l-73,-80L395,200l-73,80L160,280v480ZM480,520Z"
android:fillColor="#5f6368"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -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),
)
}
}
9 changes: 9 additions & 0 deletions shared/src/commonMain/resources/drawable/photo_camera.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:pathData="M480,700q75,0 127.5,-52.5T660,520q0,-75 -52.5,-127.5T480,340q-75,0 -127.5,52.5T300,520q0,75 52.5,127.5T480,700ZM480,620q-42,0 -71,-29t-29,-71q0,-42 29,-71t71,-29q42,0 71,29t29,71q0,42 -29,71t-71,29ZM160,840q-33,0 -56.5,-23.5T80,760v-480q0,-33 23.5,-56.5T160,200h126l74,-80h240l74,80h126q33,0 56.5,23.5T880,280v480q0,33 -23.5,56.5T800,840L160,840ZM160,760h640v-480L638,280l-73,-80L395,200l-73,80L160,280v480ZM480,520Z"
android:fillColor="#5f6368"/>
</vector>

0 comments on commit 9ad2086

Please sign in to comment.