Map sdk timeline item for LiveLocation

This commit is contained in:
ganfra 2026-03-17 12:28:44 +01:00
parent 92920b862b
commit a22c9871e3
7 changed files with 22 additions and 9 deletions

View file

@ -33,7 +33,7 @@ fun TimelineItemLocationView(
lat = content.location.lat,
lon = content.location.lon,
zoom = 15.0,
contentDescription = content.body
contentDescription = content.description
)
}

View file

@ -105,7 +105,6 @@ class TimelineItemContentFactory(
}.lastOrNull()
if (lastKnownLocation != null) {
TimelineItemLocationContent(
body = itemContent.body.trimEnd(),
description = itemContent.description?.trimEnd(),
assetType = itemContent.assetType,
senderId = sender,

View file

@ -150,7 +150,6 @@ class TimelineItemContentMessageFactory(
)
} else {
TimelineItemLocationContent(
body = body,
location = location,
description = messageType.description,
senderId = senderId,

View file

@ -19,7 +19,6 @@ import io.element.android.libraries.matrix.api.timeline.item.event.getAvatarUrl
import io.element.android.libraries.matrix.api.timeline.item.event.getDisplayName
data class TimelineItemLocationContent(
val body: String,
val senderId: UserId,
val senderProfile: ProfileDetails,
val location: Location,

View file

@ -24,12 +24,11 @@ open class TimelineItemLocationContentProvider : PreviewParameterProvider<Timeli
}
fun aTimelineItemLocationContent(
body: String = "",
senderId: UserId = UserId("@sender:matrix.org"),
senderProfile: ProfileDetails = aProfileDetailsReady(),
description: String? = null,
mode: TimelineItemLocationContent.Mode = TimelineItemLocationContent.Mode.Static,
) = TimelineItemLocationContent(
body = body,
location = Location(
lat = 52.2445,
lon = 0.7186,
@ -37,5 +36,6 @@ fun aTimelineItemLocationContent(
),
senderId = senderId,
senderProfile = senderProfile,
description = description,
mode = mode
)