Fix the LoadingFrameViewController not display on top of other content on tvOS

Also remove hacks that were put in place due to this bug previously.
This commit is contained in:
Cameron Gutman
2020-04-19 14:40:39 -07:00
parent 084018719a
commit 3cca55703e
2 changed files with 9 additions and 13 deletions

View File

@@ -827,7 +827,7 @@ static NSMutableSet* hostList;
}
#endif
-(void)beginForegroundRefresh:(bool)refreshAppList
-(void)beginForegroundRefresh
{
if (!_background) {
// This will kick off box art caching
@@ -838,7 +838,7 @@ static NSMutableSet* hostList;
[_discMan startDiscovery];
// This will refresh the applist when a paired host is selected
if (refreshAppList && _selectedHost != nil && _selectedHost.pairState == PairStatePaired) {
if (_selectedHost != nil && _selectedHost.pairState == PairStatePaired) {
[self hostClicked:_selectedHost view:nil];
}
}
@@ -878,7 +878,7 @@ static NSMutableSet* hostList;
{
_background = NO;
[self beginForegroundRefresh: YES];
[self beginForegroundRefresh];
// Check for a pending shortcut action when returning to foreground
[self handlePendingShortcutAction];
@@ -935,12 +935,7 @@ static NSMutableSet* hostList;
// this view via an error dialog from the stream
// view, so we won't get a return to active notification
// for that which would normally fire beginForegroundRefresh.
//
// On tvOS, we'll get a viewWillAppear when returning from the
// loading frame which will cause an infinite loop by starting
// another loading frame. To avoid this, just don't refresh
// if we're coming back from a loading frame view.
[self beginForegroundRefresh: !([_loadingFrame isShown] || [_loadingFrame isBeingDismissed])];
[self beginForegroundRefresh];
}
- (void)viewDidDisappear:(BOOL)animated

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder.AppleTV.Storyboard" version="3.0" toolsVersion="14868" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="pui-7y-JNH">
<document type="com.apple.InterfaceBuilder.AppleTV.Storyboard" version="3.0" toolsVersion="16096" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="pui-7y-JNH">
<device id="appleTV" appearance="dark"/>
<dependencies>
<deployment identifier="tvOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@@ -73,12 +73,12 @@
<!--Loading Frame View Controller-->
<scene sceneID="lqn-qp-p7w">
<objects>
<viewController storyboardIdentifier="loadingFrame" id="Ap5-6u-5Wo" customClass="LoadingFrameViewController" sceneMemberID="viewController">
<viewController storyboardIdentifier="loadingFrame" modalTransitionStyle="crossDissolve" modalPresentationStyle="overCurrentContext" id="Ap5-6u-5Wo" customClass="LoadingFrameViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="AfI-ck-OwD"/>
<viewControllerLayoutGuide type="bottom" id="DNo-dy-ucM"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="TIa-HJ-DIv">
<view key="view" clearsContextBeforeDrawing="NO" contentMode="center" id="TIa-HJ-DIv">
<rect key="frame" x="0.0" y="0.0" width="1920" height="1080"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
@@ -87,6 +87,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</activityIndicatorView>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="3xZ-qb-ZmB"/>
</view>
<connections>