Skip to content

Commit

Permalink
add reproducing sample for Image too large #82
Browse files Browse the repository at this point in the history
  • Loading branch information
luca992 committed Jan 15, 2024
1 parent 9b3dcf2 commit 86f216c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 26 deletions.
40 changes: 14 additions & 26 deletions kamel-samples/src/commonMain/kotlin/io/kamel/samples/launcher.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package io.kamel.samples

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.material.Button
import androidx.compose.material.ScrollableTabRow
import androidx.compose.material.Tab
import androidx.compose.material.Text
import androidx.compose.runtime.*
import io.kamel.core.config.KamelConfig
Expand All @@ -11,35 +11,23 @@ import io.kamel.image.config.LocalKamelConfig
@Composable
public fun launcher(kamelConfig: KamelConfig) {
CompositionLocalProvider(LocalKamelConfig provides kamelConfig) {
var sampleIndex by remember { mutableStateOf(0) }
var tabIndex by remember { mutableStateOf(0) }
val tabs = listOf("Gallery", "Bitmap", "Xl Bitmap", "Svg", "Xml")
Column {
Row {
Button({
sampleIndex = 0
}) {
Text("Gallery")
}
Button({
sampleIndex = 1
}) {
Text("Bitmap")
}
Button({
sampleIndex = 2
}) {
Text("Svg")
}
Button({
sampleIndex = 3
}) {
Text("Xml")
ScrollableTabRow(selectedTabIndex = tabIndex) {
tabs.forEachIndexed { index, title ->
Tab(text = { Text(title) },
selected = tabIndex == index,
onClick = { tabIndex = index }
)
}
}
when (sampleIndex) {
when (tabIndex) {
0 -> Gallery()
1 -> FileSample("Compose.png")
2 -> FileSample("ComposeXml.xml")
3 -> FileSample("Kotlin.svg")
2 -> FileSample("XlImage.png")
3 -> FileSample("ComposeXml.xml")
4 -> FileSample("Kotlin.svg")

else -> Text("Invalid Sample Index")
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 86f216c

Please sign in to comment.