mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Renaming userId into locationUserId in message location item
This commit is contained in:
parent
8b628229ed
commit
adbc430ac8
@ -237,14 +237,14 @@ class MessageItemFactory @Inject constructor(
|
|||||||
urlMapProvider.buildStaticMapUrl(it, INITIAL_MAP_ZOOM_IN_TIMELINE, width, height)
|
urlMapProvider.buildStaticMapUrl(it, INITIAL_MAP_ZOOM_IN_TIMELINE, width, height)
|
||||||
}
|
}
|
||||||
|
|
||||||
val userId = if (locationContent.isSelfLocation()) informationData.senderId else null
|
val locationUserId = if (locationContent.isSelfLocation()) informationData.senderId else null
|
||||||
|
|
||||||
return MessageLocationItem_()
|
return MessageLocationItem_()
|
||||||
.attributes(attributes)
|
.attributes(attributes)
|
||||||
.locationUrl(locationUrl)
|
.locationUrl(locationUrl)
|
||||||
.mapWidth(width)
|
.mapWidth(width)
|
||||||
.mapHeight(height)
|
.mapHeight(height)
|
||||||
.userId(userId)
|
.locationUserId(locationUserId)
|
||||||
.locationPinProvider(locationPinProvider)
|
.locationPinProvider(locationPinProvider)
|
||||||
.highlighted(highlight)
|
.highlighted(highlight)
|
||||||
.leftGuideline(avatarSizeProvider.leftGuideline)
|
.leftGuideline(avatarSizeProvider.leftGuideline)
|
||||||
|
@ -41,7 +41,7 @@ abstract class AbsMessageLocationItem<H : AbsMessageLocationItem.Holder> : AbsMe
|
|||||||
var locationUrl: String? = null
|
var locationUrl: String? = null
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var userId: String? = null
|
var locationUserId: String? = null
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var mapWidth: Int = 0
|
var mapWidth: Int = 0
|
||||||
@ -89,7 +89,7 @@ abstract class AbsMessageLocationItem<H : AbsMessageLocationItem.Holder> : AbsMe
|
|||||||
target: Target<Drawable>?,
|
target: Target<Drawable>?,
|
||||||
dataSource: DataSource?,
|
dataSource: DataSource?,
|
||||||
isFirstResource: Boolean): Boolean {
|
isFirstResource: Boolean): Boolean {
|
||||||
locationPinProvider?.create(userId) { pinDrawable ->
|
locationPinProvider?.create(locationUserId) { pinDrawable ->
|
||||||
// we are not using Glide since it does not display it correctly when there is no user photo
|
// we are not using Glide since it does not display it correctly when there is no user photo
|
||||||
holder.staticMapPinImageView.setImageDrawable(pinDrawable)
|
holder.staticMapPinImageView.setImageDrawable(pinDrawable)
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ abstract class MessageLiveLocationItem : AbsMessageLocationItem<MessageLiveLocat
|
|||||||
|
|
||||||
private fun bindLocationLiveBanner(holder: Holder) {
|
private fun bindLocationLiveBanner(holder: Holder) {
|
||||||
// TODO add check on device id to confirm that is the one that sent the beacon
|
// TODO add check on device id to confirm that is the one that sent the beacon
|
||||||
val isEmitter = currentUserId != null && currentUserId == userId
|
val isEmitter = currentUserId != null && currentUserId == locationUserId
|
||||||
val messageLayout = attributes.informationData.messageLayout
|
val messageLayout = attributes.informationData.messageLayout
|
||||||
val viewState = buildViewState(holder, messageLayout, isEmitter)
|
val viewState = buildViewState(holder, messageLayout, isEmitter)
|
||||||
holder.locationLiveMessageBanner.isVisible = true
|
holder.locationLiveMessageBanner.isVisible = true
|
||||||
|
Loading…
Reference in New Issue
Block a user