Rename fun for clarity
This commit is contained in:
parent
b14e557c36
commit
83ed80e6d8
|
@ -63,5 +63,5 @@ data class MessageLocationContent(
|
|||
@Json(name = "org.matrix.msc1767.text") val text: String? = null
|
||||
) : MessageContent {
|
||||
|
||||
fun getUri() = locationInfo?.geoUri ?: geoUri
|
||||
fun getBestGeoUri() = locationInfo?.geoUri ?: geoUri
|
||||
}
|
||||
|
|
|
@ -614,7 +614,7 @@ class RoomDetailFragment @Inject constructor(
|
|||
|
||||
private fun handleShowLocationPreview(locationContent: MessageLocationContent, senderId: String) {
|
||||
// TODO Create a helper
|
||||
val geoUri = locationContent.getUri()
|
||||
val geoUri = locationContent.getBestGeoUri()
|
||||
val locationData = LocationData.create(geoUri)
|
||||
navigator
|
||||
.openLocationSharing(
|
||||
|
@ -1948,7 +1948,7 @@ class RoomDetailFragment @Inject constructor(
|
|||
when (action.messageContent) {
|
||||
is MessageTextContent -> shareText(requireContext(), action.messageContent.body)
|
||||
is MessageLocationContent -> {
|
||||
LocationData.create(action.messageContent.getUri())?.let {
|
||||
LocationData.create(action.messageContent.getBestGeoUri())?.let {
|
||||
openLocation(requireActivity(), it.latitude, it.longitude)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ class MessageActionsEpoxyController @Inject constructor(
|
|||
val bindingOptions = spanUtils.getBindingOptions(body)
|
||||
val locationUrl = state.timelineEvent()?.root?.getClearContent()
|
||||
?.toModel<MessageLocationContent>(catchError = true)
|
||||
?.let { LocationData.create(it.getUri()) }
|
||||
?.let { LocationData.create(it.getBestGeoUri()) }
|
||||
?.let { urlMapProvider.buildStaticMapUrl(it, INITIAL_MAP_ZOOM_IN_TIMELINE, 1200, 800) }
|
||||
|
||||
bottomSheetMessagePreviewItem {
|
||||
|
|
|
@ -200,7 +200,7 @@ class MessageItemFactory @Inject constructor(
|
|||
informationData: MessageInformationData,
|
||||
highlight: Boolean,
|
||||
attributes: AbsMessageItem.Attributes): MessageLocationItem? {
|
||||
val geoUri = locationContent.getUri()
|
||||
val geoUri = locationContent.getBestGeoUri()
|
||||
val locationData = LocationData.create(geoUri)
|
||||
|
||||
val width = resources.displayMetrics.widthPixels - dimensionConverter.dpToPx(60)
|
||||
|
|
Loading…
Reference in New Issue