Hi!
How can i set different avatar size for incoming messages for exp. if this messages from admin of group? I mean bigger avatar size for admin than for other users.
I came from version 0.13.2
There was avatarSize(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> CGSize for avatar size
@Elshad Yeah we changed this in 1.0. Here's how you would do it now:
let adminSize = CGSize(width: 40, height: 40)
if let layout = messagesCollectionView.collectionViewLayout as? MessagesCollectionViewFlowLayout {
layout.setMessageIncomingAvatarSize(adminSize)
}
@SD10 But this code will set same size to all incoming avatars, i want set different sizes for incoming avatars.
How can i replace below code?

Is there easy way to do this like previous version or i must extend MessageSizeCalculator and MessagesCollectionViewFlowLayout?
@Elshad If you want to make this dynamic you probably want to override this function in MessageViewController:
override func collectionView(_ collectionView: UICollectionView,
layout collectionViewLayout: UICollectionViewLayout,
sizeForItemAt indexPath: IndexPath) -> CGSize
This method gives you access to the layout object for each index path
@SD10 I has followed extend class way.

In viewDidLoad add:

Result:

If we will use media and location, then we also must extend and add same override functions to MediaMessageSizeCalculator and LocationMessageSizeCalculator.
At now i think this solution is more clear solution
Yeah @Elshad I can definitely see how this got more difficult with MessageKit 1.0+
Technically, we're able to support that old protocol based API again -- I don't think we'll go that direction though. Maybe we can add more methods to the layout object to make this easier 馃
This issue has been marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
This issue has been auto-closed because there hasn't been any activity for at least 21 days. However, we really appreciate your contribution, so thank you for that! 馃檹 Also, feel free to open a new issue if you still experience this problem 馃憤.
Most helpful comment
Yeah @Elshad I can definitely see how this got more difficult with MessageKit 1.0+
Technically, we're able to support that old
protocolbased API again -- I don't think we'll go that direction though. Maybe we can add more methods to the layout object to make this easier 馃