Share DM/Wiki/Fornsok detail UI (material-free); Android keeps only dialog shells
This commit is contained in:
@@ -137,12 +137,15 @@ import app.klottr.net.fetchNoteDetail
|
|||||||
import app.klottr.net.uploadImageFromUri
|
import app.klottr.net.uploadImageFromUri
|
||||||
import app.klottr.shared.SharedPing
|
import app.klottr.shared.SharedPing
|
||||||
import app.klottr.theme.KlottrTheme
|
import app.klottr.theme.KlottrTheme
|
||||||
|
import app.klottr.ui.DmDetailContent // Ny: delad DM-layout
|
||||||
|
import app.klottr.ui.FornsokDetailContent // Ny: delad Fornsök-layout
|
||||||
import app.klottr.ui.FoundList // Delad, material-fri listkomponent för "Hittat"
|
import app.klottr.ui.FoundList // Delad, material-fri listkomponent för "Hittat"
|
||||||
import app.klottr.ui.FoundContent // Delat innehåll för “Hittat”
|
import app.klottr.ui.FoundContent // Delat innehåll för “Hittat”
|
||||||
import app.klottr.ui.FoundDetailContent // Delad detalj-UI (CMP)
|
import app.klottr.ui.FoundDetailContent // Delad detalj-UI (CMP)
|
||||||
import app.klottr.ui.NearbyContent // Delat material-fritt innehåll för Närliggande
|
import app.klottr.ui.NearbyContent // Delat material-fritt innehåll för Närliggande
|
||||||
import app.klottr.ui.MapPanelShell
|
import app.klottr.ui.MapPanelShell
|
||||||
import app.klottr.ui.SettingsContent // Delad material-fri UI för inställningar
|
import app.klottr.ui.SettingsContent // Delad material-fri UI för inställningar
|
||||||
|
import app.klottr.ui.WikiDetailContent // Ny: delad Wiki-layout
|
||||||
import app.klottr.ui.WriteDocContent // Använd delad, material-fri formulär-UI
|
import app.klottr.ui.WriteDocContent // Använd delad, material-fri formulär-UI
|
||||||
import app.klottr.util.Auth
|
import app.klottr.util.Auth
|
||||||
import app.klottr.util.Config
|
import app.klottr.util.Config
|
||||||
@@ -2074,11 +2077,17 @@ private fun KlotterDialog(
|
|||||||
loading = loading,
|
loading = loading,
|
||||||
firstVisitText = firstVisitText,
|
firstVisitText = firstVisitText,
|
||||||
lastVisitText = lastVisitText,
|
lastVisitText = lastVisitText,
|
||||||
titleStyle = MaterialTheme.typography.titleLarge, // Android ger stil
|
titleStyle = MaterialTheme.typography.titleLarge.copy( // Ändrad: ge färg
|
||||||
bodyStyle = MaterialTheme.typography.bodyMedium, // Android ger stil
|
color = MaterialTheme.colorScheme.onSurface
|
||||||
captionStyle = MaterialTheme.typography.bodySmall.copy( // Android ger stil
|
),
|
||||||
|
bodyStyle = MaterialTheme.typography.bodyMedium.copy( // Ändrad: ge färg
|
||||||
|
color = MaterialTheme.colorScheme.onSurface
|
||||||
|
),
|
||||||
|
captionStyle = MaterialTheme.typography.bodySmall.copy( // Ändrad: ge färg
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
fontWeight = FontWeight.Normal
|
fontWeight = FontWeight.Normal
|
||||||
),
|
),
|
||||||
|
|
||||||
// Actions-slot: vi ritar Maps / Radera / Stäng med Android-komponenter
|
// Actions-slot: vi ritar Maps / Radera / Stäng med Android-komponenter
|
||||||
actions = {
|
actions = {
|
||||||
val canDelete = currentUserId != null && ownerUserId != null && currentUserId == ownerUserId
|
val canDelete = currentUserId != null && ownerUserId != null && currentUserId == ownerUserId
|
||||||
@@ -2305,51 +2314,26 @@ private fun WikiArticleDialog(
|
|||||||
if (loading) {
|
if (loading) {
|
||||||
Text("Söker …")
|
Text("Söker …")
|
||||||
} else {
|
} else {
|
||||||
Column(
|
WikiDetailContent(
|
||||||
modifier = Modifier
|
titleText = title,
|
||||||
.fillMaxWidth()
|
extractText = extract,
|
||||||
.verticalScroll(rememberScrollState()),
|
distanceText = wikiDistanceText, // Oför: redan beräknad
|
||||||
verticalArrangement = Arrangement.spacedBy(12.dp)
|
coordText = if (showCoords && lat != null && lon != null) formatCoords(lat, lon) else null,
|
||||||
) {
|
thumb = thumb?.asImageBitmap(),
|
||||||
if (thumb != null) {
|
titleStyle = MaterialTheme.typography.titleLarge,
|
||||||
Image(
|
bodyStyle = MaterialTheme.typography.bodyMedium,
|
||||||
bitmap = thumb!!.asImageBitmap(),
|
captionStyle = MaterialTheme.typography.bodySmall.copy(color = MaterialTheme.colorScheme.onSurfaceVariant),
|
||||||
contentDescription = null,
|
actions = {
|
||||||
modifier = Modifier
|
Button(onClick = {
|
||||||
.fillMaxWidth()
|
val url = "https://sv.m.wikipedia.org/?curid=$pageId"
|
||||||
.heightIn(min = 120.dp)
|
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
|
||||||
.clip(RoundedCornerShape(8.dp)),
|
}) { Text("Läs mer") }
|
||||||
contentScale = ContentScale.Crop
|
|
||||||
)
|
|
||||||
}
|
|
||||||
Text(extract.ifBlank { "Ingen sammanfattning tillgänglig." })
|
|
||||||
|
|
||||||
HorizontalDivider()
|
|
||||||
val bottomCoordPart = if (showCoords) " • (%.5f, %.5f)".format(lat, lon) else ""
|
|
||||||
|
|
||||||
Text(
|
|
||||||
"Klotter • $wikiDistanceText bort$bottomCoordPart",
|
|
||||||
style = MaterialTheme.typography.bodySmall,
|
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) {
|
|
||||||
Button(
|
|
||||||
onClick = {
|
|
||||||
val url = "https://sv.m.wikipedia.org/?curid=$pageId"
|
|
||||||
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
|
|
||||||
}
|
|
||||||
) { Text("Läs mer") }
|
|
||||||
|
|
||||||
Button(
|
Button(
|
||||||
onClick = {
|
onClick = {
|
||||||
if (lat != null && lon != null) {
|
if (lat != null && lon != null) {
|
||||||
val uri = Uri.parse("geo:$lat,$lon?q=$lat,$lon(${Uri.encode(title.ifBlank { "Wikipedia-plats" })})")
|
val uri = Uri.parse("geo:$lat,$lon?q=$lat,$lon(${Uri.encode(title.ifBlank { "Wikipedia-plats" })})")
|
||||||
val intent = Intent(
|
val intent = Intent(Intent.ACTION_VIEW, uri).apply { setPackage("com.google.android.apps.maps") }
|
||||||
Intent.ACTION_VIEW,
|
|
||||||
uri
|
|
||||||
).apply { setPackage("com.google.android.apps.maps") }
|
|
||||||
try { context.startActivity(intent) } catch (_: Exception) {
|
try { context.startActivity(intent) } catch (_: Exception) {
|
||||||
context.startActivity(Intent(Intent.ACTION_VIEW, uri))
|
context.startActivity(Intent(Intent.ACTION_VIEW, uri))
|
||||||
}
|
}
|
||||||
@@ -2358,7 +2342,7 @@ private fun WikiArticleDialog(
|
|||||||
enabled = lat != null && lon != null
|
enabled = lat != null && lon != null
|
||||||
) { Text("Maps") }
|
) { Text("Maps") }
|
||||||
}
|
}
|
||||||
}
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -2429,33 +2413,20 @@ private fun FornsokDialog(
|
|||||||
.widthIn(max = dialogWidth)
|
.widthIn(max = dialogWidth)
|
||||||
.heightIn(max = 520.dp)
|
.heightIn(max = 520.dp)
|
||||||
) {
|
) {
|
||||||
Column(
|
FornsokDetailContent(
|
||||||
modifier = Modifier
|
titleText = title,
|
||||||
.fillMaxWidth()
|
descText = desc,
|
||||||
.verticalScroll(rememberScrollState()),
|
distanceText = fornDistanceText,
|
||||||
verticalArrangement = Arrangement.spacedBy(12.dp)
|
coordText = if (showCoords) formatCoords(platLat, platLon) else null,
|
||||||
) {
|
titleStyle = MaterialTheme.typography.titleLarge,
|
||||||
Text(desc.ifBlank { "Ingen sammanfattning tillgänglig." })
|
bodyStyle = MaterialTheme.typography.bodyMedium,
|
||||||
|
captionStyle = MaterialTheme.typography.bodySmall.copy(color = MaterialTheme.colorScheme.onSurfaceVariant),
|
||||||
HorizontalDivider()
|
actions = {
|
||||||
|
|
||||||
val coordPart = if (showCoords) " • " + formatCoords(platLat, platLon) else ""
|
|
||||||
|
|
||||||
Text(
|
|
||||||
"Fornsök • $fornDistanceText bort$coordPart",
|
|
||||||
style = MaterialTheme.typography.bodySmall,
|
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
|
||||||
)
|
|
||||||
|
|
||||||
Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) {
|
|
||||||
Button(
|
Button(
|
||||||
onClick = {
|
onClick = {
|
||||||
val geoTitle = Uri.encode(title)
|
val geoTitle = Uri.encode(title)
|
||||||
val geo = Uri.parse("geo:$platLat,$platLon?q=$platLat,$platLon($geoTitle)")
|
val geo = Uri.parse("geo:$platLat,$platLon?q=$platLat,$platLon($geoTitle)")
|
||||||
val intent = Intent(
|
val intent = Intent(Intent.ACTION_VIEW, geo).apply { setPackage("com.google.android.apps.maps") }
|
||||||
Intent.ACTION_VIEW,
|
|
||||||
geo
|
|
||||||
).apply { setPackage("com.google.android.apps.maps") }
|
|
||||||
try { context.startActivity(intent) } catch (_: Exception) {
|
try { context.startActivity(intent) } catch (_: Exception) {
|
||||||
context.startActivity(Intent(Intent.ACTION_VIEW, geo))
|
context.startActivity(Intent(Intent.ACTION_VIEW, geo))
|
||||||
}
|
}
|
||||||
@@ -2470,9 +2441,10 @@ private fun FornsokDialog(
|
|||||||
enabled = link != null
|
enabled = link != null
|
||||||
) { Text("Läs mer") }
|
) { Text("Läs mer") }
|
||||||
}
|
}
|
||||||
}
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
confirmButton = { Button(onClick = onClose) { Text("Stäng") } }
|
confirmButton = { Button(onClick = onClose) { Text("Stäng") } }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -2578,75 +2550,56 @@ private fun DmDialog(
|
|||||||
.widthIn(max = dialogWidth)
|
.widthIn(max = dialogWidth)
|
||||||
.heightIn(max = 520.dp)
|
.heightIn(max = 520.dp)
|
||||||
) {
|
) {
|
||||||
if (loading) {
|
val displayTitle = remember(item.id, detailText) {
|
||||||
Text("Söker …")
|
val t = item.title.ifBlank { "DigitaltMuseum" }.trim()
|
||||||
} else {
|
t
|
||||||
Column(
|
}
|
||||||
modifier = Modifier
|
// Samma heuristik som du hade: splitta ev. text
|
||||||
.fillMaxWidth()
|
val (firstLine, restText) = remember(item.id, detailText) {
|
||||||
.verticalScroll(rememberScrollState()),
|
val body = detailText?.trim().orEmpty()
|
||||||
verticalArrangement = Arrangement.spacedBy(12.dp)
|
if (body.isBlank()) "" to null
|
||||||
) {
|
else {
|
||||||
if (thumb != null) {
|
val idx = body.indexOfFirst { it == '.' || it == '!' || it == '?' }
|
||||||
Image(
|
if (idx >= 0 && idx + 1 < body.length) {
|
||||||
bitmap = thumb!!.asImageBitmap(),
|
val first = body.substring(0, idx + 1).trim()
|
||||||
contentDescription = null,
|
val rest = body.substring(idx + 1).trim().ifEmpty { null }
|
||||||
modifier = Modifier
|
first to rest
|
||||||
.fillMaxWidth()
|
} else body to null
|
||||||
.heightIn(min = 120.dp)
|
|
||||||
.clip(RoundedCornerShape(8.dp)),
|
|
||||||
contentScale = ContentScale.Crop
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
displayBody?.let { Text(it) }
|
|
||||||
|
|
||||||
|
|
||||||
HorizontalDivider()
|
|
||||||
|
|
||||||
val bottomCoordPart = if (showCoords) " • (%.5f, %.5f)".format(item.lat, item.lon) else ""
|
|
||||||
Text(
|
|
||||||
"DigitaltMuseum • $dmDistanceText$bottomCoordPart",
|
|
||||||
style = MaterialTheme.typography.bodySmall,
|
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
|
||||||
)
|
|
||||||
|
|
||||||
Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) {
|
|
||||||
Button(
|
|
||||||
onClick = {
|
|
||||||
if (!item.url.isNullOrBlank()) {
|
|
||||||
val i = Intent(Intent.ACTION_VIEW, Uri.parse(item.url))
|
|
||||||
try { context.startActivity(i) } catch (_: Exception) {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
enabled = !item.url.isNullOrBlank()
|
|
||||||
) { Text("Öppna bild") }
|
|
||||||
|
|
||||||
Button(
|
|
||||||
onClick = {
|
|
||||||
val uri = Uri.parse("geo:${item.lat},${item.lon}?q=${item.lat},${item.lon}(${Uri.encode(item.title.ifBlank { "DigitaltMuseum" })})")
|
|
||||||
val i = Intent(Intent.ACTION_VIEW, uri).apply {
|
|
||||||
setPackage("com.google.android.apps.maps")
|
|
||||||
}
|
|
||||||
try { context.startActivity(i) } catch (_: Exception) {
|
|
||||||
context.startActivity(Intent(Intent.ACTION_VIEW, uri))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
) { Text("Maps") }
|
|
||||||
|
|
||||||
Button(
|
|
||||||
onClick = {
|
|
||||||
val u = item.webUrl
|
|
||||||
if (!u.isNullOrBlank()) {
|
|
||||||
val i = Intent(Intent.ACTION_VIEW, Uri.parse(u))
|
|
||||||
try { context.startActivity(i) } catch (_: Exception) {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
enabled = !item.webUrl.isNullOrBlank()
|
|
||||||
) { Text("Läs mer") }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
DmDetailContent(
|
||||||
|
titleText = displayTitle,
|
||||||
|
bodyText = listOfNotNull(firstLine, restText).joinToString("\n\n"),
|
||||||
|
distanceText = dmDistanceText,
|
||||||
|
coordText = if (showCoords) formatCoords(item.lat, item.lon) else null,
|
||||||
|
image = thumb?.asImageBitmap(),
|
||||||
|
titleStyle = MaterialTheme.typography.titleLarge,
|
||||||
|
bodyStyle = MaterialTheme.typography.bodyMedium,
|
||||||
|
captionStyle = MaterialTheme.typography.bodySmall.copy(color = MaterialTheme.colorScheme.onSurfaceVariant),
|
||||||
|
actions = {
|
||||||
|
Button(
|
||||||
|
onClick = {
|
||||||
|
val labelEnc = Uri.encode(displayTitle)
|
||||||
|
val uri = Uri.parse("geo:${item.lat},${item.lon}?q=${item.lat},${item.lon}($labelEnc)")
|
||||||
|
val intent = Intent(Intent.ACTION_VIEW, uri).apply { setPackage("com.google.android.apps.maps") }
|
||||||
|
try { context.startActivity(intent) } catch (_: Exception) {
|
||||||
|
context.startActivity(Intent(Intent.ACTION_VIEW, uri))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
) { Text("Maps") }
|
||||||
|
|
||||||
|
Button(
|
||||||
|
onClick = {
|
||||||
|
val u = item.webUrl // Ändrad: objectUrl -> webUrl
|
||||||
|
if (!u.isNullOrBlank()) {
|
||||||
|
val i = Intent(Intent.ACTION_VIEW, Uri.parse(u))
|
||||||
|
try { context.startActivity(i) } catch (_: Exception) {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
enabled = !item.webUrl.isNullOrBlank() // Ändrad: objectUrl -> webUrl
|
||||||
|
) { Text("Läs mer") }
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
confirmButton = { Button(onClick = onClose) { Text("Stäng") } }
|
confirmButton = { Button(onClick = onClose) { Text("Stäng") } }
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package app.klottr.ui
|
||||||
|
|
||||||
|
import androidx.compose.foundation.Image
|
||||||
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.foundation.rememberScrollState
|
||||||
|
import androidx.compose.foundation.verticalScroll
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.ImageBitmap
|
||||||
|
import androidx.compose.ui.text.TextStyle
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.foundation.text.BasicText
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun DmDetailContent(
|
||||||
|
titleText: String,
|
||||||
|
bodyText: String?,
|
||||||
|
distanceText: String,
|
||||||
|
coordText: String?, // Förifylld av Android (t.ex. formatCoords)
|
||||||
|
image: ImageBitmap?, // Miniatyr om finns
|
||||||
|
titleStyle: TextStyle,
|
||||||
|
bodyStyle: TextStyle,
|
||||||
|
captionStyle: TextStyle,
|
||||||
|
actions: @Composable RowScope.() -> Unit
|
||||||
|
) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.verticalScroll(rememberScrollState()),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
|
) {
|
||||||
|
if (image != null) {
|
||||||
|
Image(bitmap = image, contentDescription = null, modifier = Modifier.fillMaxWidth())
|
||||||
|
}
|
||||||
|
BasicText(titleText, style = titleStyle)
|
||||||
|
if (!bodyText.isNullOrBlank()) {
|
||||||
|
BasicText(bodyText, style = bodyStyle)
|
||||||
|
}
|
||||||
|
|
||||||
|
val meta = buildString {
|
||||||
|
append("DigitaltMuseum • ")
|
||||||
|
append(distanceText)
|
||||||
|
if (!coordText.isNullOrBlank()) append(" • ").append(coordText)
|
||||||
|
}
|
||||||
|
BasicText(meta, style = captionStyle)
|
||||||
|
|
||||||
|
Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) { actions() }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package app.klottr.ui
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.foundation.rememberScrollState
|
||||||
|
import androidx.compose.foundation.verticalScroll
|
||||||
|
import androidx.compose.foundation.text.BasicText
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.text.TextStyle
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun FornsokDetailContent(
|
||||||
|
titleText: String,
|
||||||
|
descText: String,
|
||||||
|
distanceText: String,
|
||||||
|
coordText: String?,
|
||||||
|
titleStyle: TextStyle,
|
||||||
|
bodyStyle: TextStyle,
|
||||||
|
captionStyle: TextStyle,
|
||||||
|
actions: @Composable RowScope.() -> Unit
|
||||||
|
) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.verticalScroll(rememberScrollState()),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
|
) {
|
||||||
|
BasicText(if (titleText.isNotBlank()) titleText else "Fornlämning", style = titleStyle)
|
||||||
|
BasicText(descText.ifBlank { "Ingen sammanfattning tillgänglig." }, style = bodyStyle)
|
||||||
|
|
||||||
|
val meta = buildString {
|
||||||
|
append("Fornsök • ")
|
||||||
|
append(distanceText)
|
||||||
|
if (!coordText.isNullOrBlank()) append(" • ").append(coordText)
|
||||||
|
}
|
||||||
|
BasicText(meta, style = captionStyle)
|
||||||
|
|
||||||
|
Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) { actions() }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package app.klottr.ui
|
||||||
|
|
||||||
|
import androidx.compose.foundation.Image
|
||||||
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.foundation.rememberScrollState
|
||||||
|
import androidx.compose.foundation.verticalScroll
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.ImageBitmap
|
||||||
|
import androidx.compose.ui.text.TextStyle
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.foundation.text.BasicText
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun WikiDetailContent(
|
||||||
|
titleText: String,
|
||||||
|
extractText: String,
|
||||||
|
distanceText: String,
|
||||||
|
coordText: String?,
|
||||||
|
thumb: ImageBitmap?,
|
||||||
|
titleStyle: TextStyle,
|
||||||
|
bodyStyle: TextStyle,
|
||||||
|
captionStyle: TextStyle,
|
||||||
|
actions: @Composable RowScope.() -> Unit
|
||||||
|
) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.verticalScroll(rememberScrollState()),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
|
) {
|
||||||
|
if (thumb != null) {
|
||||||
|
Image(bitmap = thumb, contentDescription = null, modifier = Modifier.fillMaxWidth())
|
||||||
|
}
|
||||||
|
BasicText(if (titleText.isNotBlank()) titleText else "Wikipedia", style = titleStyle)
|
||||||
|
if (extractText.isNotBlank()) {
|
||||||
|
BasicText(extractText, style = bodyStyle)
|
||||||
|
}
|
||||||
|
|
||||||
|
val meta = buildString {
|
||||||
|
append("Wikipedia • ")
|
||||||
|
append(distanceText)
|
||||||
|
if (!coordText.isNullOrBlank()) append(" • ").append(coordText)
|
||||||
|
}
|
||||||
|
BasicText(meta, style = captionStyle)
|
||||||
|
|
||||||
|
Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) { actions() }
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user