From 9d2226c7db233ed81fc90ee6bd97545f439b9a7c Mon Sep 17 00:00:00 2001 From: David Idmansour Date: Wed, 27 Jun 2018 11:48:21 +0200 Subject: [PATCH] ui cell color --- Classes/LinphoneManager.m | 5 +-- linphone.xcodeproj/project.pbxproj | 4 +++ .../Base.lproj/MainInterface.storyboard | 34 +++++++++++++++---- richNotifications/NotificationTableViewCell.h | 2 ++ richNotifications/NotificationTableViewCell.m | 1 + .../NotificationViewController.m | 1 + 6 files changed, 38 insertions(+), 9 deletions(-) diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index f91a3ebf1..51be144cf 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1252,8 +1252,9 @@ static void linphone_iphone_popup_password_request(LinphoneCore *lc, LinphoneAut [msgData setObject:[NSNumber numberWithBool:isFileTransfer] forKey:@"isFileTransfer"]; [msgData setObject:fromImageData forKey:@"fromImageData"]; if (isFileTransfer) { - // TODO - [msgData setObject:[UIChatBubbleTextCell TextMessageForChat:msg] forKey:@"msg"]; + LinphoneContent *file = linphone_chat_message_get_file_transfer_information(msg); + const char *filename = linphone_content_get_name(file); + [msgData setObject:[NSString stringWithUTF8String:filename] forKey:@"msg"]; } else { [msgData setObject:[UIChatBubbleTextCell TextMessageForChat:msg] forKey:@"msg"]; } diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index ced062366..93deb1815 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -71,6 +71,8 @@ 5E31290C20D7A37E00CF3AAE /* latestChatroomsWidget.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 5E31290020D7A37E00CF3AAE /* latestChatroomsWidget.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 5E31291320D7AAA100CF3AAE /* avatar.png in Resources */ = {isa = PBXBuildFile; fileRef = 633FEBE61D3CD5570014B822 /* avatar.png */; }; 5E31291A20D7AAAD00CF3AAE /* chat_group_avatar.png in Resources */ = {isa = PBXBuildFile; fileRef = 8C2A81941F87B8000012A66B /* chat_group_avatar.png */; }; + 5E3391EC20E387E000F66299 /* color_A.png in Resources */ = {isa = PBXBuildFile; fileRef = 633FEC701D3CD5570014B822 /* color_A.png */; }; + 5E3391F320E387E700F66299 /* color_D.png in Resources */ = {isa = PBXBuildFile; fileRef = 633FEC721D3CD5570014B822 /* color_D.png */; }; 5E58962420DCE5700030868C /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C73477B1D9BA3A00022EE8C /* UserNotifications.framework */; }; 5E58962620DCE5700030868C /* UserNotificationsUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E58962520DCE5700030868C /* UserNotificationsUI.framework */; }; 5E58962A20DCE5700030868C /* NotificationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E58962920DCE5700030868C /* NotificationViewController.m */; }; @@ -4209,7 +4211,9 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 5E3391F320E387E700F66299 /* color_D.png in Resources */, 5E58962D20DCE5700030868C /* MainInterface.storyboard in Resources */, + 5E3391EC20E387E000F66299 /* color_A.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/richNotifications/Base.lproj/MainInterface.storyboard b/richNotifications/Base.lproj/MainInterface.storyboard index e06903ce7..75085b067 100644 --- a/richNotifications/Base.lproj/MainInterface.storyboard +++ b/richNotifications/Base.lproj/MainInterface.storyboard @@ -18,15 +18,15 @@ - - + + - + - + - - + + + + + + + + + + @@ -97,4 +114,7 @@ + + + diff --git a/richNotifications/NotificationTableViewCell.h b/richNotifications/NotificationTableViewCell.h index 3a6767f92..063836e34 100644 --- a/richNotifications/NotificationTableViewCell.h +++ b/richNotifications/NotificationTableViewCell.h @@ -12,5 +12,7 @@ @property (weak, nonatomic) IBOutlet UILabel *nameDate; @property (weak, nonatomic) IBOutlet UITextView *msgText; @property (weak, nonatomic) IBOutlet UILabel *imdm; +@property (weak, nonatomic) IBOutlet UIImageView *background; +@property (weak, nonatomic) IBOutlet UIImageView *bottomBarColor; @end diff --git a/richNotifications/NotificationTableViewCell.m b/richNotifications/NotificationTableViewCell.m index fb1853143..36e80404f 100644 --- a/richNotifications/NotificationTableViewCell.m +++ b/richNotifications/NotificationTableViewCell.m @@ -14,6 +14,7 @@ // Initialization code _contactImage.layer.cornerRadius = _contactImage.frame.size.height / 2; _contactImage.clipsToBounds = YES; + [self.contentView sendSubviewToBack:_background]; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { diff --git a/richNotifications/NotificationViewController.m b/richNotifications/NotificationViewController.m index 29cd6b8b7..49d4a333b 100644 --- a/richNotifications/NotificationViewController.m +++ b/richNotifications/NotificationViewController.m @@ -61,6 +61,7 @@ msgText.UTF8String); printf("Taille de l'image de profil : %d\n", (unsigned int)imageData.length); NotificationTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"notificationCell" forIndexPath:indexPath]; + cell.background.image = cell.bottomBarColor.image = [UIImage imageNamed:isOutgoing ? @"color_A" : @"color_D.png"]; cell.contactImage.image = [UIImage imageWithData:imageData]; cell.nameDate.text = display; cell.msgText.text = msgText;