Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/cuappdev/tcat-ios
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbarker016 committed Dec 4, 2018
2 parents 85ac02f + 857cf6e commit 217374d
Show file tree
Hide file tree
Showing 77 changed files with 410 additions and 539 deletions.
35 changes: 28 additions & 7 deletions TCAT/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
]

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

// Update shortcut items
AppShortcuts.shared.updateShortcutItems()

Expand Down Expand Up @@ -101,7 +102,19 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


// MARK: Helper Functions

/// Creates and sets a unique identifier. If the device identifier changes, updates it.
func setupUniqueIdentifier() {
if
let uid = UIDevice.current.identifierForVendor?.uuidString,
uid != userDefaults.string(forKey: Constants.UserDefaults.uid)
{
userDefaults.set(uid, forKey: Constants.UserDefaults.uid)
}
}

func handleShortcut(item: UIApplicationShortcutItem) {
let optionsVC = RouteOptionsViewController()
if let shortcutData = item.userInfo as? [String: Data] {
Expand Down Expand Up @@ -182,9 +195,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let optionsVC = RouteOptionsViewController()

if
let lat = items?.filter({$0.name == "lat"}).first?.value,
let long = items?.filter({$0.name == "long"}).first?.value,
let stop = items?.filter({$0.name == "stopName"}).first?.value {
let lat = items?.filter({ $0.name == "lat" }).first?.value,
let long = items?.filter({ $0.name == "long" }).first?.value,
let stop = items?.filter({ $0.name == "stopName" }).first?.value {
latitude = Double(lat)
longitude = Double(long)
stopName = stop
Expand All @@ -210,13 +223,21 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let longitude = intent.longitude,
let searchTo = intent.searchTo,
let stopName = searchTo.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed),
let url = URL(string: "ithaca-transit://getRoutes?lat=\(latitude)&long=\(longitude)&stopName=\(stopName)") {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
return true
let url = URL(string: "ithaca-transit://getRoutes?lat=\(latitude)&long=\(longitude)&stopName=\(stopName)")
{
UIApplication.shared.open(url, options: [:]) { (didComplete) in
let intentDescription = userActivity.interaction?.intent.intentDescription ?? "No Intent Description"
let payload = SiriShortcutUsedPayload(didComplete: didComplete,
intentDescription: intentDescription,
locationName: stopName)
Analytics.shared.log(payload)
}
return true
}
}
return false
}

}

extension UIWindow {
Expand Down
158 changes: 0 additions & 158 deletions TCAT/Assets.xcassets/AppIcon-Old.appiconset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
21 changes: 0 additions & 21 deletions TCAT/Assets.xcassets/appdev_logo.imageset/Contents.json

This file was deleted.

Binary file not shown.
23 changes: 0 additions & 23 deletions TCAT/Assets.xcassets/reload.imageset/Contents.json

This file was deleted.

Binary file removed TCAT/Assets.xcassets/reload.imageset/reload.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
23 changes: 0 additions & 23 deletions TCAT/Assets.xcassets/welcome.imageset/Contents.json

This file was deleted.

Binary file removed TCAT/Assets.xcassets/welcome.imageset/bg.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
4 changes: 2 additions & 2 deletions TCAT/Cells/BusStopCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ class BusStopCell: UITableViewCell {
imageView?.contentMode = .scaleAspectFit
imageView?.center.y = bounds.height / 2.0
imageView?.image = reuseIdentifier == Constants.Cells.currentLocationIdentifier ? #imageLiteral(resourceName: "location") : #imageLiteral(resourceName: "pin")
imageView?.tintColor = .tcatBlueColor
imageView?.tintColor = Colors.tcatBlue

textLabel?.frame = CGRect(x: labelXPosition, y: 0.0, width: frame.width - labelWidth, height: labelHeight)
textLabel?.center.y = bounds.height / 2.0
textLabel?.font = .style(Fonts.System.regular, size: 13)
textLabel?.font = .getFont(.regular, size: 13)
}

}
10 changes: 5 additions & 5 deletions TCAT/Cells/BusStopTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class BusStopTableViewCell: UITableViewCell {

titleLabel = UILabel()
titleLabel.frame = CGRect(x: cellWidth, y: 0, width: UIScreen.main.bounds.width - cellWidth - 20, height: 20)
titleLabel.font = .style(Fonts.System.regular, size: 14)
titleLabel.textColor = .secondaryTextColor
titleLabel.font = .getFont(.regular, size: 14)
titleLabel.textColor = Colors.secondaryText
titleLabel.text = "Bus Stop Name"
titleLabel.lineBreakMode = .byWordWrapping
titleLabel.numberOfLines = 0
Expand All @@ -36,15 +36,15 @@ class BusStopTableViewCell: UITableViewCell {

connectorTop = UIView(frame: CGRect(x: linePosition, y: 0, width: 4, height: cellHeight / 2))
connectorTop.frame.origin.x -= connectorTop.frame.width / 2
connectorTop.backgroundColor = .tcatBlueColor
connectorTop.backgroundColor = Colors.tcatBlue
contentView.addSubview(connectorTop)

connectorBottom = UIView(frame: CGRect(x: linePosition, y: cellHeight / 2, width: 4, height: cellHeight / 2))
connectorBottom.frame.origin.x -= connectorBottom.frame.width / 2
connectorBottom.backgroundColor = .tcatBlueColor
connectorBottom.backgroundColor = Colors.tcatBlue
contentView.addSubview(connectorBottom)

statusCircle = Circle(size: .small, style: .outline, color: .tcatBlueColor)
statusCircle = Circle(size: .small, style: .outline, color: Colors.tcatBlue)
statusCircle.center = self.center
statusCircle.center.y = cellHeight / 2
statusCircle.frame.origin.x = linePosition - (statusCircle.frame.width / 2)
Expand Down
8 changes: 4 additions & 4 deletions TCAT/Cells/CornellDestinationCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ class CornellDestinationCell: UITableViewCell {
imageView?.contentMode = .scaleAspectFit
imageView?.center.y = bounds.height / 2.0
imageView?.image = #imageLiteral(resourceName: "pin")
imageView?.tintColor = .tcatBlueColor
imageView?.tintColor = Colors.tcatBlue

textLabel?.frame = CGRect(x: labelXPosition, y: 8.0, width: frame.width - labelWidth, height: labelHeight)
textLabel?.font = .style(Fonts.System.regular, size: 13)
textLabel?.font = .getFont(.regular, size: 13)

detailTextLabel?.frame = CGRect(x: labelXPosition, y: 0, width: frame.width - labelWidth, height: labelHeight)
detailTextLabel?.center.y = bounds.height - 15.0
detailTextLabel?.textColor = .mediumGrayColor
detailTextLabel?.font = .style(Fonts.System.regular, size: 12)
detailTextLabel?.textColor = Colors.metadataIcon
detailTextLabel?.font = .getFont(.regular, size: 12)
}
}
Loading

0 comments on commit 217374d

Please sign in to comment.