Merge branch 'shareext'

* shareext:
  New certs.
  NewsBlur iOS: #1133 (collapsing scrolling)
  iOS: done #1091 (story theme switch)
  iOS: #1135 (privacy policy etc)
This commit is contained in:
Samuel Clay 2018-10-23 23:03:39 -04:00
commit 6dafa586ec
11 changed files with 76 additions and 22 deletions

View file

@ -28,6 +28,7 @@
@property (nonatomic) IBOutlet NSLayoutConstraint *productsHeight;
@property (nonatomic) IBOutlet UILabel *labelTitle;
@property (nonatomic) IBOutlet UILabel *labelSubtitle;
@property (nonatomic) IBOutlet UITextView *policyTextView;
@property (nonatomic) IBOutlet UILabel *labelPremiumTitle;
@property (nonatomic) IBOutlet UILabel *labelPremiumExpire;

View file

@ -57,6 +57,7 @@
self.navigationItem.title = @"NewsBlur Premium";
[self loadProducts];
[self preparePolicyText];
[self updateTheme];
[confettiView setNeedsLayout];
[confettiView startConfetti];
@ -77,6 +78,26 @@
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)preparePolicyText {
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy];
paragraphStyle.alignment = NSTextAlignmentCenter;
NSDictionary *attributes = @{NSParagraphStyleAttributeName : paragraphStyle};
NSMutableAttributedString *policyString = [[NSMutableAttributedString alloc] initWithString:@"See NewsBlur's " attributes:attributes];
NSURL *privacyURL = [NSURL URLWithString:@"https://newsblur.com/privacy/"];
NSURL *termsURL = [NSURL URLWithString:@"https://newsblur.com/tos/"];
NSAttributedString *privacyLink = [[NSAttributedString alloc] initWithString:@"privacy policy"
attributes:@{NSLinkAttributeName : privacyURL}];
NSAttributedString *termsLink = [[NSAttributedString alloc] initWithString:@"terms of use"
attributes:@{NSLinkAttributeName : termsURL}];
[policyString appendAttributedString:privacyLink];
[policyString appendAttributedString:[[NSAttributedString alloc] initWithString:@" and "]];
[policyString appendAttributedString:termsLink];
[policyString appendAttributedString:[[NSAttributedString alloc] initWithString:@" for details."]];
self.policyTextView.attributedText = policyString;
}
- (void)updateTheme {
[super updateTheme];
@ -85,6 +106,9 @@
self.view.backgroundColor = UIColorFromRGB(0xf4f4f4);
self.labelTitle.textColor = UIColorFromRGB(0x0c0c0c);
self.labelSubtitle.textColor = UIColorFromRGB(0x0c0c0c);
self.policyTextView.textColor = UIColorFromRGB(0x0c0c0c);
self.policyTextView.linkTextAttributes = @{NSForegroundColorAttributeName : UIColorFromRGB(NEWSBLUR_LINK_COLOR)};
self.labelPremiumExpire.textColor = UIColorFromRGB(0x0c0c0c);
self.labelPremiumTitle.textColor = UIColorFromRGB(0x0c0c0c);
self.labelPremiumExpire.shadowColor = UIColorFromRGB(0xf4f4f4);

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="ipad9_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
@ -22,6 +22,7 @@
<outlet property="labelPremiumTitle" destination="ueU-QC-PqI" id="cmx-VI-DAg"/>
<outlet property="labelSubtitle" destination="wHV-Eo-ith" id="BeK-G5-G9j"/>
<outlet property="labelTitle" destination="bVF-I1-nis" id="0Eg-04-NaQ"/>
<outlet property="policyTextView" destination="8Fd-TW-WEv" id="Wzk-ve-N9S"/>
<outlet property="premiumView" destination="rCC-u8-EID" id="SRr-a7-DrJ"/>
<outlet property="productsHeight" destination="Gta-B6-eUD" id="nYZ-wi-Pfc"/>
<outlet property="productsTable" destination="0Bc-Oc-gNV" id="9R5-FZ-rK7"/>
@ -39,10 +40,10 @@
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<subviews>
<activityIndicatorView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" animating="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="yBE-Kx-Lyj">
<rect key="frame" x="374" y="167" width="20" height="20"/>
<rect key="frame" x="374" y="203" width="20" height="20"/>
</activityIndicatorView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="fn0-sC-cuM">
<rect key="frame" x="0.0" y="229" width="768" height="795"/>
<rect key="frame" x="0.0" y="265" width="768" height="759"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="dataSource" destination="-1" id="Hc6-OJ-jhm"/>
@ -50,7 +51,7 @@
</connections>
</tableView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" verticalCompressionResistancePriority="1000" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="0Bc-Oc-gNV">
<rect key="frame" x="0.0" y="149" width="768" height="56"/>
<rect key="frame" x="0.0" y="185" width="768" height="56"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="56" id="Gta-B6-eUD"/>
@ -73,24 +74,37 @@
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<textView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" text="See NewsBlur's privacy policy and terms of use for details." textAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="8Fd-TW-WEv">
<rect key="frame" x="24" y="133" width="720" height="32"/>
<constraints>
<constraint firstAttribute="height" constant="32" id="SwW-jM-6Zv"/>
</constraints>
<color key="textColor" red="0.14118" green="0.16078000000000001" blue="0.18038999999999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
<dataDetectorType key="dataDetectorTypes" link="YES"/>
</textView>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="fn0-sC-cuM" secondAttribute="bottom" id="2Bj-WY-sdY"/>
<constraint firstItem="yBE-Kx-Lyj" firstAttribute="centerY" secondItem="0Bc-Oc-gNV" secondAttribute="centerY" id="A3t-Kf-7rY"/>
<constraint firstItem="8Fd-TW-WEv" firstAttribute="top" secondItem="wHV-Eo-ith" secondAttribute="bottom" constant="8" symbolic="YES" id="Fz3-Ah-p88"/>
<constraint firstItem="8Fd-TW-WEv" firstAttribute="leading" secondItem="vys-ne-LmS" secondAttribute="leading" constant="24" id="HYa-XJ-Qky"/>
<constraint firstItem="fn0-sC-cuM" firstAttribute="top" secondItem="0Bc-Oc-gNV" secondAttribute="bottom" constant="24" id="IyC-Dp-Hc0"/>
<constraint firstAttribute="trailing" secondItem="bVF-I1-nis" secondAttribute="trailing" constant="24" id="K2F-Yb-Ka6"/>
<constraint firstAttribute="trailing" secondItem="fn0-sC-cuM" secondAttribute="trailing" id="KUQ-4z-rJQ"/>
<constraint firstAttribute="trailing" secondItem="wHV-Eo-ith" secondAttribute="trailing" constant="24" id="Nfb-a7-jDr"/>
<constraint firstItem="0Bc-Oc-gNV" firstAttribute="top" secondItem="wHV-Eo-ith" secondAttribute="bottom" constant="24" id="Opl-bA-k6v"/>
<constraint firstItem="bVF-I1-nis" firstAttribute="centerX" secondItem="vys-ne-LmS" secondAttribute="centerX" id="Ruc-wE-XRY"/>
<constraint firstItem="0Bc-Oc-gNV" firstAttribute="leading" secondItem="vys-ne-LmS" secondAttribute="leading" id="S26-YV-Bgu"/>
<constraint firstItem="bVF-I1-nis" firstAttribute="top" secondItem="vys-ne-LmS" secondAttribute="top" constant="18" id="XFJ-7c-wws"/>
<constraint firstItem="0Bc-Oc-gNV" firstAttribute="top" secondItem="8Fd-TW-WEv" secondAttribute="bottom" constant="20" id="XYb-d0-Cq6"/>
<constraint firstAttribute="trailing" secondItem="0Bc-Oc-gNV" secondAttribute="trailing" id="ef4-Av-ZlG"/>
<constraint firstItem="yBE-Kx-Lyj" firstAttribute="centerX" secondItem="0Bc-Oc-gNV" secondAttribute="centerX" id="l0s-HJ-wPi"/>
<constraint firstItem="wHV-Eo-ith" firstAttribute="top" secondItem="bVF-I1-nis" secondAttribute="bottom" constant="12" id="qx3-55-Vki"/>
<constraint firstItem="bVF-I1-nis" firstAttribute="leading" secondItem="vys-ne-LmS" secondAttribute="leading" constant="24" id="s7o-bi-uQo"/>
<constraint firstItem="wHV-Eo-ith" firstAttribute="leading" secondItem="vys-ne-LmS" secondAttribute="leading" constant="24" id="v8a-ek-NUU"/>
<constraint firstItem="fn0-sC-cuM" firstAttribute="leading" secondItem="vys-ne-LmS" secondAttribute="leading" id="x3Z-Fi-aVJ"/>
<constraint firstAttribute="trailing" secondItem="8Fd-TW-WEv" secondAttribute="trailing" constant="24" id="y6I-dQ-vaR"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rCC-u8-EID">
@ -100,7 +114,7 @@
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mVi-67-VUL">
<rect key="frame" x="24" y="400" width="720" height="225.5"/>
<rect key="frame" x="24" y="399.5" width="720" height="225.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Thank you for going premium!" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ueU-QC-PqI">
<rect key="frame" x="0.0" y="0.0" width="720" height="51.5"/>

View file

@ -54,6 +54,7 @@ UIActionSheetDelegate> {
- (void)hideNoStoryMessage;
- (void)drawStory;
- (void)drawStory:(BOOL)force withOrientation:(UIInterfaceOrientation)orientation;
- (void)updateStoryTheme;
- (void)drawFeedGradient;
- (void)showStory;
- (void)clearStory;

View file

@ -451,11 +451,7 @@
appDelegate.storiesCollection.isReadView) ?
@"NB-river" : @"NB-non-river";
NSString *themeStyle = [ThemeManager themeManager].themeCSSSuffix;
if (themeStyle.length) {
themeStyle = [NSString stringWithFormat:@"<link rel=\"stylesheet\" type=\"text/css\" href=\"storyDetailView%@.css\">", themeStyle];
}
NSString *themeStyle = [NSString stringWithFormat:@"<link rel=\"stylesheet\" type=\"text/css\" id=\"NB-theme-style\" href=\"storyDetailView%@.css\">", [ThemeManager themeManager].themeCSSSuffix];
// set up layout values based on iPad/iPhone
headerString = [NSString stringWithFormat:@
@ -1749,6 +1745,13 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
[self.webView stringByEvaluatingJavaScriptFromString:jsString];
}
- (void)updateStoryTheme {
NSString *jsString = [NSString stringWithFormat:@"document.getElementById('NB-theme-style').href='storyDetailView%@.css';",
[ThemeManager themeManager].themeCSSSuffix];
[self.webView stringByEvaluatingJavaScriptFromString:jsString];
}
#pragma mark -
#pragma mark Actions

View file

@ -106,7 +106,7 @@
- (void)changeFontSize:(NSString *)fontSize;
- (void)changeLineSpacing:(NSString *)lineSpacing;
- (void)changedScrollOrientation;
- (void)drawStories;
- (void)updateStoriesTheme;
- (void)showShareHUD:(NSString *)msg;
- (void)showFetchingTextNotifier;
- (void)hideNotifier;

View file

@ -628,7 +628,7 @@
[self updateTraverseBackground];
[self setNextPreviousButtons];
[self setTextButton];
[self drawStories];
[self updateStoriesTheme];
}
// allow keyboard comands
@ -1315,10 +1315,10 @@
[self reorientPages];
}
- (void)drawStories {
[self.currentPage drawStory];
[self.nextPage drawStory];
[self.previousPage drawStory];
- (void)updateStoriesTheme {
[self.currentPage updateStoryTheme];
[self.nextPage updateStoryTheme];
[self.previousPage updateStoryTheme];
}
- (void)backToDashboard:(id)sender {

View file

@ -83,7 +83,7 @@ NSString * const ThemeStyleDark = @"dark";
} else if ([theme isEqualToString:ThemeStyleMedium]) {
return @"Medium";
} else {
return @"";
return @"Light";
}
}

