Ignore gestures in date breaks and unread indicators.

pull/1/head
Matthew Chen 7 years ago committed by Michael Kirk
parent 9049153c6c
commit e271730f33

@ -405,6 +405,10 @@ NS_ASSUME_NONNULL_BEGIN
return; return;
} }
if ([self isGestureInCellHeader:sender]) {
return;
}
if (self.viewItem.interaction.interactionType == OWSInteractionType_OutgoingMessage) { if (self.viewItem.interaction.interactionType == OWSInteractionType_OutgoingMessage) {
TSOutgoingMessage *outgoingMessage = (TSOutgoingMessage *)self.viewItem.interaction; TSOutgoingMessage *outgoingMessage = (TSOutgoingMessage *)self.viewItem.interaction;
if (outgoingMessage.messageState == TSOutgoingMessageStateFailed) { if (outgoingMessage.messageState == TSOutgoingMessageStateFailed) {
@ -427,6 +431,10 @@ NS_ASSUME_NONNULL_BEGIN
return; return;
} }
if ([self isGestureInCellHeader:sender]) {
return;
}
if (self.viewItem.interaction.interactionType == OWSInteractionType_OutgoingMessage) { if (self.viewItem.interaction.interactionType == OWSInteractionType_OutgoingMessage) {
TSOutgoingMessage *outgoingMessage = (TSOutgoingMessage *)self.viewItem.interaction; TSOutgoingMessage *outgoingMessage = (TSOutgoingMessage *)self.viewItem.interaction;
if (outgoingMessage.messageState == TSOutgoingMessageStateFailed) { if (outgoingMessage.messageState == TSOutgoingMessageStateFailed) {
@ -460,9 +468,26 @@ NS_ASSUME_NONNULL_BEGIN
{ {
OWSAssert(self.delegate); OWSAssert(self.delegate);
if ([self isGestureInCellHeader:panRecognizer]) {
return;
}
[self.delegate didPanWithGestureRecognizer:panRecognizer viewItem:self.viewItem]; [self.delegate didPanWithGestureRecognizer:panRecognizer viewItem:self.viewItem];
} }
- (BOOL)isGestureInCellHeader:(UIGestureRecognizer *)sender
{
OWSAssert(self.viewItem);
if (!self.viewItem.hasCellHeader) {
return NO;
}
CGPoint location = [sender locationInView:self];
CGPoint headerBottom = [self convertPoint:CGPointMake(0, self.headerView.height) fromView:self.headerView];
return location.y <= headerBottom.y;
}
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -556,6 +556,10 @@ typedef void (^SystemMessageActionBlock)(void);
{ {
OWSAssert(self.delegate); OWSAssert(self.delegate);
if ([self isGestureInCellHeader:longPress]) {
return;
}
TSInteraction *interaction = self.viewItem.interaction; TSInteraction *interaction = self.viewItem.interaction;
OWSAssert(interaction); OWSAssert(interaction);
@ -564,6 +568,19 @@ typedef void (^SystemMessageActionBlock)(void);
} }
} }
- (BOOL)isGestureInCellHeader:(UIGestureRecognizer *)sender
{
OWSAssert(self.viewItem);
if (!self.viewItem.hasCellHeader) {
return NO;
}
CGPoint location = [sender locationInView:self];
CGPoint headerBottom = [self convertPoint:CGPointMake(0, self.headerView.height) fromView:self.headerView];
return location.y <= headerBottom.y;
}
- (void)buttonWasPressed:(id)sender - (void)buttonWasPressed:(id)sender
{ {
if (!self.action.block) { if (!self.action.block) {

Loading…
Cancel
Save