2017-07-19 15:47:59 +03:00
|
|
|
//
|
2017-09-28 17:35:00 +03:00
|
|
|
// RoomTableViewCell.m
|
2017-07-19 15:47:59 +03:00
|
|
|
// VideoCalls
|
|
|
|
//
|
|
|
|
// Created by Ivan Sein on 19.07.17.
|
|
|
|
// Copyright © 2017 struktur AG. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2017-09-28 17:35:00 +03:00
|
|
|
#import "RoomTableViewCell.h"
|
2018-04-13 18:04:14 +03:00
|
|
|
#import "UIImageView+AFNetworking.h"
|
2017-07-19 15:47:59 +03:00
|
|
|
|
2018-08-03 17:01:01 +03:00
|
|
|
#define kTitleOriginY 14
|
|
|
|
#define kTitleOnlyOriginY 25
|
|
|
|
|
2017-09-28 17:35:00 +03:00
|
|
|
NSString *const kRoomCellIdentifier = @"RoomCellIdentifier";
|
2017-07-19 15:47:59 +03:00
|
|
|
|
2017-09-28 17:35:00 +03:00
|
|
|
@implementation RoomTableViewCell
|
2017-07-19 15:47:59 +03:00
|
|
|
|
|
|
|
- (void)awakeFromNib {
|
|
|
|
[super awakeFromNib];
|
2017-12-13 19:28:18 +03:00
|
|
|
|
|
|
|
self.roomImage.layer.cornerRadius = 24.0;
|
|
|
|
self.roomImage.layer.masksToBounds = YES;
|
2018-08-08 16:22:26 +03:00
|
|
|
self.favoriteImage.contentMode = UIViewContentModeCenter;
|
2017-07-19 15:47:59 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
|
|
|
[super setSelected:selected animated:animated];
|
|
|
|
|
|
|
|
// Configure the view for the selected state
|
|
|
|
}
|
|
|
|
|
2017-12-13 19:28:18 +03:00
|
|
|
- (void)prepareForReuse
|
|
|
|
{
|
|
|
|
[super prepareForReuse];
|
|
|
|
|
2018-04-13 18:04:14 +03:00
|
|
|
// Fix problem of rendering downloaded image in a reused cell
|
|
|
|
[self.roomImage cancelImageDownloadTask];
|
|
|
|
|
2018-02-09 18:47:09 +03:00
|
|
|
self.roomImage.image = nil;
|
2018-08-08 16:22:26 +03:00
|
|
|
self.favoriteImage.image = nil;
|
2018-08-03 17:01:01 +03:00
|
|
|
self.labelSubTitle.text = @"";
|
2018-08-02 19:28:59 +03:00
|
|
|
self.dateLabel.text = @"";
|
2018-05-18 15:41:25 +03:00
|
|
|
|
|
|
|
for (UIView *subview in [self.unreadMessagesView subviews]) {
|
|
|
|
[subview removeFromSuperview];
|
|
|
|
}
|
2017-12-13 19:28:18 +03:00
|
|
|
}
|
|
|
|
|
2018-08-03 17:01:01 +03:00
|
|
|
- (void)setTitleOnly:(BOOL)titleOnly
|
|
|
|
{
|
|
|
|
_titleOnly = titleOnly;
|
|
|
|
|
|
|
|
CGRect frame = self.labelTitle.frame;
|
|
|
|
frame.origin.y = _titleOnly ? kTitleOnlyOriginY : kTitleOriginY;
|
|
|
|
self.labelTitle.frame = frame;
|
|
|
|
}
|
|
|
|
|
2017-07-19 15:47:59 +03:00
|
|
|
@end
|