diff --git a/Signal/src/view controllers/InboxTableViewCell.h b/Signal/src/view controllers/InboxTableViewCell.h index f07711e60..fdde4f51e 100644 --- a/Signal/src/view controllers/InboxTableViewCell.h +++ b/Signal/src/view controllers/InboxTableViewCell.h @@ -19,7 +19,6 @@ typedef enum : NSUInteger { @class InboxTableViewCell; @protocol TableViewCellDelegate -- (void)tableViewCellTappedDelete:(InboxTableViewCell *)cell; - (void)tableViewCellTappedArchive:(InboxTableViewCell *)cell; @end diff --git a/Signal/src/view controllers/InboxTableViewCell.m b/Signal/src/view controllers/InboxTableViewCell.m index 4da15848b..2c449246d 100644 --- a/Signal/src/view controllers/InboxTableViewCell.m +++ b/Signal/src/view controllers/InboxTableViewCell.m @@ -15,7 +15,7 @@ #define DELETE_IMAGE_VIEW_WIDTH 19.0f #define TIME_LABEL_SIZE 11 #define DATE_LABEL_SIZE 13 - +#define SWIPE_ARCHIVE_OFFSET -50 @implementation InboxTableViewCell @@ -195,39 +195,17 @@ _archiveImageView.bounds.size.height); } - - if (scrollView.contentOffset.x > CGRectGetWidth(_archiveView.frame)*2) { - _deleteImageView.image = [_deleteImageView.image jsq_imageMaskedWithColor:[UIColor ows_redColor]]; - _deleteImageView.bounds = CGRectMake(_deleteImageView.bounds.origin.x, - _deleteImageView.bounds.origin.y, - DELETE_IMAGE_VIEW_WIDTH, - _deleteImageView.bounds.size.height); - } else { - - _deleteImageView.image = [_deleteImageView.image jsq_imageMaskedWithColor:[UIColor ows_darkGrayColor]]; - double ratio = _scrollView.contentOffset.x / (CGRectGetWidth(_deleteView.frame)*2); - double newWidth = DELETE_IMAGE_VIEW_WIDTH/2.0f + (DELETE_IMAGE_VIEW_WIDTH * ratio)/2.0f; - - _deleteImageView.bounds = CGRectMake(_deleteImageView.bounds.origin.x, - _deleteImageView.bounds.origin.y, - (CGFloat)newWidth, - _deleteImageView.bounds.size.height); - } } - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset { - if (_scrollView.contentOffset.x < 0) { + if (_scrollView.contentOffset.x < SWIPE_ARCHIVE_OFFSET) { + // archive the thread [_delegate tableViewCellTappedArchive:self]; } else { - *targetContentOffset = CGPointMake(CGRectGetWidth(_archiveView.frame), 0); - } - - if (scrollView.contentOffset.x > CGRectGetWidth(_archiveView.frame)/4) { - [_delegate tableViewCellTappedDelete:self]; - } else { + // don't do anything *targetContentOffset = CGPointMake(CGRectGetWidth(_archiveView.frame), 0); } } diff --git a/Signal/src/view controllers/UITests/SignalsViewController.m b/Signal/src/view controllers/UITests/SignalsViewController.m index c25e71c57..b303da8b1 100644 --- a/Signal/src/view controllers/UITests/SignalsViewController.m +++ b/Signal/src/view controllers/UITests/SignalsViewController.m @@ -104,7 +104,7 @@ static NSString* const kShowSignupFlowSegue = @"showSignupFlow"; } -#pragma mark - Table view data source +#pragma mark - Table View Data Source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return (NSInteger)[self.threadMappings numberOfSections]; @@ -168,8 +168,8 @@ static NSString* const kShowSignupFlowSegue = @"showSignupFlow"; #pragma mark - HomeFeedTableViewCellDelegate -- (void)tableViewCellTappedDelete:(InboxTableViewCell*)cell { - NSIndexPath *indexPath = [self.tableView indexPathForCell:cell]; +- (void)tableViewCellTappedDelete:(NSIndexPath*)indexPath { + //NSIndexPath *indexPath = [self.tableView indexPathForCell:cell]; TSThread *thread = [self threadForIndexPath:indexPath]; if([thread isKindOfClass:[TSGroupThread class]]) { DDLogDebug(@"leaving the group");