View file

@ -32,6 +32,7 @@
17432C831C53438D003F8FD6 /* FeedChooserViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 17432C821C53438D003F8FD6 /* FeedChooserViewController.m */; };
17432C861C5343C0003F8FD6 /* FeedChooserTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 17432C851C5343C0003F8FD6 /* FeedChooserTitleView.m */; };
17432C891C534BC6003F8FD6 /* FeedChooserViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 17432C881C534BC6003F8FD6 /* FeedChooserViewCell.m */; };
1745FABB217E7FD400336F24 /* storyDetailViewLight.css in Resources */ = {isa = PBXBuildFile; fileRef = 1745FABA217E7FD400336F24 /* storyDetailViewLight.css */; };
174939141C251BFE003D98AA /* ShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 174939131C251BFE003D98AA /* ShareViewController.m */; };
174939171C251BFE003D98AA /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 174939151C251BFE003D98AA /* MainInterface.storyboard */; };
1749391B1C251BFE003D98AA /* Share Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 174939101C251BFE003D98AA /* Share Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
@ -658,6 +659,7 @@
17432C851C5343C0003F8FD6 /* FeedChooserTitleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FeedChooserTitleView.m; sourceTree = "<group>"; };
17432C871C534BC6003F8FD6 /* FeedChooserViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FeedChooserViewCell.h; sourceTree = "<group>"; };
17432C881C534BC6003F8FD6 /* FeedChooserViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FeedChooserViewCell.m; sourceTree = "<group>"; };
1745FABA217E7FD400336F24 /* storyDetailViewLight.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; name = storyDetailViewLight.css; path = static/storyDetailViewLight.css; sourceTree = SOURCE_ROOT; };
174939101C251BFE003D98AA /* Share Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Share Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
174939121C251BFE003D98AA /* ShareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareViewController.h; sourceTree = "<group>"; };
174939131C251BFE003D98AA /* ShareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareViewController.m; sourceTree = "<group>"; };
@ -2089,6 +2091,7 @@
isa = PBXGroup;
children = (
FF67D3BD168A708D0057A7DA /* storyDetailView.css */,
1745FABA217E7FD400336F24 /* storyDetailViewLight.css */,
17E265DD1C0D17340060655F /* storyDetailViewDark.css */,
17E57D551C0E592600EB3D4B /* storyDetailViewMedium.css */,
17E57D561C0E592600EB3D4B /* storyDetailViewSepia.css */,
@ -2900,6 +2903,7 @@
43A4BAE215C866FA00F3B8D4 /* popoverArrowRight@2x.png in Resources */,
43A4BAE315C866FA00F3B8D4 /* popoverArrowRightSimple.png in Resources */,
FFC486AF19CA413C00F4758F /* logo_180.png in Resources */,
1745FABB217E7FD400336F24 /* storyDetailViewLight.css in Resources */,
43A4BAE415C866FA00F3B8D4 /* popoverArrowUp.png in Resources */,
1740C68A1C10FD75005EA453 /* theme_color_medium.png in Resources */,
43A4BAE515C866FA00F3B8D4 /* popoverArrowUp@2x.png in Resources */,

View file

@ -1,11 +1,11 @@
<?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" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina3_5" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -31,7 +31,7 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="85">
<rect key="frame" x="0.0" y="0.0" width="320" height="436"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" bouncesZoom="NO" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="8" userLabel="Table View">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" bouncesZoom="NO" style="plain" separatorStyle="none" rowHeight="6" estimatedRowHeight="6" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="8" userLabel="Table View">
<rect key="frame" x="0.0" y="0.0" width="320" height="436"/>
<color key="backgroundColor" cocoaTouchSystemColor="lightTextColor"/>
<connections>

View file

@ -0,0 +1,7 @@
/**
* Light Theme overrides
*/
/**
* None; just provided to enable switching themes via JavaScript.
*/