-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for embedding to specific location with minimal effort
- Loading branch information
Michael Jordan
committed
Oct 19, 2023
1 parent
799437c
commit 8ec4ca7
Showing
6 changed files
with
95 additions
and
10 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
shared/src/androidMain/kotlin/com/bumble/puzzyx/imageloader/ResourceImage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.bumble.puzzyx.imageloader | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.layout.ContentScale | ||
|
||
@Composable | ||
actual fun EmbeddableResourceImage( | ||
path: String, | ||
modifier: Modifier, | ||
contentDescription: String?, | ||
contentScale: ContentScale | ||
) { | ||
ResourceImage( | ||
path = path, | ||
modifier = modifier, | ||
contentScale = contentScale, | ||
contentDescription = contentDescription, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
shared/src/desktopMain/kotlin/com/bumble/puzzyx/imageloader/EmbeddableResourceImage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.bumble.puzzyx.imageloader | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.layout.ContentScale | ||
|
||
@Composable | ||
actual fun EmbeddableResourceImage( | ||
path: String, | ||
modifier: Modifier, | ||
contentDescription: String?, | ||
contentScale: ContentScale | ||
) { | ||
ResourceImage( | ||
path = path, | ||
modifier = modifier, | ||
contentScale = contentScale, | ||
contentDescription = contentDescription, | ||
) | ||
} |
23 changes: 23 additions & 0 deletions
23
shared/src/jsMain/kotlin/com/bumble/puzzyx/imageloader/EmbeddableResourceImage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.bumble.puzzyx.imageloader | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.layout.ContentScale | ||
|
||
private const val EMBED_URL = "appyx/where/hosted/sample" | ||
|
||
@Composable | ||
actual fun EmbeddableResourceImage( | ||
path: String, | ||
modifier: Modifier, | ||
contentDescription: String?, | ||
contentScale: ContentScale | ||
) { | ||
ResourceImage( | ||
path = EMBED_URL + path, | ||
fallbackUrl = path, | ||
modifier = modifier, | ||
contentScale = contentScale, | ||
contentDescription = contentDescription, | ||
) | ||
} |