Skip to content

Commit

Permalink
#1851 (mark as read button at bottom of story list)
Browse files Browse the repository at this point in the history
- If not marking read on scroll, a button now appears at the end of the feed detail to mark all stories as read.
  • Loading branch information
Dejal committed Apr 30, 2024
1 parent 72923de commit 0ceb249
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions clients/ios/Classes/FeedDetailObjCViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1637,6 +1637,35 @@ - (UITableViewCell *)makeLoadingCell {
toItem:fleuron
attribute:NSLayoutAttributeBottom
multiplier:1.0 constant:height/2]];
} else if (!self.isMarkReadOnScroll) {
UIButton *markReadButton = [UIButton buttonWithType:UIButtonTypeCustom];

markReadButton.titleLabel.font = [UIFont systemFontOfSize:14];
[markReadButton setTitle:@" Mark All Stories as Read " forState:UIControlStateNormal];

[markReadButton addTarget:self action:@selector(doMarkAllRead:) forControlEvents:UIControlEventTouchUpInside];

markReadButton.tintColor = UIColor.whiteColor;
markReadButton.backgroundColor = UIColorFromFixedRGB(0x939EAF);
markReadButton.layer.cornerRadius = 10;

[markReadButton sizeToFit];

markReadButton.translatesAutoresizingMaskIntoConstraints = NO;

[cell.contentView addSubview:markReadButton];
[cell.contentView addConstraint:[NSLayoutConstraint constraintWithItem:markReadButton
attribute:NSLayoutAttributeCenterX
relatedBy:NSLayoutRelationEqual
toItem:cell.contentView
attribute:NSLayoutAttributeCenterX
multiplier:1.0 constant:0]];
[cell.contentView addConstraint:[NSLayoutConstraint constraintWithItem:markReadButton
attribute:NSLayoutAttributeTop
relatedBy:NSLayoutRelationEqual
toItem:fleuron
attribute:NSLayoutAttributeBottom
multiplier:1.0 constant:height/2]];
}

return cell;
Expand Down

0 comments on commit 0ceb249

Please sign in to comment.