Fix incoming friend request interaction

This commit is contained in:
Niels Andriesse 2019-05-13 16:40:22 +10:00
parent dca6aed6ee
commit 635dcef2b2
2 changed files with 7 additions and 3 deletions

View file

@ -36,10 +36,10 @@
mainStackView.addArrangedSubview(buttonStackView)
let buttonFont = UIFont.ows_dynamicTypeBodyClamped.ows_mediumWeight()
let buttonHeight = buttonFont.pointSize * 48 / 17
let acceptButton = OWSFlatButton.button(title: NSLocalizedString("Accept", comment: ""), font: buttonFont, titleColor: .ows_materialBlue, backgroundColor: .clear, target: self, selector: #selector(accept))
let acceptButton = OWSFlatButton.button(title: NSLocalizedString("Accept", comment: ""), font: buttonFont, titleColor: .ows_materialBlue, backgroundColor: .white, target: self, selector: #selector(accept))
acceptButton.autoSetDimension(.height, toSize: buttonHeight)
buttonStackView.addArrangedSubview(acceptButton)
let declineButton = OWSFlatButton.button(title: NSLocalizedString("Decline", comment: ""), font: buttonFont, titleColor: .ows_destructiveRed, backgroundColor: .clear, target: self, selector: #selector(decline))
let declineButton = OWSFlatButton.button(title: NSLocalizedString("Decline", comment: ""), font: buttonFont, titleColor: .ows_destructiveRed, backgroundColor: .white, target: self, selector: #selector(decline))
declineButton.autoSetDimension(.height, toSize: buttonHeight)
buttonStackView.addArrangedSubview(declineButton)
addSubview(mainStackView)

View file

@ -371,7 +371,7 @@ NS_ASSUME_NONNULL_BEGIN
}
if (self.isIncomingFriendRequest) {
cellSize.height += 118; // TODO: Measure dynamically
cellSize.height += 98; // TODO: Measure dynamically
}
cellSize = CGSizeCeil(cellSize);
@ -452,6 +452,10 @@ NS_ASSUME_NONNULL_BEGIN
{
OWSAssertDebug(self.delegate);
if (self.isIncomingFriendRequest) {
return;
}
if (sender.state != UIGestureRecognizerStateBegan) {
return;
}