Skip to content
This repository has been archived by the owner on Aug 31, 2020. It is now read-only.

Commit

Permalink
removed image viewers, we need to write our own
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Oct 23, 2016
1 parent 42f7922 commit ec75ae7
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 92 deletions.
1 change: 0 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ target 'Twidere' do
pod 'FXBlurView', '~> 1.6'
pod 'FXImageView', '~> 1.3.5'
pod 'YYText', '~> 1.0.7'
pod 'MWPhotoBrowser', '~> 2.1.2'
pod 'DeviceKit', '~> 1.0'
pod 'SwiftHEXColors', '~> 1.0.4'
pod 'Freddy', '~> 3.0.0'
Expand Down
12 changes: 1 addition & 11 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ PODS:
- Alamofire (4.0.1)
- ALSLayouts (2.0.4)
- CryptoSwift (0.6.1)
- DACircularProgress (2.3.1)
- DateTools (1.7.0)
- DeviceKit (1.0.0)
- Freddy (3.0.0)
Expand All @@ -13,11 +12,6 @@ PODS:
- JDStatusBarNotification (1.5.4)
- JVFloatLabeledTextField (1.1.1)
- Kanna (2.0.0)
- MBProgressHUD (0.9.2)
- MWPhotoBrowser (2.1.2):
- DACircularProgress (~> 2.3)
- MBProgressHUD (~> 0.9)
- SDWebImage (!= 3.7.2, ~> 3.7)
- MXPagerView (0.1.3)
- MXParallaxHeader (0.5.2)
- PromiseKit (4.0.4):
Expand Down Expand Up @@ -63,7 +57,6 @@ DEPENDENCIES:
- JDStatusBarNotification (= 1.5.4)
- JVFloatLabeledTextField (= 1.1.1)
- Kanna (~> 2.0.0)
- MWPhotoBrowser (~> 2.1.2)
- MXPagerView (~> 0.1.3)
- MXParallaxHeader (~> 0.5.2)
- PromiseKit (~> 4.0)
Expand All @@ -86,7 +79,6 @@ SPEC CHECKSUMS:
Alamofire: 7682d43245de14874acd142ec137b144aa1dd335
ALSLayouts: 73bf82f8475a0533c4513570ba13e442d1d1cd5a
CryptoSwift: abdbc1bf32c89117c6b403810a7b30f742d86e68
DACircularProgress: 4dd437c0fc3da5161cb289e07ac449493d41db71
DateTools: 53288ee8b905fdc75897a1e6b5cc0144b14cba60
DeviceKit: ddead7f3a7c9603ba3a63cb748566428c38dd11f
Freddy: 367f994c88a90dd3987293b4b1bec94a4530745a
Expand All @@ -96,8 +88,6 @@ SPEC CHECKSUMS:
JDStatusBarNotification: d47dded0594a50a39c84a2cc5aa356fcf6750d0e
JVFloatLabeledTextField: 0e5524b097f102036214dd8279edc8ecf08b5e18
Kanna: 9a6637f72f5c77fe9c045b1efb2a5bb074754af8
MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1
MWPhotoBrowser: 5836d7aa041dc05a13de380c246826578adc5ea5
MXPagerView: db0c020aeada6a0c704f18f8053468560e346982
MXParallaxHeader: 5070ba8e8af27ec793c0d32ae82cfd2318e59635
PromiseKit: 8e8ee39d33ff199d92a1a883b5396f6285be6c91
Expand All @@ -115,6 +105,6 @@ SPEC CHECKSUMS:
UIView+TouchHighlighting: e05a338801522cbdc4a1e236bd189f2a928a781f
YYText: 5c461d709e24d55a182d1441c41dc639a18a4849

PODFILE CHECKSUM: 38d81b04f7adb23a4dbfd4ff9abf32432a6b5dc8
PODFILE CHECKSUM: 0eab7a1c234da33a9e73754bc7bc0f8f495d3377

