From 97bf8e988d9156b91b7d74656d16711e41936e01 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Wed, 28 Feb 2018 15:11:24 +0100 Subject: [PATCH] fix ipad's ui --- Classes/ChatConversationView.h | 1 + Classes/ChatsListTableView.m | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Classes/ChatConversationView.h b/Classes/ChatConversationView.h index fcf5d15a7..8889246d8 100644 --- a/Classes/ChatConversationView.h +++ b/Classes/ChatConversationView.h @@ -60,6 +60,7 @@ @property (weak, nonatomic) IBOutlet UIIconButton *infoButton; @property (weak, nonatomic) IBOutlet UILabel *particpantsLabel; +- (void)configureForRoom:(BOOL)editing; - (IBAction)onBackClick:(id)event; - (IBAction)onEditClick:(id)event; - (IBAction)onMessageChange:(id)sender; diff --git a/Classes/ChatsListTableView.m b/Classes/ChatsListTableView.m index 25fddf6d5..5588dbbab 100644 --- a/Classes/ChatsListTableView.m +++ b/Classes/ChatsListTableView.m @@ -157,17 +157,19 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [super tableView:tableView didSelectRowAtIndexPath:indexPath]; - if (![self isEditing]) { - LinphoneChatRoom *chatRoom = (LinphoneChatRoom *)bctbx_list_nth_data(_data, (int)[indexPath row]); - ChatConversationView *view = VIEW(ChatConversationView); - view.chatRoom = chatRoom; - // on iPad, force unread bubble to disappear by reloading the cell - if (IPAD) { - UIChatCell *cell = (UIChatCell *)[tableView cellForRowAtIndexPath:indexPath]; - [cell updateUnreadBadge]; - } - [PhoneMainView.instance changeCurrentView:view.compositeViewDescription]; + if ([self isEditing]) + return; + + LinphoneChatRoom *chatRoom = (LinphoneChatRoom *)bctbx_list_nth_data(_data, (int)[indexPath row]); + ChatConversationView *view = VIEW(ChatConversationView); + view.chatRoom = chatRoom; + // on iPad, force unread bubble to disappear by reloading the cell + if (IPAD) { + UIChatCell *cell = (UIChatCell *)[tableView cellForRowAtIndexPath:indexPath]; + [cell updateUnreadBadge]; + [view configureForRoom:false]; } + [PhoneMainView.instance changeCurrentView:view.compositeViewDescription]; } void deletion_chat_room_state_changed(LinphoneChatRoom *cr, LinphoneChatRoomState newState) {