Add comments about how to display avatar
This commit is contained in:
parent
139c56e793
commit
15dea4cfc6
|
|
@ -77,6 +77,8 @@ public class BaseMessageCollectionViewCellDefaultStyle: BaseMessageCollectionVie
|
|||
}
|
||||
}
|
||||
|
||||
// Override this method to provide a size of avatarImage, so avatar image will be displayed if there is any in the viewModel
|
||||
// if no image, then no avatar will be displayed, and a blank space will placehold at the position
|
||||
public func getAvatarImageSize(messageViewModel: MessageViewModelProtocol) -> CGSize {
|
||||
return CGSize.zero
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,11 @@ import ChattoAdditions
|
|||
|
||||
class BaseMessageCollectionViewCellAvatarStyle: BaseMessageCollectionViewCellDefaultStyle {
|
||||
override func getAvatarImageSize(messageViewModel: MessageViewModelProtocol) -> CGSize {
|
||||
return CGSize(width: 35, height: 35)
|
||||
if messageViewModel.isIncoming {
|
||||
// Only display avatar for incoming message
|
||||
return CGSize(width: 35, height: 35)
|
||||
} else {
|
||||
return CGSize.zero
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue