From 236a8ee52f40a22da12f013e4c5b85dc8ce8411a Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Fri, 18 Nov 2022 15:44:01 +0100 Subject: [PATCH] Fix recording list. Change of cell background color --- Classes/LinphoneUI/UICheckBoxTableView.m | 2 +- Classes/LinphoneUI/UIRecordingCell.h | 2 -- Classes/LinphoneUI/UIRecordingCell.m | 13 ++++++++----- Classes/RecordingsListTableView.m | 2 -- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Classes/LinphoneUI/UICheckBoxTableView.m b/Classes/LinphoneUI/UICheckBoxTableView.m index ab884b224..a01ed8746 100644 --- a/Classes/LinphoneUI/UICheckBoxTableView.m +++ b/Classes/LinphoneUI/UICheckBoxTableView.m @@ -91,8 +91,8 @@ #pragma mark - - (void)accessoryForCell:(UITableViewCell *)cell atPath:(NSIndexPath *)indexPath { - cell.selectionStyle = UITableViewCellSelectionStyleGray; if ([self isEditing]) { + cell.selectionStyle = UITableViewCellSelectionStyleGray; UIButton *checkBoxButton = [UIButton buttonWithType:UIButtonTypeCustom]; UIImage *image = nil; if ([_selectedItems containsObject:indexPath]) { diff --git a/Classes/LinphoneUI/UIRecordingCell.h b/Classes/LinphoneUI/UIRecordingCell.h index d8aef17aa..37a9bd458 100644 --- a/Classes/LinphoneUI/UIRecordingCell.h +++ b/Classes/LinphoneUI/UIRecordingCell.h @@ -25,8 +25,6 @@ @property (weak, nonatomic) IBOutlet UILabel *nameLabel; @property (strong, nonatomic) IBOutlet UIToolbar *toolbar; @property (weak, nonatomic) IBOutlet UIBarButtonItem *shareButton; - - @property(nonatomic, assign) __block NSString *recording; - (id)initWithIdentifier:(NSString*)identifier; diff --git a/Classes/LinphoneUI/UIRecordingCell.m b/Classes/LinphoneUI/UIRecordingCell.m index 1866749e0..d0492af7e 100644 --- a/Classes/LinphoneUI/UIRecordingCell.m +++ b/Classes/LinphoneUI/UIRecordingCell.m @@ -90,7 +90,8 @@ static UILinphoneAudioPlayer *player; } - (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated { - self.selectionStyle = UITableViewCellSelectionStyleNone; + if (!VIEW(RecordingsListView).tableController.isEditing) + self.selectionStyle = UITableViewCellSelectionStyleNone; } - (void)updateFrame { @@ -105,10 +106,11 @@ static UILinphoneAudioPlayer *player; -(void)setSelected:(BOOL)selected animated:(BOOL)animated{ [super setSelected:selected animated:animated]; - _toolbar.hidden = !selected; - if (!selected) { - return; - } + + if (!selected || (selected && VIEW(RecordingsListView).tableController.isEditing)) { + _toolbar.hidden = true; + return; + } if (player && [player isCreated]) { [player close]; } @@ -122,6 +124,7 @@ static UILinphoneAudioPlayer *player; player.view.frame = _playerView.frame; player.view.bounds = _playerView.bounds; [player open]; + _toolbar.hidden = false; } - (void)onShareButtonPressed { diff --git a/Classes/RecordingsListTableView.m b/Classes/RecordingsListTableView.m index 2bb4e3273..2260c261d 100644 --- a/Classes/RecordingsListTableView.m +++ b/Classes/RecordingsListTableView.m @@ -147,8 +147,6 @@ NSString *recordingPath = subAr[indexPath.row]; [cell setRecording:recordingPath]; [super accessoryForCell:cell atPath:indexPath]; - //accessoryForCell set it to gray but we don't want it - cell.selectionStyle = UITableViewCellSelectionStyleNone; [cell updateFrame]; cell.contentView.userInteractionEnabled = false; return cell;