Renaming userId into locationUserId in message location item

This commit is contained in:
Maxime NATUREL 2022-05-02 10:29:14 +02:00
parent 8b628229ed
commit adbc430ac8
3 changed files with 5 additions and 5 deletions

View File

@ -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)

View File

@ -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)
} }

View File

@ -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