Commit 7b7a516f authored by Tobias's avatar Tobias

put empty info views for audio settings and playback speed

animate size changes of info views
parent 0e8f9a4f
/*****************************************************************************
* VLC for iOS
*****************************************************************************
* Copyright (c) 2015 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Tobias Conradi <videolan # tobias-conradi.de>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#import <UIKit/UIKit.h>
@interface VLCPlaybackInfoAudioTVViewController : UIViewController
@end
/*****************************************************************************
* VLC for iOS
*****************************************************************************
* Copyright (c) 2015 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Tobias Conradi <videolan # tobias-conradi.de>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#import "VLCPlaybackInfoAudioTVViewController.h"
@interface VLCPlaybackInfoAudioTVViewController ()
@end
@implementation VLCPlaybackInfoAudioTVViewController
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.title = NSLocalizedString(@"AUDIO_INFO_VC_TITLE", nil);
self.edgesForExtendedLayout = UIRectEdgeNone;
}
return self;
}
- (CGSize)preferredContentSize {
return CGSizeMake(CGRectGetWidth(self.view.bounds), 300);
}
- (BOOL)_tvTabBarShouldAutohide
{
return NO;
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder.AppleTV.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCPlaybackInfoAudioTVViewController">
<connections>
<outlet property="view" destination="lzE-Lg-I4v" id="muP-eq-TfJ"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<visualEffectView opaque="NO" contentMode="scaleToFill" id="lzE-Lg-I4v">
<rect key="frame" x="0.0" y="0.0" width="240" height="128"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="oh5-AA-mJb">
<rect key="frame" x="0.0" y="0.0" width="240" height="128"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Put audio stuff here" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RD5-yN-Bxj">
<rect key="frame" x="45" y="54" width="151" height="21"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<animations/>
<constraints>
<constraint firstItem="RD5-yN-Bxj" firstAttribute="centerX" secondItem="oh5-AA-mJb" secondAttribute="centerX" id="LbQ-gh-TnV"/>
<constraint firstItem="RD5-yN-Bxj" firstAttribute="centerY" secondItem="oh5-AA-mJb" secondAttribute="centerY" id="Y2G-FT-lep"/>
</constraints>
</view>
<animations/>
<blurEffect style="light"/>
</visualEffectView>
</objects>
</document>
/*****************************************************************************
* VLC for iOS
*****************************************************************************
* Copyright (c) 2015 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Tobias Conradi <videolan # tobias-conradi.de>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#import <UIKit/UIKit.h>
@interface VLCPlaybackInfoSpeedTVViewController : UIViewController
@property (nonatomic) IBOutlet UISegmentedControl *speedSegementedControl;
@end
/*****************************************************************************
* VLC for iOS
*****************************************************************************
* Copyright (c) 2015 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Tobias Conradi <videolan # tobias-conradi.de>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#import "VLCPlaybackInfoSpeedTVViewController.h"
@interface VLCPlaybackInfoSpeedTVViewController ()
@end
@implementation VLCPlaybackInfoSpeedTVViewController
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.title = NSLocalizedString(@"PLAYBACK_SPEED_INFO_VC_TITLE", nil);
self.edgesForExtendedLayout = UIRectEdgeNone;
}
return self;
}
- (CGSize)preferredContentSize {
return CGSizeMake(CGRectGetWidth(self.view.bounds), 100);
}
- (BOOL)_tvTabBarShouldAutohide
{
return NO;
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder.AppleTV.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCPlaybackInfoSpeedTVViewController">
<connections>
<outlet property="preferredFocusedView" destination="2rV-t5-gXc" id="mn0-9U-gGS"/>
<outlet property="speedSegementedControl" destination="2rV-t5-gXc" id="3qY-xe-QuX"/>
<outlet property="view" destination="ANq-wj-TcM" id="bgr-uX-P6k"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<visualEffectView opaque="NO" contentMode="scaleToFill" id="ANq-wj-TcM">
<rect key="frame" x="0.0" y="0.0" width="1920" height="109"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="fVw-qf-RcQ">
<rect key="frame" x="0.0" y="0.0" width="1920" height="109"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="2rV-t5-gXc">
<rect key="frame" x="783" y="20" width="354" height="70"/>
<animations/>
<color key="backgroundColor" white="0.0" alpha="0.10000000000000001" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="69" id="2e1-aS-ccu"/>
</constraints>
<segments>
<segment title="First"/>
<segment title="Second"/>
</segments>
</segmentedControl>
</subviews>
<animations/>
<constraints>
<constraint firstAttribute="bottom" secondItem="2rV-t5-gXc" secondAttribute="bottom" constant="20" symbolic="YES" id="WS8-am-ULZ"/>
<constraint firstItem="2rV-t5-gXc" firstAttribute="top" secondItem="fVw-qf-RcQ" secondAttribute="top" constant="20" symbolic="YES" id="fCC-KH-NLw"/>
<constraint firstItem="2rV-t5-gXc" firstAttribute="centerX" secondItem="fVw-qf-RcQ" secondAttribute="centerX" id="mq3-vV-MJ9"/>
</constraints>
</view>
<animations/>
<blurEffect style="light"/>
<point key="canvasLocation" x="449" y="509"/>
</visualEffectView>
</objects>
</document>
......@@ -10,8 +10,10 @@
*****************************************************************************/
#import "VLCPlaybackInfoTVViewController.h"
#import "VLCPlaybackInfoSpeedTVViewController.h"
#import "VLCPlaybackInfoAudioTVViewController.h"
@interface VLCPlaybackInfoTVViewController ()
@interface VLCPlaybackInfoTVViewController () <UITabBarControllerDelegate, UIGestureRecognizerDelegate>
@property (nonatomic) IBOutlet UIView *containerView;
@property (nonatomic) IBOutlet UIView *dimmingView;
@property (nonatomic) IBOutlet NSLayoutConstraint *containerHeightConstraint;
......@@ -21,11 +23,23 @@
@implementation VLCPlaybackInfoTVViewController
- (void)viewDidLoad {
- (NSArray<UIViewController*>*) tabViewControllers {
return @[
[[VLCPlaybackInfoSpeedTVViewController alloc] initWithNibName:nil bundle:nil],
[[VLCPlaybackInfoAudioTVViewController alloc] initWithNibName:nil bundle:nil],
];
}
- (void)viewDidLoad
{
[super viewDidLoad];
UITabBarController *controller = [[UITabBarController alloc] init];
controller.delegate = self;
controller.viewControllers = [self tabViewControllers];
self.tabBarController = controller;
[self addChildViewController:controller];
controller.view.frame = self.containerView.bounds;
......@@ -35,20 +49,52 @@
UISwipeGestureRecognizer *swipeUpRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeUpRecognized:)];
swipeUpRecognizer.direction = UISwipeGestureRecognizerDirectionUp;
swipeUpRecognizer.delegate = self;
[self.view addGestureRecognizer:swipeUpRecognizer];
}
- (BOOL)shouldAutomaticallyForwardAppearanceMethods {
return YES;
}
- (void)swipeUpRecognized:(UISwipeGestureRecognizer *)recognizer {
// TODO: check if it was a navigation gesture in child??
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)updateViewConstraints {
[super updateViewConstraints];
UIViewController *viewController = self.tabBarController.selectedViewController;
CGFloat tabbarHeight = CGRectGetHeight(self.tabBarController.tabBar.bounds);
CGFloat controllerHeight = viewController.preferredContentSize.height;
self.containerHeightConstraint.constant = controllerHeight + tabbarHeight;
}
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
[UIView animateWithDuration:0.3
animations:^{
[self updateViewConstraints];
[self.view layoutIfNeeded];
}];
}
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
// FIXME: is there any other way to figure out if the tab bar item is currenlty focused?
UIView *view = [[UIScreen mainScreen] focusedView];
while (view) {
if ([view isKindOfClass:[UITabBar class]]) {
return YES;
}
view = view.superview;
}
return NO;
}
@end
......
......@@ -6,7 +6,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCPlaybackInfoTVViewController">
<connections>
<outlet property="containerHeightConstraint" destination="PQd-PR-z5I" id="40d-bO-xMR"/>
<outlet property="containerHeightConstraint" destination="PQd-PR-z5I" id="zui-1d-1Yo"/>
<outlet property="containerView" destination="U6y-cE-eGu" id="pdM-21-C2a"/>
<outlet property="dimmingView" destination="fkF-mr-3nG" id="NO9-Ww-dkm"/>
<outlet property="view" destination="iN0-l3-epB" id="aoh-6Y-hrX"/>
......@@ -25,14 +25,12 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U6y-cE-eGu" userLabel="Container">
<rect key="frame" x="0.0" y="0.0" width="1920" height="400"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="400" id="PQd-PR-z5I"/>
<constraint firstAttribute="height" constant="400" identifier="container height constraint" id="PQd-PR-z5I"/>
</constraints>
</view>
</subviews>
<animations/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="fkF-mr-3nG" firstAttribute="top" secondItem="U6y-cE-eGu" secondAttribute="bottom" id="56R-lg-86y"/>
<constraint firstItem="fkF-mr-3nG" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="9tl-tu-ZJg"/>
......
......@@ -325,6 +325,10 @@
DD8095DB1BE3C42F0065D8E1 /* VLCBufferingBar.m in Sources */ = {isa = PBXBuildFile; fileRef = DD8095DA1BE3C42F0065D8E1 /* VLCBufferingBar.m */; };
DD8095E01BE3EFC20065D8E1 /* VLCPlaybackInfoTVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD8095DE1BE3EFC20065D8E1 /* VLCPlaybackInfoTVViewController.m */; };
DD8095E51BE3F4240065D8E1 /* VLCPlaybackInfoTVViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = DD8095E41BE3F4240065D8E1 /* VLCPlaybackInfoTVViewController.xib */; };
DD8095EB1BE4F04E0065D8E1 /* VLCPlaybackInfoSpeedTVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD8095E91BE4F04E0065D8E1 /* VLCPlaybackInfoSpeedTVViewController.m */; };
DD8095EC1BE4F04E0065D8E1 /* VLCPlaybackInfoSpeedTVViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = DD8095EA1BE4F04E0065D8E1 /* VLCPlaybackInfoSpeedTVViewController.xib */; };
DD8095F21BE510770065D8E1 /* VLCPlaybackInfoAudioTVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD8095F01BE510770065D8E1 /* VLCPlaybackInfoAudioTVViewController.m */; };
DD8095F31BE510770065D8E1 /* VLCPlaybackInfoAudioTVViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = DD8095F11BE510770065D8E1 /* VLCPlaybackInfoAudioTVViewController.xib */; };
DD8F84311B00EB3B0009138A /* VLCPlaybackController+MediaLibrary.m in Sources */ = {isa = PBXBuildFile; fileRef = DD8F84301B00EB3B0009138A /* VLCPlaybackController+MediaLibrary.m */; };
DDAD5C2B1BB999CA006AFD3B /* VLCMovieViewControlPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = DDAD5C2A1BB999CA006AFD3B /* VLCMovieViewControlPanel.xib */; };
DDB7C6A41BAEB28200E6570E /* WKInterfaceController+VLCConnectionAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = DD9FBE761BAD6BB600FFE77A /* WKInterfaceController+VLCConnectionAlert.m */; };
......@@ -987,6 +991,12 @@
DD8095DD1BE3EFC20065D8E1 /* VLCPlaybackInfoTVViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCPlaybackInfoTVViewController.h; sourceTree = "<group>"; };
DD8095DE1BE3EFC20065D8E1 /* VLCPlaybackInfoTVViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCPlaybackInfoTVViewController.m; sourceTree = "<group>"; };
DD8095E41BE3F4240065D8E1 /* VLCPlaybackInfoTVViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VLCPlaybackInfoTVViewController.xib; sourceTree = "<group>"; };
DD8095E81BE4F04E0065D8E1 /* VLCPlaybackInfoSpeedTVViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCPlaybackInfoSpeedTVViewController.h; sourceTree = "<group>"; };
DD8095E91BE4F04E0065D8E1 /* VLCPlaybackInfoSpeedTVViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCPlaybackInfoSpeedTVViewController.m; sourceTree = "<group>"; };
DD8095EA1BE4F04E0065D8E1 /* VLCPlaybackInfoSpeedTVViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VLCPlaybackInfoSpeedTVViewController.xib; sourceTree = "<group>"; };
DD8095EF1BE510770065D8E1 /* VLCPlaybackInfoAudioTVViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCPlaybackInfoAudioTVViewController.h; sourceTree = "<group>"; };
DD8095F01BE510770065D8E1 /* VLCPlaybackInfoAudioTVViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCPlaybackInfoAudioTVViewController.m; sourceTree = "<group>"; };
DD8095F11BE510770065D8E1 /* VLCPlaybackInfoAudioTVViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VLCPlaybackInfoAudioTVViewController.xib; sourceTree = "<group>"; };
DD8C8F9F1B676C0900B3C4EE /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
DD8C8FA01B676C0F00B3C4EE /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = "<group>"; };
DD8C8FA11B676C1700B3C4EE /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/Localizable.strings; sourceTree = "<group>"; };
......@@ -1782,6 +1792,8 @@
7D3E528A1BD7B5E100309D15 /* VLCCloudServicesTVViewController.xib */,
7DEC8BDD1BD67899006E1093 /* VLCFullscreenMovieTVViewController.xib */,
DD8095E41BE3F4240065D8E1 /* VLCPlaybackInfoTVViewController.xib */,
DD8095F11BE510770065D8E1 /* VLCPlaybackInfoAudioTVViewController.xib */,
DD8095EA1BE4F04E0065D8E1 /* VLCPlaybackInfoSpeedTVViewController.xib */,
7D7EF3D91BD56B5900CD4CEE /* VLCOpenNetworkStreamTVViewController.xib */,
DDEAECF51BDFEAFA00756C83 /* VLCLocalNetworkServerTVCell.xib */,
);
......@@ -1883,6 +1895,10 @@
7DEC8BDC1BD67899006E1093 /* VLCFullscreenMovieTVViewController.m */,
DD8095DD1BE3EFC20065D8E1 /* VLCPlaybackInfoTVViewController.h */,
DD8095DE1BE3EFC20065D8E1 /* VLCPlaybackInfoTVViewController.m */,
DD8095E81BE4F04E0065D8E1 /* VLCPlaybackInfoSpeedTVViewController.h */,
DD8095E91BE4F04E0065D8E1 /* VLCPlaybackInfoSpeedTVViewController.m */,
DD8095EF1BE510770065D8E1 /* VLCPlaybackInfoAudioTVViewController.h */,
DD8095F01BE510770065D8E1 /* VLCPlaybackInfoAudioTVViewController.m */,
);
name = Playback;
sourceTree = "<group>";
......@@ -2478,10 +2494,12 @@
7DEC8C1E1BD69710006E1093 /* About Contents.html in Resources */,
DDEAECF61BDFEAFA00756C83 /* VLCLocalNetworkServerTVCell.xib in Resources */,
7D13294F1BA1F10100BE647E /* Assets.xcassets in Resources */,
DD8095EC1BE4F04E0065D8E1 /* VLCPlaybackInfoSpeedTVViewController.xib in Resources */,
7DEC8BE91BD68BC9006E1093 /* Settings.bundle in Resources */,
DD3EAC131BE26166003668DA /* VLCServerBrowsingTVCell.xib in Resources */,
7D3E528C1BD7B5E100309D15 /* VLCCloudServicesTVViewController.xib in Resources */,
7D7EF3DB1BD56B5900CD4CEE /* VLCOpenNetworkStreamTVViewController.xib in Resources */,
DD8095F31BE510770065D8E1 /* VLCPlaybackInfoAudioTVViewController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -2708,6 +2726,8 @@
7D5278E21BD7E06E00D0CA0E /* VLCDropboxController.m in Sources */,
7DEC8BD91BD670EB006E1093 /* VLCPlaybackNavigationController.m in Sources */,
7DEC8BDA1BD67112006E1093 /* VLCFrostedGlasView.m in Sources */,
DD8095F21BE510770065D8E1 /* VLCPlaybackInfoAudioTVViewController.m in Sources */,
DD8095EB1BE4F04E0065D8E1 /* VLCPlaybackInfoSpeedTVViewController.m in Sources */,
DD3EAC051BE153B4003668DA /* VLCNetworkImageView.m in Sources */,
7D0C35341BD97C7B0058CD19 /* VLCOneDriveObject.m in Sources */,
7D0C35331BD97C100058CD19 /* VLCOneDriveController.m in Sources */,
......
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