mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-28 00:29:21 +00:00
chat: fix badge count on iPad
This commit is contained in:
parent
e06564105f
commit
d7a80a37e2
4 changed files with 11 additions and 3 deletions
|
|
@ -152,6 +152,11 @@ static void chatTable_free_chatrooms(void *data) {
|
|||
LinphoneChatRoom *chatRoom = (LinphoneChatRoom *)ms_list_nth_data(data, (int)[indexPath row]);
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
[view setChatRoom:chatRoom];
|
||||
// on iPad, force unread bubble to disappear by reloading the cell
|
||||
if (IPAD) {
|
||||
UIChatCell *cell = [tableView cellForRowAtIndexPath:indexPath];
|
||||
[cell updateUnreadBadge];
|
||||
}
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
</label>
|
||||
<view hidden="YES" autoresizesSubviews="NO" userInteractionEnabled="NO" tag="7" contentMode="scaleToFill" id="7DE-KJ-9Q3" userLabel="unreadCountView" customClass="UIBouncingView">
|
||||
<rect key="frame" x="350" y="7" width="21" height="22"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" tag="8" contentMode="scaleAspectFit" image="history_chat_indicator.png" id="NXj-A8-YLh" userLabel="unreadCountImage">
|
||||
<rect key="frame" x="0.0" y="0.0" width="21" height="21"/>
|
||||
|
|
|
|||
|
|
@ -39,6 +39,6 @@
|
|||
- (id)initWithIdentifier:(NSString*)identifier;
|
||||
|
||||
- (IBAction)onDeleteClick:(id)event;
|
||||
|
||||
- (void)updateUnreadBadge;
|
||||
- (void)setChatRoom:(LinphoneChatRoom *)achat;
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -93,6 +93,10 @@
|
|||
_chatLatestTimeLabel.text = NSLocalizedString(@"Now", nil);
|
||||
}
|
||||
|
||||
[self updateUnreadBadge];
|
||||
}
|
||||
|
||||
- (void)updateUnreadBadge {
|
||||
int count = linphone_chat_room_get_unread_messages_count(chatRoom);
|
||||
_unreadCountLabel.text = [NSString stringWithFormat:@"%i", count];
|
||||
if (count > 0) {
|
||||
|
|
@ -100,7 +104,6 @@
|
|||
} else {
|
||||
[_unreadCountView stopAnimating:YES];
|
||||
}
|
||||
|
||||
UIFont *addressFont = (count <= 0) ? [UIFont systemFontOfSize:25] : [UIFont boldSystemFontOfSize:25];
|
||||
_addressLabel.font = addressFont;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue