diff --git a/Classes/InCallTableViewController.m b/Classes/InCallTableViewController.m index 4ca89b328..a2908bfec 100644 --- a/Classes/InCallTableViewController.m +++ b/Classes/InCallTableViewController.m @@ -226,6 +226,7 @@ enum TableSection { bool inConference = indexPath.section == ConferenceSection; LinphoneCore* lc = [LinphoneManager getLc]; + LinphoneCall* currentCall = linphone_core_get_current_call(lc); LinphoneCall* call = [InCallTableViewController retrieveCallAtIndex:indexPath.row inConference:inConference]; [cell setData:[self addCallData:call]]; @@ -235,7 +236,8 @@ enum TableSection { } else { [cell setFirstCell:false]; } - [cell setConferenceCall:inConference]; + [cell setCurrentCall:(currentCall == call)]; + [cell setConferenceCell:inConference]; [cell update]; if (linphone_core_get_calls_nb(lc) > 1 || linphone_core_get_conference_size(lc) > 0) { diff --git a/Classes/LinphoneUI/UICallCell.h b/Classes/LinphoneUI/UICallCell.h index dbc77ae4c..ff82a28dd 100644 --- a/Classes/LinphoneUI/UICallCell.h +++ b/Classes/LinphoneUI/UICallCell.h @@ -35,9 +35,11 @@ @interface UICallCell : UITableViewCell { @private BOOL firstCell; - BOOL conferenceCall; + BOOL conferenceCell; + BOOL currentCall; UIImageView* headerBackgroundImage; + UIImageView* headerBackgroundHightlightImage; UILabel *addressLabel; UILabel *stateLabel; @@ -55,6 +57,7 @@ @property (weak) UICallCellData *data; @property (nonatomic, retain) IBOutlet UIImageView* headerBackgroundImage; +@property (nonatomic, retain) IBOutlet UIImageView* headerBackgroundHightlightImage; @property (nonatomic, retain) IBOutlet UILabel* addressLabel; @property (nonatomic, retain) IBOutlet UILabel* stateLabel; @@ -67,7 +70,8 @@ @property (nonatomic, retain) IBOutlet UIView* avatarView; @property (assign) BOOL firstCell; -@property (assign) BOOL conferenceCall; +@property (assign) BOOL conferenceCell; +@property (nonatomic, assign) BOOL currentCall; - (void)update; diff --git a/Classes/LinphoneUI/UICallCell.m b/Classes/LinphoneUI/UICallCell.m index 628bab0eb..49800f98f 100644 --- a/Classes/LinphoneUI/UICallCell.m +++ b/Classes/LinphoneUI/UICallCell.m @@ -17,6 +17,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#import + #import "UICallCell.h" #import "LinphoneManager.h" @@ -38,6 +40,7 @@ @synthesize data; @synthesize headerBackgroundImage; +@synthesize headerBackgroundHightlightImage; @synthesize addressLabel; @synthesize stateLabel; @@ -50,8 +53,8 @@ @synthesize avatarView; @synthesize firstCell; -@synthesize conferenceCall; - +@synthesize conferenceCell; +@synthesize currentCall; #pragma mark - Lifecycle Functions @@ -67,6 +70,8 @@ // Set selected+over background: IB lack ! [pauseButton setImage:[UIImage imageNamed:@"call_state_pause_over.png"] forState:(UIControlStateHighlighted | UIControlStateSelected)]; + + self->currentCall = FALSE; } return self; } @@ -82,7 +87,27 @@ } -#pragma mark - Static cell sizes +- (void)prepareForReuse { + [super prepareForReuse]; + self->currentCall = FALSE; + [headerBackgroundHightlightImage setAlpha:0.0f]; +} + +#pragma mark - Properties Functions + +- (void)setCurrentCall:(BOOL) val { + BOOL oldVal = currentCall; + currentCall = val; + if(oldVal != val) { + if (currentCall) { + [self startBlinkAnimation:@"Blink" target:headerBackgroundHightlightImage]; + } else { + [self stopBlinkAnimation:@"Blink" target:headerBackgroundHightlightImage]; + } + } +} + +#pragma mark - Static Functions + (int)getMaximizedHeight { return 280; @@ -92,7 +117,31 @@ return 54; } +- (void)startBlinkAnimation:(NSString *)animationID target:(UIView *)target +{ + [UIView animateWithDuration:1.0 + delay: 0.0 + options: ([target alpha] == 1.0f)? UIViewAnimationOptionCurveEaseIn: UIViewAnimationOptionCurveEaseOut + animations:^{ + if([target alpha] == 1.0f) + [target setAlpha:0.0f]; + else + [target setAlpha:1.0f]; + } + completion:^(BOOL finished){ + if(finished) { + [self startBlinkAnimation: animationID target:target]; + } + }]; +} + +- (void)stopBlinkAnimation:(NSString *)animationID target:(UIView *)target { + [target.layer removeAnimationForKey:animationID]; + [target setAlpha:0.0f]; +} + + #pragma mark - - (void)update:(UICallCellData*) adata { @@ -131,7 +180,7 @@ LinphoneCallState state = linphone_call_get_state(call); - if(!conferenceCall) { + if(!conferenceCell) { if(state == LinphoneCallOutgoingRinging) { [stateImage setImage:[UIImage imageNamed:@"call_state_ringing_default.png"]]; [stateImage setHidden:false]; @@ -148,8 +197,10 @@ [removeButton setHidden:true]; if(firstCell) { [headerBackgroundImage setImage:[UIImage imageNamed:@"cell_call_first.png"]]; + [headerBackgroundHightlightImage setImage:[UIImage imageNamed:@"cell_call_first_hightlight.png"]]; } else { [headerBackgroundImage setImage:[UIImage imageNamed:@"cell_call.png"]]; + [headerBackgroundHightlightImage setImage:[UIImage imageNamed:@"cell_call_hightlight.png"]]; } } else { [stateImage setHidden:true]; @@ -157,7 +208,7 @@ [removeButton setHidden:false]; [headerBackgroundImage setImage:[UIImage imageNamed:@"cell_conference.png"]]; } - + NSMutableString* msDuration = [[NSMutableString alloc] init]; int duration = linphone_call_get_duration(call); [msDuration appendFormat:@"%02i:%02i", (duration/60), duration - 60 * (duration / 60), nil]; @@ -181,16 +232,15 @@ - (void)selfUpdate { UITableView *parentTable = (UITableView *)self.superview; - [parentTable beginUpdates]; + /*[parentTable beginUpdates]; [parentTable reloadData]; - [parentTable endUpdates]; - /* + [parentTable endUpdates];*/ if(parentTable) { NSIndexPath *index= [parentTable indexPathForCell:self]; if(index != nil) { [parentTable reloadRowsAtIndexPaths:[[NSArray alloc] initWithObjects:index, nil] withRowAnimation:false]; } - }*/ + } } diff --git a/Classes/LinphoneUI/UICallCell.xib b/Classes/LinphoneUI/UICallCell.xib index b58251e3f..b6da4700f 100644 --- a/Classes/LinphoneUI/UICallCell.xib +++ b/Classes/LinphoneUI/UICallCell.xib @@ -132,7 +132,7 @@ {320, 63} - + _NS:9 NO IBCocoaTouchFramework @@ -141,6 +141,18 @@ cell_call_first.png + + + 292 + {320, 63} + + + + _NS:9 + 0.0 + NO + IBCocoaTouchFramework + 292 @@ -4640,7 +4652,6 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE {{262, 12}, {50, 29}} - _NS:9 NO YES @@ -4707,7 +4718,6 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE {320, 460} - _NS:9 NO @@ -4796,6 +4806,22 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE 54 + + + headerBackgroundHightlightImage + + + + 57 + + + + selectedBackgroundView + + + + 58 + doHeaderClick: @@ -4871,6 +4897,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE + headerView @@ -4934,6 +4961,12 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE headerBackgroundImage + + 56 + + + headerBackgroundHightlightImage + @@ -4960,12 +4993,13 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 54 + 58 @@ -4990,6 +5024,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE UILabel UIImageView UIView + UIImageView UIImageView UIView UIPauseButton @@ -5010,6 +5045,10 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE avatarView UIView + + headerBackgroundHightlightImage + UIImageView + headerBackgroundImage UIImageView diff --git a/Classes/LinphoneUI/UIContactCell.xib b/Classes/LinphoneUI/UIContactCell.xib index 6eae6e799..f31f32511 100644 --- a/Classes/LinphoneUI/UIContactCell.xib +++ b/Classes/LinphoneUI/UIContactCell.xib @@ -11,7 +11,7 @@ 1181 - IBUIButton + IBUIImageView IBUIView IBUILabel IBProxyObject @@ -36,41 +36,6 @@ 292 - - - 292 - {320, 44} - - - - _NS:9 - NO - IBCocoaTouchFramework - 0 - 0 - NO - - 3 - MQA - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - 3 - MC41AA - - - 2 - 15 - - - Helvetica-Bold - 15 - 16 - - 274 @@ -113,6 +78,7 @@ {{75, 0}, {200, 44}} + _NS:328 NO YES @@ -143,6 +109,7 @@ {320, 44} + _NS:9 3 @@ -153,17 +120,35 @@ IBCocoaTouchFramework + + + 292 + {320, 44} + + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + list_hightlight.png + + + + + 292 + {320, 44} + + + + _NS:9 + NO + IBCocoaTouchFramework + - - - backgroundView - - - - 15 - firstNameLabel @@ -180,6 +165,22 @@ 18 + + + selectedBackgroundView + + + + 20 + + + + backgroundView + + + + 22 + @@ -206,16 +207,9 @@ - - - 14 - - - background - 6 @@ -228,6 +222,18 @@ lastName + + 19 + + + selectedBackground + + + 21 + + + background + @@ -236,15 +242,16 @@ UIResponder com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 18 + 22 @@ -280,6 +287,10 @@ YES 3 + + list_hightlight.png + {640, 88} + 1181 diff --git a/Classes/LinphoneUI/UIHistoryCell.xib b/Classes/LinphoneUI/UIHistoryCell.xib index d6b863fc9..c978fbc8e 100644 --- a/Classes/LinphoneUI/UIHistoryCell.xib +++ b/Classes/LinphoneUI/UIHistoryCell.xib @@ -167,6 +167,31 @@ IBCocoaTouchFramework + + + 292 + {320, 44} + + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + list_hightlight.png + + + + + 292 + {320, 44} + + + _NS:9 + NO + IBCocoaTouchFramework + @@ -202,6 +227,22 @@ 17 + + + selectedBackgroundView + + + + 22 + + + + backgroundView + + + + 24 + onDetails: @@ -275,6 +316,18 @@ deleteButton + + 21 + + + selectedBackground + + + 23 + + + background + @@ -286,6 +339,8 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -296,7 +351,7 @@ - 19 + 24 @@ -361,6 +416,7 @@ {45, 45} {45, 45} {45, 45} + {640, 88} 1181 diff --git a/Resources/cell_call_first_hightlight.png b/Resources/cell_call_first_hightlight.png new file mode 100644 index 000000000..99ea085a6 Binary files /dev/null and b/Resources/cell_call_first_hightlight.png differ diff --git a/Resources/cell_call_hightlight.png b/Resources/cell_call_hightlight.png new file mode 100644 index 000000000..4aaf77e56 Binary files /dev/null and b/Resources/cell_call_hightlight.png differ diff --git a/Resources/list_hightlight.png b/Resources/list_hightlight.png new file mode 100644 index 000000000..929bfbdbf Binary files /dev/null and b/Resources/list_hightlight.png differ diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 00dd5f44e..7b6a1fd9a 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -153,6 +153,8 @@ 7066FC0C13E830E400EFC6DC /* libvpx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7066FC0B13E830E400EFC6DC /* libvpx.a */; }; 70E542F313E147E3002BA2C0 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70E542F213E147E3002BA2C0 /* OpenGLES.framework */; }; 70E542F513E147EB002BA2C0 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70E542F413E147EB002BA2C0 /* QuartzCore.framework */; }; + D3196D2D15A3199D007FEEBA /* list_hightlight.png in Resources */ = {isa = PBXBuildFile; fileRef = D3196D2C15A3199D007FEEBA /* list_hightlight.png */; }; + D3196D2E15A3199D007FEEBA /* list_hightlight.png in Resources */ = {isa = PBXBuildFile; fileRef = D3196D2C15A3199D007FEEBA /* list_hightlight.png */; }; D31AAF5E159B3919002C6B02 /* InCallTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D31AAF5D159B3919002C6B02 /* InCallTableViewController.m */; }; D31AAF5F159B3919002C6B02 /* InCallTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D31AAF5D159B3919002C6B02 /* InCallTableViewController.m */; }; D31AAF63159B5B6F002C6B02 /* conference_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D31AAF61159B5B6E002C6B02 /* conference_default.png */; }; @@ -377,6 +379,10 @@ D3832801158100E400FA0D23 /* history_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D38327FD158100E400FA0D23 /* history_over.png */; }; D3832802158100E400FA0D23 /* settings_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D38327FE158100E400FA0D23 /* settings_over.png */; }; D3832803158100E400FA0D23 /* chat_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D38327FF158100E400FA0D23 /* chat_over.png */; }; + D38D14AF15A30B3D008497E8 /* cell_call_first_hightlight.png in Resources */ = {isa = PBXBuildFile; fileRef = D38D14AD15A30B3D008497E8 /* cell_call_first_hightlight.png */; }; + D38D14B015A30B3D008497E8 /* cell_call_first_hightlight.png in Resources */ = {isa = PBXBuildFile; fileRef = D38D14AD15A30B3D008497E8 /* cell_call_first_hightlight.png */; }; + D38D14B115A30B3D008497E8 /* cell_call_hightlight.png in Resources */ = {isa = PBXBuildFile; fileRef = D38D14AE15A30B3D008497E8 /* cell_call_hightlight.png */; }; + D38D14B215A30B3D008497E8 /* cell_call_hightlight.png in Resources */ = {isa = PBXBuildFile; fileRef = D38D14AE15A30B3D008497E8 /* cell_call_hightlight.png */; }; D3A55FBC15877E5E003FD403 /* UIContactCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3A55FBB15877E5E003FD403 /* UIContactCell.m */; }; D3A55FBD15877E5E003FD403 /* UIContactCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3A55FBB15877E5E003FD403 /* UIContactCell.m */; }; D3A55FBF15877E69003FD403 /* UIContactCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3A55FBE15877E69003FD403 /* UIContactCell.xib */; }; @@ -890,6 +896,7 @@ 70E542F213E147E3002BA2C0 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 70E542F413E147EB002BA2C0 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 8D1107310486CEB800E47090 /* linphone-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "linphone-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; + D3196D2C15A3199D007FEEBA /* list_hightlight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = list_hightlight.png; path = Resources/list_hightlight.png; sourceTree = ""; }; D31AAF5C159B3919002C6B02 /* InCallTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InCallTableViewController.h; sourceTree = ""; }; D31AAF5D159B3919002C6B02 /* InCallTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InCallTableViewController.m; sourceTree = ""; }; D31AAF61159B5B6E002C6B02 /* conference_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = conference_default.png; path = Resources/conference_default.png; sourceTree = ""; }; @@ -1047,6 +1054,8 @@ D38327FD158100E400FA0D23 /* history_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = history_over.png; path = Resources/history_over.png; sourceTree = ""; }; D38327FE158100E400FA0D23 /* settings_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = settings_over.png; path = Resources/settings_over.png; sourceTree = ""; }; D38327FF158100E400FA0D23 /* chat_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = chat_over.png; path = Resources/chat_over.png; sourceTree = ""; }; + D38D14AD15A30B3D008497E8 /* cell_call_first_hightlight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = cell_call_first_hightlight.png; path = Resources/cell_call_first_hightlight.png; sourceTree = ""; }; + D38D14AE15A30B3D008497E8 /* cell_call_hightlight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = cell_call_hightlight.png; path = Resources/cell_call_hightlight.png; sourceTree = ""; }; D3A55FBA15877E5E003FD403 /* UIContactCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIContactCell.h; sourceTree = ""; }; D3A55FBB15877E5E003FD403 /* UIContactCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIContactCell.m; sourceTree = ""; }; D3A55FBE15877E69003FD403 /* UIContactCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UIContactCell.xib; sourceTree = ""; }; @@ -1751,6 +1760,7 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + D3196D2C15A3199D007FEEBA /* list_hightlight.png */, D3F83F741582253100336684 /* accept_default.png */, D3F83F751582253100336684 /* accept_over.png */, D3D6A39B159B0EEF005F692C /* add_call_default.png */, @@ -1790,6 +1800,8 @@ D3F83F811582278D00336684 /* cancel_over.png */, D36C43CC158F2F370048BA40 /* cell_call.png */, D3211BB8159C8A820098460B /* cell_call_first.png */, + D38D14AD15A30B3D008497E8 /* cell_call_first_hightlight.png */, + D38D14AE15A30B3D008497E8 /* cell_call_hightlight.png */, D36C43CD158F2F370048BA40 /* cell_conference.png */, D3EA5401159852080037DC6B /* chat_add_default.png */, D3EA5402159852080037DC6B /* chat_add_over.png */, @@ -2292,6 +2304,9 @@ D365AA7D15A2DE7500CAFE3F /* speaker_on_disabled.png in Resources */, D35EA76315A2DF8D003E025D /* micro_off_disabled.png in Resources */, D35EA76515A2DF8D003E025D /* micro_on_disabled.png in Resources */, + D38D14AF15A30B3D008497E8 /* cell_call_first_hightlight.png in Resources */, + D38D14B115A30B3D008497E8 /* cell_call_hightlight.png in Resources */, + D3196D2D15A3199D007FEEBA /* list_hightlight.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2473,6 +2488,9 @@ D365AA7E15A2DE7500CAFE3F /* speaker_on_disabled.png in Resources */, D35EA76415A2DF8D003E025D /* micro_off_disabled.png in Resources */, D35EA76615A2DF8D003E025D /* micro_on_disabled.png in Resources */, + D38D14B015A30B3D008497E8 /* cell_call_first_hightlight.png in Resources */, + D38D14B215A30B3D008497E8 /* cell_call_hightlight.png in Resources */, + D3196D2E15A3199D007FEEBA /* list_hightlight.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; };