From f9a64f6e4837e17381f8f74318b33f10945cb9cf Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Mon, 30 Sep 2013 16:52:20 +0200 Subject: [PATCH] Fix iOS7 cell transparency problems --- Classes/LinphoneUI/UICallCell.h | 3 +- Classes/LinphoneUI/UIChatCell.h | 4 +- Classes/LinphoneUI/UIChatRoomCell.h | 3 +- Classes/LinphoneUI/UIContactCell.h | 3 +- Classes/LinphoneUI/UIEditableTableViewCell.h | 3 +- Classes/LinphoneUI/UIHistoryCell.h | 3 +- Classes/LinphoneUI/UITransparentTVCell.h | 24 ++++++++++++ Classes/LinphoneUI/UITransparentTVCell.m | 39 ++++++++++++++++++++ linphone.xcodeproj/project.pbxproj | 8 ++++ 9 files changed, 84 insertions(+), 6 deletions(-) create mode 100644 Classes/LinphoneUI/UITransparentTVCell.h create mode 100644 Classes/LinphoneUI/UITransparentTVCell.m diff --git a/Classes/LinphoneUI/UICallCell.h b/Classes/LinphoneUI/UICallCell.h index 8621ba4bc..b23867634 100644 --- a/Classes/LinphoneUI/UICallCell.h +++ b/Classes/LinphoneUI/UICallCell.h @@ -21,6 +21,7 @@ #include "linphonecore.h" #include "UIPauseButton.h" +#import "UITransparentTVCell.h" typedef enum _UICallCellOtherView { UICallCellOtherView_Avatar = 0, @@ -43,7 +44,7 @@ typedef enum _UICallCellOtherView { @end -@interface UICallCell : UITableViewCell { +@interface UICallCell : UITransparentTVCell { } @property (nonatomic, retain) UICallCellData *data; diff --git a/Classes/LinphoneUI/UIChatCell.h b/Classes/LinphoneUI/UIChatCell.h index 1cc731e93..49d370c5b 100644 --- a/Classes/LinphoneUI/UIChatCell.h +++ b/Classes/LinphoneUI/UIChatCell.h @@ -19,9 +19,11 @@ #import +#import "UITransparentTVCell.h" #import "ChatModel.h" -@interface UIChatCell : UITableViewCell { + +@interface UIChatCell : UITransparentTVCell { } @property (nonatomic, retain) ChatModel *chat; diff --git a/Classes/LinphoneUI/UIChatRoomCell.h b/Classes/LinphoneUI/UIChatRoomCell.h index 37b4a51e4..e043cc3d7 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.h +++ b/Classes/LinphoneUI/UIChatRoomCell.h @@ -22,9 +22,10 @@ #import "ChatModel.h" #import "ChatRoomTableViewController.h" #import "UILoadingImageView.h" +#import "UITransparentTVCell.h" -@interface UIChatRoomCell : UITableViewCell { +@interface UIChatRoomCell : UITransparentTVCell { } @property (nonatomic, retain) ChatModel *chat; diff --git a/Classes/LinphoneUI/UIContactCell.h b/Classes/LinphoneUI/UIContactCell.h index c94782949..a5ecc54d7 100644 --- a/Classes/LinphoneUI/UIContactCell.h +++ b/Classes/LinphoneUI/UIContactCell.h @@ -19,8 +19,9 @@ #import #import +#import "UITransparentTVCell.h" -@interface UIContactCell : UITableViewCell { +@interface UIContactCell : UITransparentTVCell { } @property (nonatomic, retain) IBOutlet UILabel* firstNameLabel; diff --git a/Classes/LinphoneUI/UIEditableTableViewCell.h b/Classes/LinphoneUI/UIEditableTableViewCell.h index d4ac998c5..5434eeb1e 100644 --- a/Classes/LinphoneUI/UIEditableTableViewCell.h +++ b/Classes/LinphoneUI/UIEditableTableViewCell.h @@ -18,8 +18,9 @@ */ #import +#import "UITransparentTVCell.h" -@interface UIEditableTableViewCell : UITableViewCell { +@interface UIEditableTableViewCell : UITransparentTVCell { } @property (nonatomic, retain) IBOutlet UITextField *detailTextField; diff --git a/Classes/LinphoneUI/UIHistoryCell.h b/Classes/LinphoneUI/UIHistoryCell.h index 574f84484..cc1891831 100644 --- a/Classes/LinphoneUI/UIHistoryCell.h +++ b/Classes/LinphoneUI/UIHistoryCell.h @@ -19,9 +19,10 @@ #import +#import "UITransparentTVCell.h" #include "linphonecore.h" -@interface UIHistoryCell : UITableViewCell { +@interface UIHistoryCell : UITransparentTVCell { } @property (nonatomic, assign) LinphoneCallLog *callLog; diff --git a/Classes/LinphoneUI/UITransparentTVCell.h b/Classes/LinphoneUI/UITransparentTVCell.h new file mode 100644 index 000000000..a0318cbd4 --- /dev/null +++ b/Classes/LinphoneUI/UITransparentTVCell.h @@ -0,0 +1,24 @@ +/* UITransparentTVCell.h + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import + +@interface UITransparentTVCell : UITableViewCell + +@end diff --git a/Classes/LinphoneUI/UITransparentTVCell.m b/Classes/LinphoneUI/UITransparentTVCell.m new file mode 100644 index 000000000..b027a3a07 --- /dev/null +++ b/Classes/LinphoneUI/UITransparentTVCell.m @@ -0,0 +1,39 @@ +/* UITransparentTVCell.m + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import "UITransparentTVCell.h" + +@implementation UITransparentTVCell + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) { + // Set transparent background + [self setBackgroundColor:[UIColor clearColor]]; + } + return self; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + [super setSelected:selected animated:animated]; +} + +@end diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 1d2e15f42..892caba82 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -1340,6 +1340,8 @@ D3F9A9DB15AEEB940045320F /* history_notification.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F9A9DA15AEEB940045320F /* history_notification.png */; }; D3F9A9EE15AF277E0045320F /* UACellBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F9A9ED15AF277D0045320F /* UACellBackgroundView.m */; }; D3F9A9EF15AF277E0045320F /* UACellBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F9A9ED15AF277D0045320F /* UACellBackgroundView.m */; }; + F066515517F9A02E0064280C /* UITransparentTVCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F066515417F9A02E0064280C /* UITransparentTVCell.m */; }; + F066515617F9A02E0064280C /* UITransparentTVCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F066515417F9A02E0064280C /* UITransparentTVCell.m */; }; F476004B147AAF2800FFF19B /* liblinphone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2211DB911475562600DEE054 /* liblinphone.a */; }; /* End PBXBuildFile section */ @@ -2485,6 +2487,8 @@ D3F9A9DA15AEEB940045320F /* history_notification.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = history_notification.png; path = Resources/history_notification.png; sourceTree = ""; }; D3F9A9EC15AF277D0045320F /* UACellBackgroundView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UACellBackgroundView.h; path = Utils/UACellBackgroundView/UACellBackgroundView.h; sourceTree = ""; }; D3F9A9ED15AF277D0045320F /* UACellBackgroundView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UACellBackgroundView.m; path = Utils/UACellBackgroundView/UACellBackgroundView.m; sourceTree = ""; }; + F066515317F9A02E0064280C /* UITransparentTVCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITransparentTVCell.h; sourceTree = ""; }; + F066515417F9A02E0064280C /* UITransparentTVCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UITransparentTVCell.m; sourceTree = ""; }; FD61C851169EAC63001AA2D6 /* ru */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ru; path = ru.lproj/ChatRoomViewController.xib; sourceTree = ""; }; FD61C853169FBBB6001AA2D6 /* ru */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ru; path = ru.lproj/ChatViewController.xib; sourceTree = ""; }; FD61C855169FBD1C001AA2D6 /* ru */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ru; path = ru.lproj/ContactDetailsLabelViewController.xib; sourceTree = ""; }; @@ -2994,6 +2998,8 @@ D32460E5159D9AAD00BA7F3A /* UITransparentView.m */, 340751E5150F38FC00B89C47 /* UIVideoButton.h */, 340751E6150F38FD00B89C47 /* UIVideoButton.m */, + F066515317F9A02E0064280C /* UITransparentTVCell.h */, + F066515417F9A02E0064280C /* UITransparentTVCell.m */, ); path = LinphoneUI; sourceTree = ""; @@ -5310,6 +5316,7 @@ D378906515AC373B00BD776C /* ContactDetailsLabelViewController.m in Sources */, D3E8F68615ADE05B0065A226 /* UIContactDetailsFooter.m in Sources */, C90FAA7915AF54E6002091CB /* HistoryDetailsViewController.m in Sources */, + F066515517F9A02E0064280C /* UITransparentTVCell.m in Sources */, D3F9A9EE15AF277E0045320F /* UACellBackgroundView.m in Sources */, D35860D615B549B500513429 /* Utils.m in Sources */, D3F7998115BD32370018C273 /* TPMultiLayoutViewController.m in Sources */, @@ -5408,6 +5415,7 @@ D378906615AC373B00BD776C /* ContactDetailsLabelViewController.m in Sources */, D3E8F68715ADE05B0065A226 /* UIContactDetailsFooter.m in Sources */, C90FAA7A15AF54E6002091CB /* HistoryDetailsViewController.m in Sources */, + F066515617F9A02E0064280C /* UITransparentTVCell.m in Sources */, D3F9A9EF15AF277E0045320F /* UACellBackgroundView.m in Sources */, D35860D715B549B500513429 /* Utils.m in Sources */, D3F7998215BD32370018C273 /* TPMultiLayoutViewController.m in Sources */,