Skip to content

Commit

Permalink
Fixed ObjectiveC APIDemo custom playback controls issue.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 676606721
  • Loading branch information
nventimigli authored and copybara-github committed Oct 11, 2024
1 parent 6908d41 commit e02082e
Show file tree
Hide file tree
Showing 19 changed files with 281 additions and 172 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
1CD352992C9CE6A600534FCC /* CustomControls.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1CD352982C9CE6A600534FCC /* CustomControls.xib */; };
4A96E7211B856D5000031470 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A96E7201B856D5000031470 /* main.m */; };
4A96E7241B856D5000031470 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A96E7231B856D5000031470 /* AppDelegate.m */; };
4A96E72D1B856D5000031470 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4A96E72B1B856D5000031470 /* Main.storyboard */; };
Expand All @@ -32,6 +33,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
1CD352982C9CE6A600534FCC /* CustomControls.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CustomControls.xib; sourceTree = "<group>"; };
4A96E71B1B856D5000031470 /* APIDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = APIDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
4A96E71F1B856D5000031470 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4A96E7201B856D5000031470 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -169,6 +171,7 @@
AEE8DA9A201BD788008792E6 /* GAMCustomVideoControls */ = {
isa = PBXGroup;
children = (
1CD352982C9CE6A600534FCC /* CustomControls.xib */,
50DC0CEA212F1C2D00424CC7 /* GAMCustomVideoControlsController.h */,
50DC0CEB212F1C2D00424CC7 /* GAMCustomVideoControlsController.m */,
AEE8DA9C201BD7A5008792E6 /* SimpleNativeAdView.h */,
Expand Down Expand Up @@ -243,6 +246,7 @@
4A96E72D1B856D5000031470 /* Main.storyboard in Resources */,
4A96E7321B856D5000031470 /* LaunchScreen.xib in Resources */,
4A96E72F1B856D5000031470 /* Images.xcassets in Resources */,
1CD352992C9CE6A600534FCC /* CustomControls.xib in Resources */,
AED1111020320CA900EA4BEE /* NativeAdView.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
107 changes: 21 additions & 86 deletions Objective-C/advanced/APIDemo/APIDemo/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions Objective-C/advanced/APIDemo/APIDemo/Base.lproj/NativeAdView.xib
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23089" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment version="2048" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23077"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand Down Expand Up @@ -40,20 +40,21 @@
<nil key="highlightedColor"/>
</label>
<button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="E5w-YA-UY8">
<rect key="frame" x="318" y="229" width="47" height="34"/>
<rect key="frame" x="318" y="259" width="47" height="34"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<state key="normal" title="Install">
<color key="titleColor" red="0.016804177310000001" green="0.19835099580000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Price" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ysb-of-cat">
<rect key="frame" x="230" y="237.5" width="33" height="17"/>
<rect key="frame" x="230" y="267.5" width="33" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" systemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Store" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hwF-UL-Q8H">
<rect key="frame" x="273" y="237.5" width="35" height="17"/>
<rect key="frame" x="273" y="267.5" width="35" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" systemColor="darkTextColor"/>
<nil key="highlightedColor"/>
Expand All @@ -68,10 +69,10 @@
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleAspectFit" translatesAutoresizingMaskIntoConstraints="NO" id="fNp-yu-K4i" customClass="GADMediaView">
<rect key="frame" x="87.5" y="102" width="200" height="120"/>
<rect key="frame" x="62.5" y="102" width="250" height="150"/>
<constraints>
<constraint firstAttribute="width" priority="999" constant="200" id="e3T-fD-di4"/>
<constraint firstAttribute="height" priority="999" constant="120" placeholder="YES" id="f4C-60-tvt"/>
<constraint firstAttribute="width" priority="999" constant="250" id="e3T-fD-di4"/>
<constraint firstAttribute="height" priority="999" constant="150" placeholder="YES" id="f4C-60-tvt"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Ad" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lp1-oz-XOs">
Expand Down Expand Up @@ -104,13 +105,13 @@
<constraint firstItem="beR-eV-DX1" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="Mvs-eV-Wzb"/>
<constraint firstItem="Ysb-of-cat" firstAttribute="centerY" secondItem="hwF-UL-Q8H" secondAttribute="centerY" id="Rud-i8-Myz"/>
<constraint firstItem="fNp-yu-K4i" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="TYN-lq-3DK"/>
<constraint firstItem="Ysb-of-cat" firstAttribute="top" secondItem="fNp-yu-K4i" secondAttribute="bottom" constant="15.5" id="TwW-Pe-AvQ"/>
<constraint firstItem="fNp-yu-K4i" firstAttribute="top" secondItem="PEQ-D9-2Vv" secondAttribute="bottom" constant="5" id="V0m-hf-6NS"/>
<constraint firstItem="GTT-Yh-eSq" firstAttribute="centerY" secondItem="2Of-AP-0h9" secondAttribute="centerY" id="YgR-kp-age"/>
<constraint firstItem="hwF-UL-Q8H" firstAttribute="leading" secondItem="Ysb-of-cat" secondAttribute="trailing" constant="10" id="aLb-sm-wAb"/>
<constraint firstAttribute="right" relation="greaterThanOrEqual" secondItem="lp1-oz-XOs" secondAttribute="right" constant="20" symbolic="YES" id="czi-qD-IaJ"/>
<constraint firstAttribute="trailing" secondItem="E5w-YA-UY8" secondAttribute="trailing" constant="10" id="eNM-dN-tvx"/>
<constraint firstItem="E5w-YA-UY8" firstAttribute="leading" secondItem="hwF-UL-Q8H" secondAttribute="trailing" constant="10" id="f39-vH-KWq"/>
<constraint firstItem="Ysb-of-cat" firstAttribute="top" secondItem="fNp-yu-K4i" secondAttribute="bottom" constant="15.5" id="g05-rC-22O"/>
<constraint firstItem="iNa-bH-h1m" firstAttribute="leading" secondItem="PEQ-D9-2Vv" secondAttribute="leading" id="mof-5F-8vM"/>
<constraint firstItem="E5w-YA-UY8" firstAttribute="centerY" secondItem="hwF-UL-Q8H" secondAttribute="centerY" id="rNj-VY-YrO"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="E5w-YA-UY8" secondAttribute="bottom" constant="20" symbolic="YES" id="uEI-XT-igi"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23089" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23077"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand All @@ -19,21 +16,21 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="375" placeholderIntrinsicHeight="24" text="Headline" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EJ7-Y2-nrO">
<rect key="frame" x="5" y="5" width="365" height="24"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" systemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hoj-tc-K51">
<rect key="frame" x="101.5" y="39" width="171" height="100"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hoj-tc-K51" customClass="NativeAdView" customModule="APIDemo" customModuleProvider="target">
<rect key="frame" x="84.5" y="39" width="206" height="120"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="Z4E-2z-qz3"/>
<constraint firstAttribute="height" constant="120" id="Z4E-2z-qz3"/>
<constraint firstAttribute="width" secondItem="hoj-tc-K51" secondAttribute="height" multiplier="12:7" id="fAh-as-Khc"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Caption" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Opb-BT-xiP">
<rect key="frame" x="5" y="149" width="365" height="17"/>
<rect key="frame" x="5" y="169" width="365" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" systemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
Expand All @@ -49,11 +46,16 @@
<constraint firstAttribute="trailing" secondItem="Opb-BT-xiP" secondAttribute="trailing" constant="5" id="WYZ-v6-Hph"/>
</constraints>
<connections>
<outlet property="captionView" destination="Opb-BT-xiP" id="hSg-rU-Z7U"/>
<outlet property="headlineView" destination="EJ7-Y2-nrO" id="BKi-kL-8EA"/>
<outlet property="mainPlaceholder" destination="hoj-tc-K51" id="pmf-nl-x4R"/>
<outlet property="captionView" destination="Opb-BT-xiP" id="JQy-dl-IMG"/>
<outlet property="headlineView" destination="EJ7-Y2-nrO" id="dDU-Lq-0zL"/>
<outlet property="mainPlaceholder" destination="hoj-tc-K51" id="Rho-nb-5UT"/>
</connections>
<point key="canvasLocation" x="13" y="27"/>
<point key="canvasLocation" x="20.800000000000001" y="24.287856071964018"/>
</view>
</objects>
<resources>
<systemColor name="darkTextColor">
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
63 changes: 63 additions & 0 deletions Objective-C/advanced/APIDemo/APIDemo/CustomControls.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23089" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23077"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clipsSubviews="YES" contentMode="scaleToFill" placeholderIntrinsicWidth="63" placeholderIntrinsicHeight="34" translatesAutoresizingMaskIntoConstraints="NO" id="hcJ-K0-VFO" customClass="CustomControlsView">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<subviews>
<view contentMode="scaleToFill" fixedFrame="YES" placeholderIntrinsicWidth="63" placeholderIntrinsicHeight="34" translatesAutoresizingMaskIntoConstraints="NO" id="pao-J4-Vnr" userLabel="Controls Inner View">
<rect key="frame" x="0.0" y="0.0" width="63" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleAspectFit" fixedFrame="YES" preservesSuperviewLayoutMargins="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="45d-iM-MBo">
<rect key="frame" x="5" y="5" width="24" height="24"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" button="YES" image="YES"/>
</accessibility>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="video_pause"/>
<connections>
<action selector="playPause:" destination="hcJ-K0-VFO" eventType="touchUpInside" id="0CB-eL-LvM"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleAspectFit" fixedFrame="YES" preservesSuperviewLayoutMargins="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="EeV-x8-pU7">
<rect key="frame" x="34" y="5" width="24" height="24"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" button="YES" image="YES"/>
</accessibility>
<state key="normal" image="video_mute"/>
<connections>
<action selector="muteUnmute:" destination="hcJ-K0-VFO" eventType="touchUpInside" id="WHq-Bk-O5c"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.79650297619047616" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="34" id="UmE-7W-Sbr"/>
<constraint firstAttribute="width" constant="63" id="nll-Ck-Ktr"/>
</constraints>
<edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
<connections>
<outlet property="controlsView" destination="pao-J4-Vnr" id="u9k-TG-zXG"/>
<outlet property="muteButton" destination="EeV-x8-pU7" id="3ms-b3-3dN"/>
<outlet property="playButton" destination="45d-iM-MBo" id="3aL-mq-Onh"/>
</connections>
<point key="canvasLocation" x="-180" y="-635"/>
</view>
</objects>
<resources>
<image name="video_mute" width="96" height="96"/>
<image name="video_pause" width="96" height="96"/>
</resources>
</document>
Loading

0 comments on commit e02082e

Please sign in to comment.