Skip to content

Commit

Permalink
Version 0.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cyisrael committed Apr 21, 2016
1 parent c4dc458 commit fb4b47e
Show file tree
Hide file tree
Showing 6 changed files with 185 additions and 111 deletions.
11 changes: 11 additions & 0 deletions CardboardSamples/Panorama/PanoramaViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
static const CGFloat kMargin = 16;
static const CGFloat kPanoViewHeight = 250;

@interface PanoramaViewController ()<GCSWidgetViewDelegate>

@end

@implementation PanoramaViewController {
GCSPanoramaView *_panoView;
UIScrollView *_scrollView;
Expand Down Expand Up @@ -41,6 +45,7 @@ - (void)viewDidLoad {
[_scrollView addSubview:_preambleLabel];

_panoView = [[GCSPanoramaView alloc] init];
_panoView.delegate = self;
_panoView.enableFullscreenButton = YES;
_panoView.enableCardboardButton = YES;
[_panoView loadImage:[UIImage imageNamed:@"andes.jpg"]
Expand Down Expand Up @@ -110,6 +115,12 @@ - (void)viewWillLayoutSubviews {
CGRectGetMaxY(_attributionTextView.frame) + kMargin);
}

#pragma mark - GCSWidgetViewDelegate

- (void)widgetView:(GCSWidgetView *)widgetView didLoadContent:(id)content {
NSLog(@"Loaded panorama image");
}

#pragma mark - Implementation

- (UILabel *)createLabelWithFontSize:(CGFloat)fontSize text:(NSString *)text {
Expand Down
2 changes: 2 additions & 0 deletions CardboardSamples/VideoWidgetDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,7 @@
</array>
<key>UIStatusBarHidden</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>Main</string>
</dict>
</plist>
149 changes: 149 additions & 0 deletions CardboardSamples/VideoWidgetDemo/Main.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="ucw-jQ-RGE">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Video-->
<scene sceneID="JYz-Q5-2PB">
<objects>
<viewController id="BlZ-Mm-Y3L" customClass="VideoPlayerViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="qNT-C6-JY3"/>
<viewControllerLayoutGuide type="bottom" id="N99-VI-OPU"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="4Ge-FZ-HvE">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xSQ-Rm-Amy">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<subviews>
<view contentMode="scaleToFill" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hSa-1o-yF1" userLabel="Content View">
<rect key="frame" x="0.0" y="0.0" width="600" height="1020"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Gorillas" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Q4F-dQ-BiS">
<rect key="frame" x="16" y="8" width="568" height="24"/>
<edgeInsets key="layoutMargins" top="16" left="16" bottom="8" right="16"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="The great apes from Central Africa" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IdK-dO-gJH">
<rect key="frame" x="16" y="40" width="568" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="1000" verticalCompressionResistancePriority="1000" misplaced="YES" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oSt-NH-4YG">
<rect key="frame" x="16" y="65" width="568" height="91"/>
<string key="text">Gorillas are ground-dwelling, predominantly herbivorous apes that inhabit the forests of central Africa.

The 360 video below shows gorillas in the Congo rainforest.</string>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="16" y="89" width="368" height="127"/>
</variation>
</label>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ipc-WR-9VX" customClass="GCSVideoView">
<rect key="frame" x="16" y="164" width="568" height="250"/>
<constraints>
<constraint firstAttribute="height" constant="250" id="Oiz-g9-GnN"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="1000" verticalCompressionResistancePriority="1000" misplaced="YES" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vrx-Kb-p6w">
<rect key="frame" x="16" y="422" width="568" height="311"/>
<string key="text">The eponymous genus Gorilla is divided into species: the eastern gorillas and the western gorillas, and either four or five subspecies. They are the largest living primates by physical size.

The DNA of gorillas is highly similar to that of humans, from 95–99% depending on what is counted, and they are the next closest living relatives to humans after the chimpanzees and bonobos.

Gorillas' natural habitats cover tropical or subtropical forests in Africa. Although their range covers a small percentage of Africa, gorillas cover a wide range of elevations. The mountain gorilla inhabits the Albertine Rift montane cloud forests of the Virunga Volcanoes, ranging in altitude from 2,200–4,300 metres (7,200–14,100 ft). Lowland gorillas live in dense forests and lowland swamps and marshes as low as sea level, with western lowland gorillas living in Central West African countries and eastern lowland gorillas living in the Democratic Republic of the Congo near its border with Rwanda.
</string>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
<variation key="heightClass=regular-widthClass=compact" misplaced="YES">
<rect key="frame" x="16" y="89" width="368" height="127"/>
</variation>
</label>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" editable="NO" text="Source: Wikipedia" translatesAutoresizingMaskIntoConstraints="NO" id="2qL-VB-ErL">
<rect key="frame" x="16" y="741" width="568" height="36"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="Q4F-dQ-BiS" firstAttribute="leading" secondItem="hSa-1o-yF1" secondAttribute="leading" constant="16" id="000-wT-t7v"/>
<constraint firstAttribute="trailing" secondItem="Vrx-Kb-p6w" secondAttribute="trailing" constant="16" id="3y3-mp-mgl"/>
<constraint firstItem="Q4F-dQ-BiS" firstAttribute="top" secondItem="hSa-1o-yF1" secondAttribute="top" constant="8" id="4pE-Rx-cCc"/>
<constraint firstAttribute="trailing" secondItem="IdK-dO-gJH" secondAttribute="trailing" constant="16" id="Bki-us-Hbp"/>
<constraint firstAttribute="trailing" secondItem="oSt-NH-4YG" secondAttribute="trailing" constant="16" id="C2m-ia-8PP"/>
<constraint firstItem="IdK-dO-gJH" firstAttribute="top" secondItem="Q4F-dQ-BiS" secondAttribute="bottom" constant="8" id="F5F-vf-nQR"/>
<constraint firstItem="IdK-dO-gJH" firstAttribute="leading" secondItem="hSa-1o-yF1" secondAttribute="leading" constant="16" id="GPL-W0-EAk"/>
<constraint firstItem="2qL-VB-ErL" firstAttribute="top" secondItem="Vrx-Kb-p6w" secondAttribute="bottom" constant="8" id="M2P-Rn-Yjs"/>
<constraint firstItem="2qL-VB-ErL" firstAttribute="leading" secondItem="hSa-1o-yF1" secondAttribute="leading" constant="16" id="MB9-2C-yW6"/>
<constraint firstItem="oSt-NH-4YG" firstAttribute="top" secondItem="IdK-dO-gJH" secondAttribute="bottom" constant="8" id="PXt-GS-vwz"/>
<constraint firstAttribute="trailing" secondItem="Ipc-WR-9VX" secondAttribute="trailing" constant="16" id="TTK-6p-bWL"/>
<constraint firstAttribute="trailing" secondItem="Q4F-dQ-BiS" secondAttribute="trailing" constant="16" id="XbY-6X-Hkc"/>
<constraint firstItem="Ipc-WR-9VX" firstAttribute="leading" secondItem="hSa-1o-yF1" secondAttribute="leading" constant="16" id="gmL-Cz-07x"/>
<constraint firstItem="Ipc-WR-9VX" firstAttribute="top" secondItem="oSt-NH-4YG" secondAttribute="bottom" constant="8" id="ipC-o7-9g6"/>
<constraint firstItem="Vrx-Kb-p6w" firstAttribute="top" secondItem="Ipc-WR-9VX" secondAttribute="bottom" constant="8" id="qjV-GS-YYv"/>
<constraint firstAttribute="trailing" secondItem="2qL-VB-ErL" secondAttribute="trailing" constant="16" id="u6y-WX-l2t"/>
<constraint firstItem="Vrx-Kb-p6w" firstAttribute="leading" secondItem="hSa-1o-yF1" secondAttribute="leading" constant="16" id="wCa-6J-8wC"/>
<constraint firstItem="oSt-NH-4YG" firstAttribute="leading" secondItem="hSa-1o-yF1" secondAttribute="leading" constant="16" id="yd3-3g-JN3"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="hSa-1o-yF1" secondAttribute="trailing" id="NX5-ha-42c"/>
<constraint firstItem="hSa-1o-yF1" firstAttribute="top" secondItem="xSQ-Rm-Amy" secondAttribute="top" id="cwG-1N-Lh2"/>
<constraint firstAttribute="bottom" secondItem="hSa-1o-yF1" secondAttribute="bottom" id="dxp-Vg-fRC"/>
<constraint firstItem="hSa-1o-yF1" firstAttribute="leading" secondItem="xSQ-Rm-Amy" secondAttribute="leading" id="lZo-hK-All"/>
</constraints>
</scrollView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="hSa-1o-yF1" firstAttribute="width" secondItem="4Ge-FZ-HvE" secondAttribute="width" id="05e-Yg-NiP"/>
<constraint firstItem="xSQ-Rm-Amy" firstAttribute="height" secondItem="4Ge-FZ-HvE" secondAttribute="height" id="Ao3-ua-LRh"/>
<constraint firstItem="xSQ-Rm-Amy" firstAttribute="width" secondItem="4Ge-FZ-HvE" secondAttribute="width" id="ZXO-0D-abk"/>
<constraint firstItem="xSQ-Rm-Amy" firstAttribute="centerX" secondItem="4Ge-FZ-HvE" secondAttribute="centerX" id="pPi-8G-rWB"/>
<constraint firstItem="xSQ-Rm-Amy" firstAttribute="centerY" secondItem="4Ge-FZ-HvE" secondAttribute="centerY" id="xnR-mw-ODU"/>
</constraints>
</view>
<navigationItem key="navigationItem" title="Video" id="fFr-kZ-WeP"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<size key="freeformSize" width="600" height="600"/>
<connections>
<outlet property="attributionTextView" destination="2qL-VB-ErL" id="5XO-iF-i3N"/>
<outlet property="videoView" destination="Ipc-WR-9VX" id="KXG-G8-jTV"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="M8l-7S-Avb" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1412" y="330"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="hkk-Z3-2q8">
<objects>
<navigationController id="ucw-jQ-RGE" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="hOs-NN-N0l">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="BlZ-Mm-Y3L" kind="relationship" relationship="rootViewController" id="Jaf-DG-iIK"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Jcp-Zd-DVE" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="716" y="330.99999999999994"/>
</scene>
</scenes>
</document>
6 changes: 0 additions & 6 deletions CardboardSamples/VideoWidgetDemo/VideoPlayerAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ @implementation VideoPlayerAppDelegate

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UIViewController *viewController = [[VideoPlayerViewController alloc] init];
viewController = [[UINavigationController alloc] initWithRootViewController:viewController];

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = viewController;
[self.window makeKeyAndVisible];
return YES;
}

Expand Down
Loading

0 comments on commit fb4b47e

Please sign in to comment.