Commit ef389642 authored by Carola Nitz's avatar Carola Nitz

clouds: Added one tableViewController for all cloud services

one tab to rule them all
parent 44c53541
...@@ -6,13 +6,13 @@ source 'https://github.com/CocoaPods/Specs.git' ...@@ -6,13 +6,13 @@ source 'https://github.com/CocoaPods/Specs.git'
target 'vlc-ios' do target 'vlc-ios' do
pod 'OBSlider', '1.1.0' pod 'OBSlider', '1.1.0'
pod 'QuincyKit', :git => 'https://github.com/carolanitz/QuincyKit.git'
pod 'PLCrashReporter', '1.2-rc5' pod 'PLCrashReporter', '1.2-rc5'
pod 'GHSidebarNav', '1.0.0' pod 'GHSidebarNav', '1.0.0'
pod 'InAppSettingsKit', '2.2.2' pod 'InAppSettingsKit', '2.2.2'
pod 'upnpx', '1.3.0' pod 'upnpx', '1.3.0'
pod 'box-ios-sdk-v2', :git => 'https://github.com/carolanitz/box-ios-sdk-v2.git'
pod 'SSKeychain' pod 'SSKeychain'
pod 'QuincyKit', :git => 'https://github.com/carolanitz/QuincyKit.git' #for version 3.0
pod 'box-ios-sdk-v2', :git => 'git://github.com/carolanitz/box-ios-sdk-v2.git', :commit => 'd2df30aa5f76d30910e06f3ef5aff49025de3cf1' #has a logout function added
end end
post_install do |installer_representation| post_install do |installer_representation|
......
...@@ -11,7 +11,7 @@ PODS: ...@@ -11,7 +11,7 @@ PODS:
- upnpx (1.3.0) - upnpx (1.3.0)
DEPENDENCIES: DEPENDENCIES:
- box-ios-sdk-v2 (from `https://github.com/carolanitz/box-ios-sdk-v2.git`) - box-ios-sdk-v2 (from `git://github.com/carolanitz/box-ios-sdk-v2.git`, commit `d2df30aa5f76d30910e06f3ef5aff49025de3cf1`)
- GHSidebarNav (= 1.0.0) - GHSidebarNav (= 1.0.0)
- InAppSettingsKit (= 2.2.2) - InAppSettingsKit (= 2.2.2)
- OBSlider (= 1.1.0) - OBSlider (= 1.1.0)
...@@ -22,14 +22,15 @@ DEPENDENCIES: ...@@ -22,14 +22,15 @@ DEPENDENCIES:
EXTERNAL SOURCES: EXTERNAL SOURCES:
box-ios-sdk-v2: box-ios-sdk-v2:
:git: https://github.com/carolanitz/box-ios-sdk-v2.git :commit: d2df30aa5f76d30910e06f3ef5aff49025de3cf1
:git: git://github.com/carolanitz/box-ios-sdk-v2.git
QuincyKit: QuincyKit:
:git: https://github.com/carolanitz/QuincyKit.git :git: https://github.com/carolanitz/QuincyKit.git
CHECKOUT OPTIONS: CHECKOUT OPTIONS:
box-ios-sdk-v2: box-ios-sdk-v2:
:commit: 5b9af5cf7ad1a19eff911b2fee6ce16dfeaeab3b :commit: d2df30aa5f76d30910e06f3ef5aff49025de3cf1
:git: https://github.com/carolanitz/box-ios-sdk-v2.git :git: git://github.com/carolanitz/box-ios-sdk-v2.git
QuincyKit: QuincyKit:
:commit: 5e7938a2e1f3bf08c4ed9f7f1aa3c67826df3625 :commit: 5e7938a2e1f3bf08c4ed9f7f1aa3c67826df3625
:git: https://github.com/carolanitz/QuincyKit.git :git: https://github.com/carolanitz/QuincyKit.git
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6221" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<development version="5000" identifier="xcode"/> <development version="5000" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6213"/>
</dependencies> </dependencies>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
...@@ -19,26 +19,23 @@ ...@@ -19,26 +19,23 @@
<rect key="frame" x="5" y="8" width="64" height="64"/> <rect key="frame" x="5" y="8" width="64" height="64"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView> </imageView>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="File Title" lineBreakMode="tailTruncation" baselineAdjustment="none" adjustsFontSizeToFit="NO" id="6"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="File Title" lineBreakMode="tailTruncation" baselineAdjustment="none" adjustsFontSizeToFit="NO" id="6">
<rect key="frame" x="83" y="21" width="177" height="21"/> <rect key="frame" x="83" y="21" width="177" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> <color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</label> </label>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Folder Title" lineBreakMode="tailTruncation" baselineAdjustment="none" adjustsFontSizeToFit="NO" id="23"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Folder Title" lineBreakMode="tailTruncation" baselineAdjustment="none" adjustsFontSizeToFit="NO" id="23">
<rect key="frame" x="83" y="29" width="177" height="21"/> <rect key="frame" x="83" y="29" width="177" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> <color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</label> </label>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Subtitle — Subtitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="7"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Subtitle — Subtitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="7">
<rect key="frame" x="83" y="44" width="177" height="15"/> <rect key="frame" x="83" y="44" width="177" height="15"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/> <fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
...@@ -59,9 +56,7 @@ ...@@ -59,9 +56,7 @@
</connections> </connections>
</button> </button>
</subviews> </subviews>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
</tableViewCellContentView> </tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<connections> <connections>
<outlet property="downloadButton" destination="VuV-6r-r3f" id="K9G-fy-OwZ"/> <outlet property="downloadButton" destination="VuV-6r-r3f" id="K9G-fy-OwZ"/>
<outlet property="folderTitleLabel" destination="23" id="24"/> <outlet property="folderTitleLabel" destination="23" id="24"/>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6221" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<development version="5000" identifier="xcode"/> <development version="5000" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6213"/>
</dependencies> </dependencies>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
...@@ -19,26 +19,23 @@ ...@@ -19,26 +19,23 @@
<rect key="frame" x="5" y="8" width="32" height="32"/> <rect key="frame" x="5" y="8" width="32" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView> </imageView>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="File Title" lineBreakMode="tailTruncation" baselineAdjustment="none" adjustsFontSizeToFit="NO" id="6"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="File Title" lineBreakMode="tailTruncation" baselineAdjustment="none" adjustsFontSizeToFit="NO" id="6">
<rect key="frame" x="45" y="8" width="230" height="18"/> <rect key="frame" x="45" y="8" width="230" height="18"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> <color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</label> </label>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Folder Title" lineBreakMode="tailTruncation" baselineAdjustment="none" adjustsFontSizeToFit="NO" id="23"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Folder Title" lineBreakMode="tailTruncation" baselineAdjustment="none" adjustsFontSizeToFit="NO" id="23">
<rect key="frame" x="45" y="15" width="230" height="18"/> <rect key="frame" x="45" y="15" width="230" height="18"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> <color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</label> </label>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Subtitle — Subtitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="7"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Subtitle — Subtitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="7">
<rect key="frame" x="45" y="25.5" width="230" height="15"/> <rect key="frame" x="45" y="26" width="230" height="15"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/> <fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
...@@ -59,9 +56,7 @@ ...@@ -59,9 +56,7 @@
</connections> </connections>
</button> </button>
</subviews> </subviews>
<color key="backgroundColor" red="0.1215686275" green="0.1215686275" blue="0.1215686275" alpha="1" colorSpace="calibratedRGB"/>
</tableViewCellContentView> </tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<connections> <connections>
<outlet property="downloadButton" destination="661-nY-3Tr" id="ehk-e3-y2O"/> <outlet property="downloadButton" destination="661-nY-3Tr" id="ehk-e3-y2O"/>
<outlet property="folderTitleLabel" destination="23" id="24"/> <outlet property="folderTitleLabel" destination="23" id="24"/>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6221" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<development version="5000" identifier="xcode"/> <development version="5000" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6213"/>
</dependencies> </dependencies>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCCloudStorageTableViewController"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCCloudStorageTableViewController">
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5053" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6221" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies> <dependencies>
<deployment defaultVersion="1552" identifier="iOS"/> <deployment identifier="iOS"/>
<development version="5000" identifier="xcode"/> <development version="5000" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6213"/>
</dependencies> </dependencies>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
...@@ -71,4 +71,9 @@ Title 2</string> ...@@ -71,4 +71,9 @@ Title 2</string>
<image name="folderIcon.png" width="120" height="112"/> <image name="folderIcon.png" width="120" height="112"/>
<image name="thumbOverlayPhone.png" width="129" height="75"/> <image name="thumbOverlayPhone.png" width="129" height="75"/>
</resources> </resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document> </document>
B"CHOOSE_AUDIO_TRACK"="Choose Audio Track"; B"CHOOSE_AUDIO_TRACK"="Choose Audio Track";
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
NSMutableArray *_listOfBoxFilesToDownload; NSMutableArray *_listOfBoxFilesToDownload;
BOOL _downloadInProgress; BOOL _downloadInProgress;
NSNumber *_maxOffset; int _maxOffset;
NSNumber *_offset; int _offset;
NSString *_folderId; NSString *_folderId;
CGFloat _averageSpeed; CGFloat _averageSpeed;
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
[[BoxSDK sharedSDK].OAuth2Session logout]; [[BoxSDK sharedSDK].OAuth2Session logout];
[self stopSession]; [self stopSession];
if ([self.delegate respondsToSelector:@selector(mediaListUpdated)]) if ([self.delegate respondsToSelector:@selector(mediaListUpdated)])
[self.delegate mediaListUpdated]; [self.delegate mediaListUpdated];
} }
- (BOOL)isAuthorized - (BOOL)isAuthorized
...@@ -192,8 +192,8 @@ ...@@ -192,8 +192,8 @@
- (void)_listOfGoodFilesAndFolders - (void)_listOfGoodFilesAndFolders
{ {
NSMutableArray *listOfGoodFilesAndFolders = [NSMutableArray new]; NSMutableArray *listOfGoodFilesAndFolders = [NSMutableArray new];
_maxOffset = _fileList.totalCount; _maxOffset = _fileList.totalCount.intValue;
_offset = [NSNumber numberWithInteger:_fileList.numberOfEntries]; _offset += _fileList.numberOfEntries;
for (int i = 0; i < _fileList.numberOfEntries; i++) for (int i = 0; i < _fileList.numberOfEntries; i++)
{ {
BoxModel *boxFile = [_fileList modelAtIndex:i]; BoxModel *boxFile = [_fileList modelAtIndex:i];
...@@ -231,7 +231,7 @@ ...@@ -231,7 +231,7 @@
BoxDownloadFailureBlock failureBlock = ^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error) BoxDownloadFailureBlock failureBlock = ^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error)
{ {
[self showAlert:NSLocalizedString(@"BOX_ERROR_DOWNLOADING_FILE_TITLE",nil) message:NSLocalizedString(@"BOX_ERROR_DOWNLOADING_FILE",nil)]; [self showAlert:NSLocalizedString(@"GDRIVE_ERROR_DOWNLOADING_FILE_TITLE",nil) message:NSLocalizedString(@"GDRIVE_ERROR_DOWNLOADING_FILE",nil)];
[self downloadFailedWithError:error]; [self downloadFailedWithError:error];
}; };
......
...@@ -24,9 +24,6 @@ ...@@ -24,9 +24,6 @@
NSString *_currentFolderId; NSString *_currentFolderId;
UIBarButtonItem *_backButton;
UIBarButtonItem *_backToMenuButton;
UIBarButtonItem *_numberOfFilesBarButtonItem; UIBarButtonItem *_numberOfFilesBarButtonItem;
UIBarButtonItem *_progressBarButtonItem; UIBarButtonItem *_progressBarButtonItem;
...@@ -56,9 +53,8 @@ ...@@ -56,9 +53,8 @@
self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"BoxWhite"]]; self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"BoxWhite"]];
self.navigationItem.titleView.contentMode = UIViewContentModeScaleAspectFit; self.navigationItem.titleView.contentMode = UIViewContentModeScaleAspectFit;
_backButton = [UIBarButtonItem themedBackButtonWithTarget:self andSelector:@selector(goBack:)]; UIBarButtonItem *backButton = [UIBarButtonItem themedBackButtonWithTarget:self andSelector:@selector(goBack:)];
_backToMenuButton = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)]; self.navigationItem.leftBarButtonItem = backButton;
self.navigationItem.leftBarButtonItem = _backToMenuButton;
self.tableView.rowHeight = [VLCCloudStorageTableViewCell heightOfCell]; self.tableView.rowHeight = [VLCCloudStorageTableViewCell heightOfCell];
self.tableView.separatorColor = [UIColor VLCDarkBackgroundColor]; self.tableView.separatorColor = [UIColor VLCDarkBackgroundColor];
...@@ -92,6 +88,9 @@ ...@@ -92,6 +88,9 @@
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_activityIndicator attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:0]]; [self.view addConstraint:[NSLayoutConstraint constraintWithItem:_activityIndicator attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:0]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_activityIndicator attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterY multiplier:1.0 constant:0]]; [self.view addConstraint:[NSLayoutConstraint constraintWithItem:_activityIndicator attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterY multiplier:1.0 constant:0]];
[self.cloudStorageLogo sizeToFit];
self.cloudStorageLogo.center = self.view.center;
// Handle logged in // Handle logged in
[[NSNotificationCenter defaultCenter] addObserver:self [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(boxApiTokenDidRefresh) selector:@selector(boxApiTokenDidRefresh)
...@@ -133,17 +132,13 @@ ...@@ -133,17 +132,13 @@
- (void)viewWillAppear:(BOOL)animated - (void)viewWillAppear:(BOOL)animated
{ {
[super viewWillAppear:animated];
self.navigationController.toolbarHidden = NO; self.navigationController.toolbarHidden = NO;
self.navigationController.toolbar.barStyle = UIBarStyleBlack; self.navigationController.toolbar.barStyle = UIBarStyleBlack;
[self.navigationController.toolbar setBackgroundImage:[UIImage imageNamed:@"bottomBlackBar"] forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault]; [self.navigationController.toolbar setBackgroundImage:[UIImage imageNamed:@"bottomBlackBar"] forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault];
//reload if we didn't come back from streaming
_currentFolderId = @""; _currentFolderId = @"";
if([_boxController.currentListFiles count] == 0) if([_boxController.currentListFiles count] == 0)
[self _requestInformationForCurrentFolderId]; [self _requestInformationForCurrentFolderId];
[super viewWillAppear:animated];
[self.cloudStorageLogo sizeToFit];
self.cloudStorageLogo.center = self.view.center;
} }
- (void)viewWillDisappear:(BOOL)animated - (void)viewWillDisappear:(BOOL)animated
...@@ -170,8 +165,6 @@ ...@@ -170,8 +165,6 @@
{ {
[_activityIndicator startAnimating]; [_activityIndicator startAnimating];
[_boxController requestDirectoryListingWithFolderId:_currentFolderId]; [_boxController requestDirectoryListingWithFolderId:_currentFolderId];
self.navigationItem.leftBarButtonItem = ![_currentFolderId isEqualToString:@""] ? _backButton : _backToMenuButton;
} }
- (IBAction)goBack:(id)sender - (IBAction)goBack:(id)sender
...@@ -180,7 +173,7 @@ ...@@ -180,7 +173,7 @@
_currentFolderId = [_currentFolderId stringByDeletingLastPathComponent]; _currentFolderId = [_currentFolderId stringByDeletingLastPathComponent];
[self _requestInformationForCurrentFolderId]; [self _requestInformationForCurrentFolderId];
} else } else
[[(VLCAppDelegate*)[UIApplication sharedApplication].delegate revealController] toggleSidebar:![(VLCAppDelegate*)[UIApplication sharedApplication].delegate revealController].sidebarShowing duration:kGHRevealSidebarDefaultAnimationDuration]; [self.navigationController popViewControllerAnimated:YES];
} }
#pragma mark - Table view data source #pragma mark - Table view data source
...@@ -296,7 +289,6 @@ ...@@ -296,7 +289,6 @@
- (BOOL)authorizationViewController:(BoxAuthorizationViewController *)authorizationViewController shouldLoadReceivedOAuth2RedirectRequest:(NSURLRequest *)request - (BOOL)authorizationViewController:(BoxAuthorizationViewController *)authorizationViewController shouldLoadReceivedOAuth2RedirectRequest:(NSURLRequest *)request
{ {
[[BoxSDK sharedSDK].OAuth2Session performAuthorizationCodeGrantWithReceivedURL:request.URL]; [[BoxSDK sharedSDK].OAuth2Session performAuthorizationCodeGrantWithReceivedURL:request.URL];
_authorizationInProgress = NO;
[self.navigationController popViewControllerAnimated:YES]; [self.navigationController popViewControllerAnimated:YES];
return NO; return NO;
} }
...@@ -320,8 +312,9 @@ ...@@ -320,8 +312,9 @@
{ {
NSString *token = [BoxSDK sharedSDK].OAuth2Session.refreshToken; NSString *token = [BoxSDK sharedSDK].OAuth2Session.refreshToken;
[SSKeychain setPassword:token forService:kVLCBoxService account:kVLCBoxAccount]; [SSKeychain setPassword:token forService:kVLCBoxService account:kVLCBoxAccount];
if (self.loginToCloudStorageView.superview) _authorizationInProgress = YES;
[self.loginToCloudStorageView removeFromSuperview]; [self updateViewAfterSessionChange];
_authorizationInProgress = NO;
} }
- (void)boxAPIAuthenticationDidFail - (void)boxAPIAuthenticationDidFail
...@@ -338,13 +331,32 @@ ...@@ -338,13 +331,32 @@
{ {
[self.navigationController popViewControllerAnimated:YES]; [self.navigationController popViewControllerAnimated:YES];
} }
- (void)updateViewAfterSessionChange
{
if(_authorizationInProgress) {
if (self.loginToCloudStorageView.superview) {
[self.loginToCloudStorageView removeFromSuperview];
}
return;
}
if (![_boxController isAuthorized]) {
[self _showLoginPanel];
return;
}
//reload if we didn't come back from streaming
_currentFolderId = @"";
if([_boxController.currentListFiles count] == 0)
[self _requestInformationForCurrentFolderId];
}
#pragma mark - login dialog #pragma mark - login dialog
- (void)_showLoginPanel - (void)_showLoginPanel
{ {
self.loginToCloudStorageView.frame = self.tableView.frame; self.loginToCloudStorageView.frame = self.tableView.frame;
if (!self.loginToCloudStorageView.superview) [self.view addSubview:self.loginToCloudStorageView];
[self.view addSubview:self.loginToCloudStorageView];
} }
- (IBAction)loginAction:(id)sender - (IBAction)loginAction:(id)sender
......
/*****************************************************************************
* VLCCloudServiceCell.h
* VLC for iOS
*****************************************************************************
* Copyright (c) 2014 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Carola Nitz <nitz.carola # googlemail.com>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#import <UIKit/UIKit.h>
@interface VLCCloudServiceCell : UITableViewCell
@property(nonatomic) IBOutlet UIImageView *icon;
@property(nonatomic) IBOutlet UILabel *cloudTitle;
@property(nonatomic) IBOutlet UILabel *cloudInformation;
@end
/*****************************************************************************
* VLCCloudServiceCell.m
* VLC for iOS
*****************************************************************************
* Copyright (c) 2014 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Carola Nitz <nitz.carola # googlemail.com>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#import "VLCCloudServiceCell.h"
@implementation VLCCloudServiceCell
- (void)awakeFromNib {
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6221" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6213"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="66" id="jmV-7P-Ob0" customClass="VLCCloudServiceCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="66"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="jmV-7P-Ob0" id="P7G-Z3-wQa">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="O6V-Qc-Q8x" userLabel="ServiceName">
<rect key="frame" x="61" y="8" width="251" height="27"/>
<constraints>
<constraint firstAttribute="height" constant="27" id="jmY-dU-gUi"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Login" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NEp-19-omb" userLabel="ServiceInformation">
<rect key="frame" x="61" y="40" width="251" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="749" verticalHuggingPriority="749" translatesAutoresizingMaskIntoConstraints="NO" id="k9V-qn-xQh">
<rect key="frame" x="13" y="13" width="40" height="39.5"/>
<constraints>
<constraint firstAttribute="width" secondItem="k9V-qn-xQh" secondAttribute="height" multiplier="1:1" id="G4X-8T-SgW"/>
<constraint firstAttribute="width" constant="40" id="b0z-Gv-5yY"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="G4X-8T-SgW"/>
</mask>
</variation>
</imageView>
</subviews>
<constraints>
<constraint firstAttribute="bottomMargin" secondItem="k9V-qn-xQh" secondAttribute="bottom" constant="5" id="9mT-Ig-oz7"/>
<constraint firstAttribute="trailingMargin" secondItem="O6V-Qc-Q8x" secondAttribute="trailing" id="DGs-Ef-HwX"/>
<constraint firstItem="O6V-Qc-Q8x" firstAttribute="top" secondItem="P7G-Z3-wQa" secondAttribute="topMargin" id="P7b-lX-3qH"/>
<constraint firstItem="k9V-qn-xQh" firstAttribute="leading" secondItem="P7G-Z3-wQa" secondAttribute="leadingMargin" constant="5" id="bjd-BQ-kB6"/>
<constraint firstItem="NEp-19-omb" firstAttribute="leading" secondItem="k9V-qn-xQh" secondAttribute="trailing" constant="8" id="bks-dW-hBU"/>
<constraint firstItem="k9V-qn-xQh" firstAttribute="top" secondItem="P7G-Z3-wQa" secondAttribute="topMargin" constant="5" id="eeS-aO-JcR"/>
<constraint firstItem="NEp-19-omb" firstAttribute="leading" secondItem="O6V-Qc-Q8x" secondAttribute="leading" id="fL2-8r-L4U"/>
<constraint firstAttribute="trailingMargin" secondItem="NEp-19-omb" secondAttribute="trailing" id="p2Z-h2-q2X"/>
<constraint firstAttribute="bottomMargin" secondItem="NEp-19-omb" secondAttribute="bottom" id="xAM-tl-LLT"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="cloudInformation" destination="NEp-19-omb" id="pWE-Kp-d7k"/>
<outlet property="cloudTitle" destination="O6V-Qc-Q8x" id="6Oe-Xb-nFb"/>
<outlet property="icon" destination="k9V-qn-xQh" id="5Bh-XZ-Kkl"/>
</connections>
<point key="canvasLocation" x="358" y="253"/>
</tableViewCell>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
</objects>
</document>
//
// VLCCloudServiceCellTableViewCell.h
// VLC for iOS
//
// Created by Carola Nitz on 23/12/14.
// Copyright (c) 2014 VideoLAN. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface VLCCloudServiceCellTableViewCell : UITableViewCell
@end
//
// VLCCloudServiceCellTableViewCell.m
// VLC for iOS
//
// Created by Carola Nitz on 23/12/14.
// Copyright (c) 2014 VideoLAN. All rights reserved.
//
#import "VLCCloudServiceCellTableViewCell.h"
@implementation VLCCloudServiceCellTableViewCell
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
/*****************************************************************************
* VLCCloudServicesTableViewController.h
* VLC for iOS
*****************************************************************************
* Copyright (c) 2014 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Carola Nitz <nitz.carola # googlemail.com>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#import <UIKit/UIKit.h>
@interface VLCCloudServicesTableViewController : UITableViewController
@end
/*****************************************************************************
* VLCCloudServicesTableViewController.m
* VLC for iOS
*****************************************************************************
* Copyright (c) 2014 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Carola Nitz <nitz.carola # googlemail.com>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#import "UIBarButtonItem+Theme.h"
#import "VLCCloudServicesTableViewController.h"
#import "VLCAppDelegate.h"
#import "VLCDropboxTableViewController.h"
#import "VLCGoogleDriveTableViewController.h"
#import "VLCBoxTableViewController.h"
#import "VLCOneDriveTableViewController.h"