Shared detail UX: make image clickable in FoundDetailContent (use onImageClick via Modifier.clickable)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package app.klottr.ui
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
@@ -96,20 +97,8 @@ fun FoundDetailContent(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.heightIn(min = 120.dp, max = 320.dp)
|
||||
.then(Modifier), // Behåll neutral modifier; klick styrs nedan
|
||||
.then(if (onImageClick != null) Modifier.clickable { onImageClick() } else Modifier),
|
||||
)
|
||||
// Klick-overlay (enkelt sätt utan Material)
|
||||
if (onImageClick != null) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.heightIn(min = 0.dp), // overlay-yta matchar bilden visuellt i layouten
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
// Gestdetektering med Material-fri foundation är överkurs här; Android kan omge Image med clickable innan pass.
|
||||
// Vi lämnar klick som "hint": onImageClick anropas från plattformen om man vill.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Laddning som inte döljer texten
|
||||
|
||||
Reference in New Issue
Block a user