mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-01 09:50:16 +00:00
Fixes #4716 embeds indicator in add button
Separate activity indicator has been removed and the activity indicator now appears in the add button when it is animating.
This commit is contained in:
2 files changed
+23
-41
No files matched your search
+18
-35
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="24118.1" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina5_9" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24059"/>
|
||||
<capability name="Named colors" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
@@ -104,31 +103,15 @@
|
||||
<action selector="cancel:" destination="7aE-6a-iP7" id="g4H-Mc-Jnh"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
<rightBarButtonItems>
|
||||
<barButtonItem enabled="NO" title="Add" style="done" id="F8z-me-Hnx">
|
||||
<connections>
|
||||
<action selector="add:" destination="7aE-6a-iP7" id="66n-Ea-YXO"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
<barButtonItem id="qP4-8x-XbO">
|
||||
<view key="customView" contentMode="scaleToFill" id="9ct-kH-nAp">
|
||||
<rect key="frame" x="300.33333333333331" y="12" width="20" height="20"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="3ph-Td-s1Z">
|
||||
<rect key="frame" x="0.0" y="0.0" width="20" height="20"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
</activityIndicatorView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</view>
|
||||
</barButtonItem>
|
||||
</rightBarButtonItems>
|
||||
<barButtonItem key="rightBarButtonItem" enabled="NO" title="Add" style="done" id="F8z-me-Hnx">
|
||||
<connections>
|
||||
<action selector="add:" destination="7aE-6a-iP7" id="66n-Ea-YXO"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
</navigationItem>
|
||||
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
|
||||
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
|
||||
<connections>
|
||||
<outlet property="activityIndicator" destination="3ph-Td-s1Z" id="ouh-78-smj"/>
|
||||
<outlet property="addButton" destination="F8z-me-Hnx" id="l1b-UL-238"/>
|
||||
<outlet property="nameTextField" destination="u7n-VL-Ho9" id="YQV-Xq-f9q"/>
|
||||
<outlet property="urlTextField" destination="eRp-AP-WFq" id="FG3-pH-2Fh"/>
|
||||
@@ -144,7 +127,7 @@
|
||||
<objects>
|
||||
<navigationController storyboardIdentifier="AddWebFeedFolderNavViewController" id="WDg-F7-gfk" customClass="ModalNavigationController" customModule="NetNewsWire" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="akM-T1-shZ">
|
||||
<rect key="frame" x="0.0" y="44" width="375" height="44"/>
|
||||
<rect key="frame" x="0.0" y="100" width="375" height="54"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
<connections>
|
||||
@@ -164,14 +147,14 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<prototypes>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="AccountCell" id="bp5-2u-4S4" customClass="AddComboTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="28" width="375" height="43.666667938232422"/>
|
||||
<rect key="frame" x="0.0" y="50" width="375" height="51"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="bp5-2u-4S4" id="9HE-eR-YIp">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="43.666667938232422"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="51"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="CIM-Ah-2kX">
|
||||
<rect key="frame" x="20" y="11" width="22" height="22"/>
|
||||
<rect key="frame" x="20" y="14.666666666666664" width="22" height="22"/>
|
||||
<color key="tintColor" name="secondaryAccentColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="22" id="NwD-N9-OGB"/>
|
||||
@@ -179,7 +162,7 @@
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Account" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZQp-94-vJz">
|
||||
<rect key="frame" x="50" y="11.333333333333336" width="64" height="21"/>
|
||||
<rect key="frame" x="50" y="15" width="64" height="21"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
@@ -199,14 +182,14 @@
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="FolderCell" id="S24-c1-0Ir" customClass="AddComboTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="71.666667938232422" width="375" height="43.666667938232422"/>
|
||||
<rect key="frame" x="0.0" y="101" width="375" height="51"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="S24-c1-0Ir" id="bA3-AB-H1n">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="43.666667938232422"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="51"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="yKC-at-6Jx">
|
||||
<rect key="frame" x="50" y="11" width="22" height="22"/>
|
||||
<rect key="frame" x="50" y="14.666666666666664" width="22" height="22"/>
|
||||
<color key="tintColor" name="secondaryAccentColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="22" id="1B1-qh-G3r"/>
|
||||
@@ -214,7 +197,7 @@
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Folder" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3Tp-A7-7rS">
|
||||
<rect key="frame" x="80" y="11.333333333333336" width="49" height="21"/>
|
||||
<rect key="frame" x="80" y="15" width="49" height="21"/>
|
||||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
@@ -256,7 +239,7 @@
|
||||
<objects>
|
||||
<navigationController storyboardIdentifier="AddWebFeedViewControllerNav" id="4Ej-aI-tUP" sceneMemberID="viewController">
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="Fot-QF-7Rn">
|
||||
<rect key="frame" x="0.0" y="44" width="375" height="44"/>
|
||||
<rect key="frame" x="0.0" y="100" width="375" height="54"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
<connections>
|
||||
@@ -388,7 +371,7 @@
|
||||
<objects>
|
||||
<navigationController storyboardIdentifier="AddFolderViewControllerNav" id="edk-IE-nce" sceneMemberID="viewController">
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="Pi1-Bc-YXQ">
|
||||
<rect key="frame" x="0.0" y="44" width="375" height="44"/>
|
||||
<rect key="frame" x="0.0" y="100" width="375" height="54"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
<connections>
|
||||
|
||||
@@ -14,7 +14,6 @@ import RSParser
|
||||
|
||||
class AddFeedViewController: UITableViewController {
|
||||
|
||||
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
|
||||
@IBOutlet weak var addButton: UIBarButtonItem!
|
||||
@IBOutlet weak var urlTextField: UITextField!
|
||||
@IBOutlet weak var urlTextFieldToSuperViewConstraint: NSLayoutConstraint!
|
||||
@@ -24,6 +23,8 @@ class AddFeedViewController: UITableViewController {
|
||||
|
||||
private var folderLabel = ""
|
||||
private var userCancelled = false
|
||||
|
||||
private let activityIndicator = UIActivityIndicatorView(style: .medium)
|
||||
|
||||
var initialFeed: String?
|
||||
var initialFeedName: String?
|
||||
@@ -33,9 +34,6 @@ class AddFeedViewController: UITableViewController {
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
activityIndicator.isHidden = true
|
||||
activityIndicator.color = .label
|
||||
|
||||
if initialFeed == nil, let urlString = UIPasteboard.general.string {
|
||||
if urlString.mayBeURL {
|
||||
initialFeed = urlString.normalizedURL
|
||||
@@ -100,7 +98,8 @@ class AddFeedViewController: UITableViewController {
|
||||
}
|
||||
|
||||
addButton.isEnabled = false
|
||||
activityIndicator.isHidden = false
|
||||
addButton.customView = activityIndicator
|
||||
addButton.customView?.isHidden = false
|
||||
activityIndicator.startAnimating()
|
||||
|
||||
let feedName = (nameTextField.text?.isEmpty ?? true) ? nil : nameTextField.text
|
||||
@@ -117,8 +116,8 @@ class AddFeedViewController: UITableViewController {
|
||||
NotificationCenter.default.post(name: .UserDidAddFeed, object: self, userInfo: [UserInfoKey.webFeed: feed])
|
||||
case .failure(let error):
|
||||
self.addButton.isEnabled = true
|
||||
self.activityIndicator.isHidden = true
|
||||
self.activityIndicator.stopAnimating()
|
||||
self.addButton.customView = nil
|
||||
self.presentError(error)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user