Commit 714f9097 authored by Gleb Pinigin's avatar Gleb Pinigin Committed by Felix Paul Kühne

Aspen: add hiding/showing controllers panel by tapping on the screen

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 0075b6c6
......@@ -23,6 +23,8 @@
UIButton *_audioSwitcherButton;
UIView *_controllerPanel;
BOOL _controlsHidden;
UIActionSheet *_subtitleActionSheet;
UIActionSheet *_audiotrackActionSheet;
}
......
......@@ -9,7 +9,7 @@
#import "VLCMovieViewController.h"
#import "VLCExternalDisplayController.h"
@interface VLCMovieViewController ()
@interface VLCMovieViewController () <UIGestureRecognizerDelegate>
@property (nonatomic, retain) UIPopoverController *masterPopoverController;
@property (nonatomic, retain) UIWindow *externalWindow;
@end
......@@ -59,6 +59,12 @@
if ([self hasExternalDisplay]) {
[self showOnExternalDisplay];
}
_movieView.userInteractionEnabled = NO;
UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(toogleControlsVisible)];
recognizer.delegate = self;
[self.view addGestureRecognizer:recognizer];
[recognizer release];
}
- (void)viewWillAppear:(BOOL)animated
......@@ -99,6 +105,38 @@
return self;
}
#pragma mark - controls visibility
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
if (touch.view != self.view) {
return NO;
}
return YES;
}
- (void)toogleControlsVisible
{
_controlsHidden = !_controlsHidden;
CGFloat alpha = _controlsHidden? 0.0f: 1.0f;
if (!_controlsHidden) {
_controllerPanel.hidden = NO;
_controllerPanel.alpha = 0.0f;
}
void (^animationBlock)() = ^() {
_controllerPanel.alpha = alpha;
};
void (^completionBlock)(BOOL finished) = ^(BOOL finished) {
_controllerPanel.hidden = _controlsHidden;
};
[UIView animateWithDuration:0.3f animations:animationBlock completion:completionBlock];
}
#pragma mark - controls
- (IBAction)closePlayback:(id)sender
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment