From b4fe93840f0af6d97ca5d95ab5d0ae74939fa983 Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Mon, 8 Jun 2015 22:32:50 +0200 Subject: [PATCH] Ability to drag the video preview --- Classes/Base.lproj/InCallViewController.xib | 3 +++ Classes/InCallViewController.m | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/Classes/Base.lproj/InCallViewController.xib b/Classes/Base.lproj/InCallViewController.xib index a1239218f..a9e650ba5 100644 --- a/Classes/Base.lproj/InCallViewController.xib +++ b/Classes/Base.lproj/InCallViewController.xib @@ -35,6 +35,9 @@ + + + diff --git a/Classes/InCallViewController.m b/Classes/InCallViewController.m index 7924b7aee..a51503bb2 100644 --- a/Classes/InCallViewController.m +++ b/Classes/InCallViewController.m @@ -165,6 +165,11 @@ static UICompositeViewDescription *compositeDescription = nil; [callTableController.tableView setBackgroundColor:[UIColor clearColor]]; // Can't do it in Xib: issue with ios4 [callTableController.tableView setBackgroundView:nil]; // Can't do it in Xib: issue with ios4 + + UIPanGestureRecognizer *dragndrop = + [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(moveVideoPreview:)]; + dragndrop.minimumNumberOfTouches = 1; + [self.videoPreview addGestureRecognizer:dragndrop]; } - (void)viewDidUnload { @@ -490,4 +495,10 @@ static void hideSpinner(LinphoneCall *call, void *user_data) { [sheet dismissWithClickedButtonIndex:sheet.destructiveButtonIndex animated:TRUE]; } +#pragma mark VideoPreviewMoving + +- (void)moveVideoPreview:(UIPanGestureRecognizer *)dragndrop { + self.videoPreview.center = [dragndrop locationInView:videoPreview.superview]; +} + @end