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

4
elpha-ios/AccountTableViewController.swift

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

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

@ -1354,15 +1354,15 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<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"/>
<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"/>
<subviews>
<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>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="D1b-xI-QXf">
<rect key="frame" x="0.0" y="0.0" width="375" height="60"/>
@ -1424,10 +1424,10 @@
</connections>
</view>
<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>
<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="tintColor" name="Primary"/>
<color key="textColor" name="Text"/>
@ -1438,7 +1438,6 @@
</subviews>
<color key="backgroundColor" name="Background Primary"/>
<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 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"/>
@ -1446,14 +1445,14 @@
</constraints>
</view>
<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"/>
<constraints>
<constraint firstAttribute="width" secondItem="7SO-v5-Rfd" secondAttribute="height" multiplier="1:1" id="OxV-Aa-cex"/>
</constraints>
</view>
<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>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="C8A-x8-8TG">
<rect key="frame" x="8" y="13.666666666666629" width="160" height="33"/>
@ -1601,7 +1600,7 @@
</constraints>
</view>
<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>
<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"/>
@ -1626,7 +1625,7 @@
</constraints>
</view>
<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>
<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"/>
@ -1674,7 +1673,7 @@
</connections>
</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">
<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"/>
<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"/>

8
elpha-ios/StatusTableViewController.swift

@ -14,7 +14,6 @@ import SafariServices
class StatusTableViewController: AbstractStatusTableViewController, UIGestureRecognizerDelegate {
public var status: StatusMO? = nil
var feedbackGenerator: UINotificationFeedbackGenerator? = nil
var mainStatusIndexPath: IndexPath? = nil
override func viewDidLoad() {
super.viewDidLoad()
@ -32,9 +31,9 @@ class StatusTableViewController: AbstractStatusTableViewController, UIGestureRec
@objc func fetch() {
fetchStatuses { error in
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 {
@ -204,7 +203,6 @@ class StatusTableViewController: AbstractStatusTableViewController, UIGestureRec
return
}
mainStatusIndexPath = indexPath
cell.avatarImageView.setRoundedCorners()
func updateAccountView(status: StatusMO) {

24
elpha-ios/TimelineTableViewController.swift

@ -21,22 +21,18 @@ class TimelineTableViewController: AbstractStatusTableViewController {
}
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() {

7
elpha-ios/UIImageView+Effects.swift

@ -9,12 +9,7 @@
import UIKit
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() {
self.layer.cornerRadius = 10

Loading…
Cancel
Save