Fixing iPhone SE size issues. Also fixing crash when story url is empty.

This commit is contained in:
Samuel Clay 2017-05-05 20:29:44 -07:00
parent 3dad4bbaa1
commit 84bc355acd
5 changed files with 35 additions and 22 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.newsblur"
android:versionCode="137"
android:versionCode="138"
android:versionName="5.2.0b3" >
<uses-sdk

View file

@ -1638,6 +1638,19 @@
- (void)showOriginalStory:(NSURL *)url {
NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults];
if (!url) {
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Nowhere to go"
message:@"The story doesn't link anywhere."
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"Oh well" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {}];
[alert addAction:defaultAction];
[navigationController presentViewController:alert animated:YES completion:nil];
return;
}
NSString *storyBrowser = [preferences stringForKey:@"story_browser"];
if ([storyBrowser isEqualToString:@"safari"]) {
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];

View file

@ -375,10 +375,10 @@ static UIFont *userLabelFont;
[self.intelligenceControl setImage:[UIImage imageNamed:@"unread_green.png"] forSegmentAtIndex:2];
[self.intelligenceControl setImage:[UIImage imageNamed:@"unread_blue.png"] forSegmentAtIndex:3];
[self.intelligenceControl setWidth:52 forSegmentAtIndex:0];
[self.intelligenceControl setWidth:40 forSegmentAtIndex:0];
[self.intelligenceControl setWidth:68 forSegmentAtIndex:1];
[self.intelligenceControl setWidth:62 forSegmentAtIndex:2];
[self.intelligenceControl setWidth:62 forSegmentAtIndex:3];
[self.intelligenceControl setWidth:60 forSegmentAtIndex:3];
}
[self.intelligenceControl sizeToFit];

View file

@ -43,8 +43,8 @@
[self.filterControl setTitle:@"Focus Stories" forSegmentAtIndex:1];
[self.filterControl setImage:[UIImage imageNamed:@"unread_yellow.png"] forSegmentAtIndex:0];
[self.filterControl setImage:[UIImage imageNamed:@"unread_green.png"] forSegmentAtIndex:1];
[self.filterControl setWidth:CGRectGetWidth(self.frame)*0.46 forSegmentAtIndex:0];
[self.filterControl setWidth:CGRectGetWidth(self.frame)*0.46 forSegmentAtIndex:1];
[self.filterControl setWidth:CGRectGetWidth(self.frame)*0.44 forSegmentAtIndex:0];
[self.filterControl setWidth:CGRectGetWidth(self.frame)*0.44 forSegmentAtIndex:1];
[self.filterControl setTitleTextAttributes:controlAttrs forState:UIControlStateNormal];
self.filterControl.frame = CGRectMake(36, 38, CGRectGetWidth(self.frame), 28);
[self.contentView addSubview:self.filterControl];
@ -63,10 +63,10 @@
[self.notificationTypeControl setTitle:@"Web" forSegmentAtIndex:1];
[self.notificationTypeControl setTitle:@"iOS" forSegmentAtIndex:2];
[self.notificationTypeControl setTitle:@"Android" forSegmentAtIndex:3];
[self.notificationTypeControl setWidth:CGRectGetWidth(self.frame)*0.23 forSegmentAtIndex:0];
[self.notificationTypeControl setWidth:CGRectGetWidth(self.frame)*0.23 forSegmentAtIndex:1];
[self.notificationTypeControl setWidth:CGRectGetWidth(self.frame)*0.23 forSegmentAtIndex:2];
[self.notificationTypeControl setWidth:CGRectGetWidth(self.frame)*0.23 forSegmentAtIndex:3];
[self.notificationTypeControl setWidth:CGRectGetWidth(self.frame)*0.22 forSegmentAtIndex:0];
[self.notificationTypeControl setWidth:CGRectGetWidth(self.frame)*0.22 forSegmentAtIndex:1];
[self.notificationTypeControl setWidth:CGRectGetWidth(self.frame)*0.22 forSegmentAtIndex:2];
[self.notificationTypeControl setWidth:CGRectGetWidth(self.frame)*0.22 forSegmentAtIndex:3];
[self.notificationTypeControl setTitleTextAttributes:controlAttrs forState:UIControlStateNormal];
self.notificationTypeControl.frame = CGRectMake(36, 76, CGRectGetWidth(self.frame), 28);
[self.contentView addSubview:self.notificationTypeControl];

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11542" systemVersion="16B2555" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" colorMatched="YES">
<device id="retina3_5" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@ -23,15 +23,15 @@
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="6">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" id="85">
<rect key="frame" x="0.0" y="0.0" width="375" height="623"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="436"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" bouncesZoom="NO" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="8" userLabel="Table View">
<rect key="frame" x="0.0" y="0.0" width="375" height="623"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="436"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="lightTextColor"/>
<connections>
@ -40,7 +40,7 @@
</connections>
</tableView>
<view hidden="YES" opaque="NO" contentMode="scaleToFill" id="122">
<rect key="frame" x="108" y="222" width="159" height="195"/>
<rect key="frame" x="92" y="125" width="136" height="195"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="You have no unread stories in Focus mode." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="123">
@ -58,7 +58,7 @@
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" alpha="0.40000000596046448" contentMode="scaleToFill" image="big_world.png" id="125">
<rect key="frame" x="48" y="27" width="64" height="64"/>
<rect key="frame" x="36.5" y="27" width="64" height="64"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
</subviews>
@ -68,7 +68,7 @@
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<toolbar clearsContextBeforeDrawing="NO" contentMode="scaleToFill" translucent="NO" id="11">
<rect key="frame" x="0.0" y="623" width="375" height="44"/>
<rect key="frame" x="0.0" y="436" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<items>
<barButtonItem enabled="NO" width="34" style="plain" id="106">
@ -78,11 +78,11 @@
</barButtonItem>
<barButtonItem style="plain" systemItem="flexibleSpace" id="104"/>
<barButtonItem id="56">
<segmentedControl key="customView" contentMode="center" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" id="55">
<rect key="frame" x="91" y="8" width="192" height="29"/>
<segmentedControl key="customView" contentMode="center" contentHorizontalAlignment="left" contentVerticalAlignment="top" apportionsSegmentWidthsByContent="YES" segmentControlStyle="plain" selectedSegmentIndex="0" id="55">
<rect key="frame" x="64" y="7.5" width="192" height="29"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<segments>
<segment title="" image="all.png"/>
<segment title="" image="all.png" width="36"/>
<segment title="" image="unread_yellow.png"/>
<segment title="" image="unread_green.png"/>
<segment title="" image="unread_blue.png"/>
@ -118,6 +118,6 @@
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4_7.fullscreen"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>