Browse Source

Misc fixes

master
Dwayne Harris 6 years ago
parent
commit
ec09d0886c
  1. 7
      elpha-ios/AbstractStatusTableViewController.swift
  2. 4
      elpha-ios/AccountTableViewController.swift
  3. 23
      elpha-ios/Base.lproj/Main.storyboard
  4. 8
      elpha-ios/StatusTableViewController.swift
  5. 24
      elpha-ios/TimelineTableViewController.swift
  6. 7
      elpha-ios/UIImageView+Effects.swift

7
elpha-ios/AbstractStatusTableViewController.swift

@ -16,7 +16,6 @@ protocol AbstractStatusTableViewCell {
class AbstractStatusTableViewController: UITableViewController, StatusViewDelegate { class AbstractStatusTableViewController: UITableViewController, StatusViewDelegate {
let fetchLimit = 20 let fetchLimit = 20
var currentPaginationContext: String = ""
var fetchedResultsController: NSFetchedResultsController<StatusMO>? = nil var fetchedResultsController: NSFetchedResultsController<StatusMO>? = nil
var loading: Bool = false { var loading: Bool = false {
@ -31,6 +30,12 @@ class AbstractStatusTableViewController: UITableViewController, StatusViewDelega
} }
} }
var currentPaginationContext: String {
get {
return ""
}
}
func storyboard() -> UIStoryboard { func storyboard() -> UIStoryboard {
return UIStoryboard(name: "Main", bundle: nil) return UIStoryboard(name: "Main", bundle: nil)
} }

4
elpha-ios/AccountTableViewController.swift

@ -86,10 +86,6 @@ class AccountTableViewController: AbstractStatusTableViewController {
return "account:\(account.acct!):\(statusTypeSegmentedControl.selectedSegmentIndex)" return "account:\(account.acct!):\(statusTypeSegmentedControl.selectedSegmentIndex)"
} }
set {
}
} }
@IBAction func statusTypeChanged(_ sender: UISegmentedControl) { @IBAction func statusTypeChanged(_ sender: UISegmentedControl) {

23
elpha-ios/Base.lproj/Main.storyboard

@ -1354,15 +1354,15 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<prototypes> <prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="MainStatusTableViewCell" rowHeight="750" id="8ys-Fm-1Yg" customClass="MainStatusTableViewCell" customModule="elpha_ios" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="375" height="750"/>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="MainStatusTableViewCell" rowHeight="735" id="8ys-Fm-1Yg" customClass="MainStatusTableViewCell" customModule="elpha_ios" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="375" height="735"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="8ys-Fm-1Yg" id="Hj7-kC-H7L"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="8ys-Fm-1Yg" id="Hj7-kC-H7L">
<rect key="frame" x="0.0" y="0.0" width="375" height="750"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="735"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="hBh-J5-s0Y"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="hBh-J5-s0Y">
<rect key="frame" x="0.0" y="0.0" width="375" height="750"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="735"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="D1b-xI-QXf"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="D1b-xI-QXf">
<rect key="frame" x="0.0" y="0.0" width="375" height="60"/> <rect key="frame" x="0.0" y="0.0" width="375" height="60"/>
@ -1424,10 +1424,10 @@
</connections> </connections>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bsb-4z-qCl"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bsb-4z-qCl">
<rect key="frame" x="0.0" y="150" width="375" height="55"/>
<rect key="frame" x="0.0" y="150" width="375" height="40"/>
<subviews> <subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" editable="NO" text="Content" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="Qno-L9-nUh" customClass="UITextViewFixed" customModule="elpha_ios" customModuleProvider="target"> <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" editable="NO" text="Content" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="Qno-L9-nUh" customClass="UITextViewFixed" customModule="elpha_ios" customModuleProvider="target">
<rect key="frame" x="8" y="8" width="359" height="39"/>
<rect key="frame" x="8" y="8" width="359" height="24"/>
<color key="backgroundColor" name="Background Primary"/> <color key="backgroundColor" name="Background Primary"/>
<color key="tintColor" name="Primary"/> <color key="tintColor" name="Primary"/>
<color key="textColor" name="Text"/> <color key="textColor" name="Text"/>
@ -1438,7 +1438,6 @@
</subviews> </subviews>
<color key="backgroundColor" name="Background Primary"/> <color key="backgroundColor" name="Background Primary"/>
<constraints> <constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="20" id="18i-Gd-cbz"/>
<constraint firstAttribute="bottom" secondItem="Qno-L9-nUh" secondAttribute="bottom" constant="8" id="M8W-95-H1q"/> <constraint firstAttribute="bottom" secondItem="Qno-L9-nUh" secondAttribute="bottom" constant="8" id="M8W-95-H1q"/>
<constraint firstItem="Qno-L9-nUh" firstAttribute="top" secondItem="bsb-4z-qCl" secondAttribute="top" constant="8" id="QpL-s9-Tq7"/> <constraint firstItem="Qno-L9-nUh" firstAttribute="top" secondItem="bsb-4z-qCl" secondAttribute="top" constant="8" id="QpL-s9-Tq7"/>
<constraint firstItem="Qno-L9-nUh" firstAttribute="leading" secondItem="bsb-4z-qCl" secondAttribute="leading" constant="8" id="TNL-xL-hoM"/> <constraint firstItem="Qno-L9-nUh" firstAttribute="leading" secondItem="bsb-4z-qCl" secondAttribute="leading" constant="8" id="TNL-xL-hoM"/>
@ -1446,14 +1445,14 @@
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7SO-v5-Rfd"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7SO-v5-Rfd">
<rect key="frame" x="0.0" y="205" width="375" height="375"/>
<rect key="frame" x="0.0" y="190" width="375" height="375"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="width" secondItem="7SO-v5-Rfd" secondAttribute="height" multiplier="1:1" id="OxV-Aa-cex"/> <constraint firstAttribute="width" secondItem="7SO-v5-Rfd" secondAttribute="height" multiplier="1:1" id="OxV-Aa-cex"/>
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HzB-eP-8UY"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HzB-eP-8UY">
<rect key="frame" x="0.0" y="580" width="375" height="60"/>
<rect key="frame" x="0.0" y="565" width="375" height="60"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="C8A-x8-8TG"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="C8A-x8-8TG">
<rect key="frame" x="8" y="13.666666666666629" width="160" height="33"/> <rect key="frame" x="8" y="13.666666666666629" width="160" height="33"/>
@ -1601,7 +1600,7 @@
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lfq-fs-5DV"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lfq-fs-5DV">
<rect key="frame" x="0.0" y="640" width="375" height="50"/>
<rect key="frame" x="0.0" y="625" width="375" height="50"/>
<subviews> <subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mux-Se-p9C"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mux-Se-p9C">
<rect key="frame" x="180.66666666666666" y="16" width="14" height="18"/> <rect key="frame" x="180.66666666666666" y="16" width="14" height="18"/>
@ -1626,7 +1625,7 @@
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mSb-NY-H82"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mSb-NY-H82">
<rect key="frame" x="0.0" y="690" width="375" height="60"/>
<rect key="frame" x="0.0" y="675" width="375" height="60"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Replies" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LcE-Gx-SAh"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Replies" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LcE-Gx-SAh">
<rect key="frame" x="15" y="8" width="352" height="52"/> <rect key="frame" x="15" y="8" width="352" height="52"/>
@ -1674,7 +1673,7 @@
</connections> </connections>
</tableViewCell> </tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="StatusTableViewCell" rowHeight="120" id="cLF-Rc-b4K" customClass="StatusTableViewCell" customModule="elpha_ios" customModuleProvider="target"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="StatusTableViewCell" rowHeight="120" id="cLF-Rc-b4K" customClass="StatusTableViewCell" customModule="elpha_ios" customModuleProvider="target">
<rect key="frame" x="0.0" y="778" width="375" height="120"/>
<rect key="frame" x="0.0" y="763" width="375" height="120"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="cLF-Rc-b4K" id="jhE-cB-Cj1"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="cLF-Rc-b4K" id="jhE-cB-Cj1">
<rect key="frame" x="0.0" y="0.0" width="375" height="120"/> <rect key="frame" x="0.0" y="0.0" width="375" height="120"/>

8
elpha-ios/StatusTableViewController.swift

@ -14,7 +14,6 @@ import SafariServices
class StatusTableViewController: AbstractStatusTableViewController, UIGestureRecognizerDelegate { class StatusTableViewController: AbstractStatusTableViewController, UIGestureRecognizerDelegate {
public var status: StatusMO? = nil public var status: StatusMO? = nil
var feedbackGenerator: UINotificationFeedbackGenerator? = nil var feedbackGenerator: UINotificationFeedbackGenerator? = nil
var mainStatusIndexPath: IndexPath? = nil
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
@ -32,9 +31,9 @@ class StatusTableViewController: AbstractStatusTableViewController, UIGestureRec
@objc func fetch() { @objc func fetch() {
fetchStatuses { error in fetchStatuses { error in
if error == nil { if error == nil {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
if let mainStatusIndexPath = self.mainStatusIndexPath {
self.tableView.scrollToRow(at: mainStatusIndexPath, at: .top, animated: true)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
if let indexPath = self.fetchedResultsController?.indexPath(forObject: self.status!) {
self.tableView.scrollToRow(at: indexPath, at: .top, animated: true)
} }
} }
} else { } else {
@ -204,7 +203,6 @@ class StatusTableViewController: AbstractStatusTableViewController, UIGestureRec
return return
} }
mainStatusIndexPath = indexPath
cell.avatarImageView.setRoundedCorners() cell.avatarImageView.setRoundedCorners()
func updateAccountView(status: StatusMO) { func updateAccountView(status: StatusMO) {

24
elpha-ios/TimelineTableViewController.swift

@ -21,22 +21,18 @@ class TimelineTableViewController: AbstractStatusTableViewController {
} }
switch TimelineCategory(rawValue: categoryString)! { switch TimelineCategory(rawValue: categoryString)! {
case .home:
return "timeline:home"
case .local:
return "timeline:local"
case .federated:
return "timeline:federated"
case .tag:
return "timeline:tag:\(timeline.subcategory!)"
case .favorites:
return "timeline:favorites"
case .home:
return "timeline:home"
case .local:
return "timeline:local"
case .federated:
return "timeline:federated"
case .tag:
return "timeline:tag:\(timeline.subcategory!)"
case .favorites:
return "timeline:favorites"
} }
} }
set {
}
} }
override func viewDidLoad() { override func viewDidLoad() {

7
elpha-ios/UIImageView+Effects.swift

@ -9,12 +9,7 @@
import UIKit import UIKit
extension UIImageView { extension UIImageView {
func setShadow() {
self.layer.shadowColor = UIColor(white: 0.0, alpha: 0.5).cgColor
self.layer.shadowOpacity = 1
self.layer.shadowOffset = CGSize.zero
self.layer.shadowRadius = 10
}
func setShadow() {}
func setRoundedCorners() { func setRoundedCorners() {
self.layer.cornerRadius = 10 self.layer.cornerRadius = 10

Loading…
Cancel
Save