From ea715ca5603d7453ce3496cc3be93f8ed9447ceb Mon Sep 17 00:00:00 2001 From: Andrew Robinson Date: Thu, 5 Oct 2017 21:13:04 -0500 Subject: [PATCH 1/2] =?UTF-8?q?Fix=20MediaMessageCell=E2=80=99s=20off=20ce?= =?UTF-8?q?nter=20play=20button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the MediaMessageCell’s play button back to where it belongs. Issue: #238 --- Sources/Views/Cells/MediaMessageCell.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Views/Cells/MediaMessageCell.swift b/Sources/Views/Cells/MediaMessageCell.swift index e9bb8921..717b8d70 100644 --- a/Sources/Views/Cells/MediaMessageCell.swift +++ b/Sources/Views/Cells/MediaMessageCell.swift @@ -40,8 +40,8 @@ open class MediaMessageCell: MessageCollectionViewCell { private func setupConstraints() { playButtonView.translatesAutoresizingMaskIntoConstraints = false - let centerX = playButtonView.centerXAnchor.constraint(equalTo: centerXAnchor) - let centerY = playButtonView.centerYAnchor.constraint(equalTo: centerYAnchor) + let centerX = playButtonView.centerXAnchor.constraint(equalTo: messageContainerView.centerXAnchor) + let centerY = playButtonView.centerYAnchor.constraint(equalTo: messageContainerView.centerYAnchor) let width = playButtonView.widthAnchor.constraint(equalToConstant: playButtonView.bounds.width) let height = playButtonView.heightAnchor.constraint(equalToConstant: playButtonView.bounds.height) From 257b4d87bfbb7f659f992b4987318b9ed5195e36 Mon Sep 17 00:00:00 2001 From: Andrew Robinson Date: Thu, 5 Oct 2017 21:34:40 -0500 Subject: [PATCH 2/2] Add PlayButtonView fix to Changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e74ae93d..dabb8be5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,9 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa - `scrollIndicatorInsets` to match the insets of the `MessagesCollectionView`. [#174](https://github.com/MessageKit/MessageKit/pull/174) by [@etoledom](https://github.com/etoledom). +- `MediaMessageCell` had an offset `PlayButtonView` that was being constrained to the cell and not the message container. +[#239](https://github.com/MessageKit/MessageKit/pull/239) by [@SirArkimedes](https://github.com/SirArkimedes). + ### Changed - **Breaking Change** `snapshotOptionsForLocation` method is now part of `LocationMessageDisplayDelegate`.