#817 (three column layout)

- iPhone layout fixes.
This commit is contained in:
David Sinclair 2020-12-24 16:20:22 -08:00
parent 99f9a28368
commit b759cfe3b7
3 changed files with 21 additions and 1 deletions

View file

@ -592,6 +592,8 @@
self.currentlyTogglingNavigationBar = NO;
[self updateStatusBarState];
}];
[self adjustForAutoscroll];
}
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
@ -690,6 +692,10 @@
@throw [NSException exceptionWithName:@"Missing -resetOtherStoryControllers implementation" reason:@"This is implemented in the Swift subclass, so should never reach here." userInfo:nil];
}
- (void)adjustForAutoscroll {
@throw [NSException exceptionWithName:@"Missing -adjustForAutoscroll: implementation" reason:@"This is implemented in the Swift subclass, so should never reach here." userInfo:nil];
}
- (void)hidePages {
[self resetOtherStoryControllers];
}

View file

@ -110,6 +110,9 @@ class DetailViewController: DetailObjCViewController {
/// Bottom container view.
@IBOutlet weak var bottomContainerView: UIView!
/// Top container view top constraint. May need to adjust this for fullscreen on iPhone.
@IBOutlet weak var topContainerTopConstraint: NSLayoutConstraint!
/// Bottom constraint of the divider view.
@IBOutlet weak var dividerViewBottomConstraint: NSLayoutConstraint!
@ -207,6 +210,14 @@ class DetailViewController: DetailObjCViewController {
appDelegate.feedsViewController.loadOfflineFeeds(false)
}
@objc func adjustForAutoscroll() {
if UIDevice.current.userInterfaceIdiom == .phone, !isNavigationBarHidden {
topContainerTopConstraint.constant = -44
} else {
topContainerTopConstraint.constant = 0
}
}
override func viewDidLoad() {
super.viewDidLoad()
@ -307,6 +318,8 @@ private extension DetailViewController {
if horizontalPageViewController?.view.superview != appropriateSuperview {
add(viewController: horizontalPageViewController, top: !isTop)
adjustForAutoscroll()
if isTop {
bottomContainerView.addSubview(traverseView)
bottomContainerView.addSubview(autoscrollView)

View file

@ -13,7 +13,7 @@
<objects>
<viewController storyboardIdentifier="DetailViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="djW-7k-haK" customClass="DetailViewController" customModule="NewsBlur" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jTZ-4O-xyT">
<rect key="frame" x="0.0" y="0.0" width="818.5" height="834"/>
<rect key="frame" x="0.0" y="0.0" width="1194" height="834"/>
<subviews>
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bPa-u1-Aml">
<rect key="frame" x="0.0" y="50" width="1194" height="604"/>
@ -366,6 +366,7 @@
<outlet property="loadingIndicator" destination="wpt-1g-x7w" id="6Re-nf-bHo"/>
<outlet property="prevNextBackgroundImageView" destination="PLd-RZ-773" id="adi-Gt-uX1"/>
<outlet property="textStorySendBackgroundImageView" destination="zfl-mN-y0T" id="lD1-7s-izZ"/>
<outlet property="topContainerTopConstraint" destination="JN4-aj-xiN" id="BFs-GY-GpX"/>
<outlet property="topContainerView" destination="bPa-u1-Aml" id="nUk-aR-0ix"/>
<outlet property="traverseBottomContainerBottomConstraint" destination="efm-qO-UF1" id="cEE-UD-KiD"/>
<outlet property="traverseTopContainerBottomConstraint" destination="YVh-UJ-d3j" id="d4B-Vw-6hb"/>