COCOAPODS: 1.1.1
8 changes: 0 additions & 8 deletions Twidere.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,8 @@
CEBECFB31DA8C0C200350383 /* SafariBrowserController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEBECFB21DA8C0C200350383 /* SafariBrowserController.swift */; };
CEBECFB51DA9E18100350383 /* TimelineContentTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEBECFB41DA9E18100350383 /* TimelineContentTextView.swift */; };
CEBECFB71DA9EBD300350383 /* CALayerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEBECFB61DA9EBD300350383 /* CALayerExtension.swift */; };
CEBECFBE1DAA175500350383 /* MediaItem+MWPhoto.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEBECFBD1DAA175500350383 /* MediaItem+MWPhoto.swift */; };
CEBECFC01DAA2BE300350383 /* TintedImageButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEBECFBF1DAA2BE300350383 /* TintedImageButton.swift */; };
CEBECFC21DAA2F4500350383 /* UIViewControllerPreviewingExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEBECFC11DAA2F4500350383 /* UIViewControllerPreviewingExtension.swift */; };
CEBECFC41DAA36B600350383 /* MediaViewerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEBECFC31DAA36B600350383 /* MediaViewerController.swift */; };
CEBECFCA1DAB8AD900350383 /* CollectionUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEBECFC91DAB8AD900350383 /* CollectionUtils.swift */; };
CEBED5FB1D4C86C700619D1C /* BackgroundOperationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEBED5FA1D4C86C700619D1C /* BackgroundOperationService.swift */; };
CED41F2F1D2FF7C80089E0B6 /* HomeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CED41F2E1D2FF7C80089E0B6 /* HomeController.swift */; };
Expand Down Expand Up @@ -344,10 +342,8 @@
CEBECFB21DA8C0C200350383 /* SafariBrowserController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SafariBrowserController.swift; sourceTree = "<group>"; };
CEBECFB41DA9E18100350383 /* TimelineContentTextView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TimelineContentTextView.swift; sourceTree = "<group>"; };
CEBECFB61DA9EBD300350383 /* CALayerExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CALayerExtension.swift; sourceTree = "<group>"; };
CEBECFBD1DAA175500350383 /* MediaItem+MWPhoto.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "MediaItem+MWPhoto.swift"; sourceTree = "<group>"; };
CEBECFBF1DAA2BE300350383 /* TintedImageButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TintedImageButton.swift; sourceTree = "<group>"; };
CEBECFC11DAA2F4500350383 /* UIViewControllerPreviewingExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIViewControllerPreviewingExtension.swift; sourceTree = "<group>"; };
CEBECFC31DAA36B600350383 /* MediaViewerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaViewerController.swift; sourceTree = "<group>"; };
CEBECFC91DAB8AD900350383 /* CollectionUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionUtils.swift; sourceTree = "<group>"; };
CEBED5FA1D4C86C700619D1C /* BackgroundOperationService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = BackgroundOperationService.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
CED41F2E1D2FF7C80089E0B6 /* HomeController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = HomeController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
Expand Down Expand Up @@ -517,7 +513,6 @@
CE65B1CB1D9CC21000A38A61 /* Activity+Value.swift */,
CE65B1DA1D9D525C00A38A61 /* ActivityExtension.swift */,
CE6C6C261DB0AC5800DF4892 /* Foundation+Freddy.swift */,
CEBECFBD1DAA175500350383 /* MediaItem+MWPhoto.swift */,
CE79C83C1DA62E56007C05F2 /* SpanItemExtension.swift */,
CE4B1A9C1D7172F00017CB85 /* Status+Value.swift */,
CE6C6C321DB35C1D00DF4892 /* StatusExtension.swift */,
Expand Down Expand Up @@ -911,7 +906,6 @@
CEBECFBA1DAA153B00350383 /* MediaViewer */ = {
isa = PBXGroup;
children = (
CEBECFC31DAA36B600350383 /* MediaViewerController.swift */,
);
path = MediaViewer;
sourceTree = "<group>";
Expand Down Expand Up @@ -1547,7 +1541,6 @@
CE9574801D3216BC00504D52 /* ServiceConstants.swift in Sources */,
CEDC3B211D7D87F80082A8BA /* SQLite+UserVersion.swift in Sources */,
CE65B1B61D9C20AE00A38A61 /* PullToRefreshProtocol.swift in Sources */,
CEBECFBE1DAA175500350383 /* MediaItem+MWPhoto.swift in Sources */,
CE95749A1D33DC7B00504D52 /* BasePreferencesController.swift in Sources */,
CE65B1BE1D9CC01500A38A61 /* Activity.swift in Sources */,
CE65B1E61D9EACB600A38A61 /* InteractionsActivitiesListControllerDataSource.swift in Sources */,
Expand Down Expand Up @@ -1606,7 +1599,6 @@
CEA2E2A71D34C1610095BC57 /* DefaultAPISettingsController.swift in Sources */,
CEDFEA6D1D4F4BF600E1F8B8 /* Status+MicroBlog.swift in Sources */,
CEEF42B91DB669C2009ECD0F /* YYTextExtension.swift in Sources */,
CEBECFC41DAA36B600350383 /* MediaViewerController.swift in Sources */,
CEDC3B231D7D8BE90082A8BA /* DatabaseMigration.swift in Sources */,
CE6C6C201DB09A9800DF4892 /* UserList+SQLite.swift in Sources */,
CE95747D1D3210A300504D52 /* CustomAPIConfig.swift in Sources */,
Expand Down
27 changes: 0 additions & 27 deletions Twidere/Extensions/Model/MediaItem+MWPhoto.swift

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
32 changes: 0 additions & 32 deletions Twidere/UI/Pages/MediaViewer/MediaViewerController.swift

This file was deleted.

5 changes: 2 additions & 3 deletions Twidere/UI/Pages/StatusesList/StatusesListController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import SwiftyJSON
import PromiseKit
import UITableView_FDTemplateLayoutCell
import YYText
import ActionSheetPicker_3_0

class StatusesListController: UITableViewController, StatusCellDelegate, PullToRefreshProtocol, UIViewControllerPreviewingDelegate {

Expand Down Expand Up @@ -301,8 +300,8 @@ class StatusesListController: UITableViewController, StatusCellDelegate, PullToR
}

func mediaPreviewTapped(status: Status) {
let vc = MediaViewerController(media: status.metadata!.media!)
self.show(vc, sender: self)
let vc = SafariBrowserController(url: URL(string: status.metadata!.media.first!.mediaUrl!)!)
self.present(vc, animated: true, completion: nil)
}

func actionSelected(status: Status, action: StatusCell.StatusAction) {
Expand Down
6 changes: 2 additions & 4 deletions Twidere/UI/TableViewCells/Status/StatusCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import SwiftyJSON
import DateTools
import ALSLayouts
import YYText
import MWPhotoBrowser

class StatusCell: ALSTableViewCell {

Expand Down Expand Up @@ -255,11 +254,10 @@ class StatusCell: ALSTableViewCell {
vc.displayStatus(status.quotedStatus!, reload: true)
return (vc, v.convert(v.bounds, to: self), false)
case self.mediaPreview:
let vc = MediaViewerController(media: status.metadata!.media!)
if let item = status.metadata?.media?.first {
vc.preferredContentSize = CGSize(width: item.width, height: item.height)
let vc = SafariBrowserController(url: URL(string: item.mediaUrl!)!)
return (vc, v.convert(v.bounds, to: self), true)
}
return (vc, v.convert(v.bounds, to: self), false)
default:
break
}
Expand Down
1 change: 0 additions & 1 deletion Twidere/UI/ViewControllers/Compose/ComposeController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import SwiftyUserDefaults
import AssetsLibrary
import Photos


fileprivate func < <T : Comparable>(lhs: T?, rhs: T?) -> Bool {
switch (lhs, rhs) {
case let (l?, r?):
Expand Down
10 changes: 7 additions & 3 deletions Twidere/UI/ViewControllers/Home/HomeController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import UIView_TouchHighlighting
import PromiseKit
import SQLite

class HomeController: UITabBarController {
class HomeController: UITabBarController, UIViewControllerTransitioningDelegate {

override func viewDidLoad() {
super.viewDidLoad()
Expand All @@ -29,6 +29,7 @@ class HomeController: UITabBarController {

let nvc = UINavigationController(rootViewController: vc)
nvc.tabBarItem = UITabBarItem(title: "Home", image: UIImage(named: "Tab Icon Home"), tag: 1)
nvc.navigationBar.isTranslucent = false
return nvc
}()

Expand All @@ -41,6 +42,7 @@ class HomeController: UITabBarController {

let nvc = UINavigationController(rootViewController: vc)
nvc.tabBarItem = UITabBarItem(title: "Notifications", image: UIImage(named: "Tab Icon Notification"), tag: 2)
nvc.navigationBar.isTranslucent = false
return nvc
}()

Expand All @@ -51,6 +53,7 @@ class HomeController: UITabBarController {

let nvc = UINavigationController(rootViewController: vc)
nvc.tabBarItem = UITabBarItem(title: "Messages", image: UIImage(named: "Tab Icon Message"), tag: 3)
nvc.navigationBar.isTranslucent = false
return nvc
}()

Expand All @@ -62,14 +65,15 @@ class HomeController: UITabBarController {

let nvc = UINavigationController(rootViewController: vc)
nvc.tabBarItem = UITabBarItem(title: "Me", image: UIImage(named: "Tab Icon User"), tag: 4)
nvc.navigationBar.isTranslucent = false
return nvc
}()

let pageControllers = [homeTimelineController, notificationsTimelineController, messageConversationsController, profileController]

setViewControllers(pageControllers, animated: false)


self.tabBar.isTranslucent = false
}

override func didReceiveMemoryWarning() {
Expand Down
2 changes: 2 additions & 0 deletions Twidere/UI/ViewControllers/Home/HomeRootController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ class HomeRootController: UINavigationController, UIGestureRecognizerDelegate {
super.viewDidLoad()
self.navigationBar.isTranslucent = false
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ class UserProfileController: UIViewController, UINavigationBarDelegate, Segmente
self.profileImageView.makeCircular()

let border = CALayerBorder(color: UIColor.white.cgColor, width: 2)
let shadow = CALayerShadow(color: UIColor.black.cgColor, offset: CGSize(width: 0, height: 1), blurRadius: 2, opacity: 0.33)
self.profileImageContainer.layer.makeCircular(border: border, shadow: shadow)
self.profileImageContainer.layer.makeCircular(border: border)
self.profileImageContainer.clipsToBounds = false

self.segmentedContainerView.dataSource = self
Expand Down Expand Up @@ -100,6 +99,7 @@ class UserProfileController: UIViewController, UINavigationBarDelegate, Segmente
} else if (self.userInfo != nil) {
loadUser()
}

}

override func viewWillAppear(_ animated: Bool) {
Expand Down Expand Up @@ -170,6 +170,10 @@ class UserProfileController: UIViewController, UINavigationBarDelegate, Segmente
return .lightContent
}

override var bottomLayoutGuide: UILayoutSupport {
return super.bottomLayoutGuide
}

func displayUser(user: User, reload: Bool = false) {
self.user = user
self.userInfo = (user.accountKey, user.key, user.screenName)
Expand Down

0 comments on commit ec75ae7

Please sign in to comment.