From dfc9dfed50bcc9de19793f0ae6417fdc9e0e8438 Mon Sep 17 00:00:00 2001 From: David Idmansour Date: Mon, 2 Jul 2018 10:43:32 +0200 Subject: [PATCH] cleaned code --- richNotifications/NotificationTableViewCell.m | 6 +++--- richNotifications/NotificationViewController.m | 18 +++--------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/richNotifications/NotificationTableViewCell.m b/richNotifications/NotificationTableViewCell.m index b1b2160e3..26fe0f188 100644 --- a/richNotifications/NotificationTableViewCell.m +++ b/richNotifications/NotificationTableViewCell.m @@ -26,13 +26,13 @@ - (void)layoutSubviews { [super layoutSubviews]; CGRect bubbleFrame = self.contentView.frame; - int origin_x; + int originX; bubbleFrame.size = CGSizeMake(_width, _height); - origin_x = (_isOutgoing ? self.frame.size.width - bubbleFrame.size.width - 5 : 5); + originX = (_isOutgoing ? self.frame.size.width - bubbleFrame.size.width - 5 : 5); - bubbleFrame.origin.x = origin_x; + bubbleFrame.origin.x = originX; self.contentView.frame = bubbleFrame; _msgText.textContainerInset = UIEdgeInsetsZero; diff --git a/richNotifications/NotificationViewController.m b/richNotifications/NotificationViewController.m index 0fb12407e..69aa955a8 100644 --- a/richNotifications/NotificationViewController.m +++ b/richNotifications/NotificationViewController.m @@ -47,12 +47,6 @@ // self.tableView.bounds = frame; // self.preferredContentSize = CGSizeMake(self.preferredContentSize.width, height); // } - NSLog(@"Content length : %f", self.tableView.contentSize.height); - NSLog(@"Number of rows : %d", (unsigned int)[self tableView:self.tableView numberOfRowsInSection:0]); - NSLog(@"View bounds length : %f", self.tableView.bounds.size.height); - NSLog(@"View frame length : %f", self.tableView.frame.size.height); - NSLog(@"View bounds y : %f", self.tableView.bounds.origin.y); - NSLog(@"View frame y : %f", self.tableView.frame.origin.y); } #pragma mark - UITableViewDataSource Functions @@ -71,11 +65,8 @@ NSString *msgText = ((NSString *)[msgs[indexPath.row] objectForKey:@"msg"]); NSString *imdm = ((NSString *)[msgs[indexPath.row] objectForKey:@"state"]); NSData *imageData = [msgs[indexPath.row] objectForKey:@"fromImageData"]; - printf("%s : %s : %s\n", isOutgoing ? "sortant" : "entrant", - display.UTF8String, - 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; @@ -87,6 +78,7 @@ cell.nameDate.textColor = [UIColor colorWithPatternImage:cell.background.image]; cell.msgText.textColor = [UIColor darkGrayColor]; cell.imdm.hidden = cell.imdmImage.hidden = !isOutgoing; + if ([imdm isEqualToString:@"LinphoneChatMessageStateDelivered"] || [imdm isEqualToString:@"LinphoneChatMessageStateDeliveredToUser"]) { cell.imdm.text = NSLocalizedString(@"Delivered", nil); cell.imdm.textColor = [UIColor grayColor]; @@ -101,11 +93,7 @@ cell.imdmImage.image = [UIImage imageNamed:@"chat_error.png"]; } else cell.imdm.hidden = YES; - printf("Taille label : %f\n", cell.nameDate.font.pointSize); - printf("Taille field : %f\n", cell.msgText.font.pointSize); - printf("%d\n", (unsigned int)indexPath.row); - printf("X : %f\n", cell.frame.origin.x); - printf("Y : %f\n", cell.frame.origin.y); + return cell; }