diff --git a/.gitignore b/.gitignore index 312d1f6..8768137 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,8 @@ xcuserdata/ *.moved-aside *.xccheckout *.xcscmblueprint +.DS_Store +/Icons ## Obj-C/Swift specific *.hmap @@ -65,4 +67,4 @@ Carthage/Build fastlane/report.xml fastlane/Preview.html fastlane/screenshots/**/*.png -fastlane/test_output +fastlane/test_output \ No newline at end of file diff --git a/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-1024pt.png b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-1024pt.png new file mode 100644 index 0000000..d5e9460 Binary files /dev/null and b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-1024pt.png differ diff --git a/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-20pt@2x.png b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-20pt@2x.png new file mode 100644 index 0000000..a024fed Binary files /dev/null and b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-20pt@2x.png differ diff --git a/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-20pt@3x.png b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-20pt@3x.png new file mode 100644 index 0000000..41440ff Binary files /dev/null and b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-20pt@3x.png differ diff --git a/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-29pt@2x.png b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-29pt@2x.png new file mode 100644 index 0000000..2659c8f Binary files /dev/null and b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-29pt@2x.png differ diff --git a/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-29pt@3x.png b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-29pt@3x.png new file mode 100644 index 0000000..ce7910c Binary files /dev/null and b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-29pt@3x.png differ diff --git a/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-40pt@2x.png b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-40pt@2x.png new file mode 100644 index 0000000..b5fcdf7 Binary files /dev/null and b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-40pt@2x.png differ diff --git a/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-40pt@3x.png b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-40pt@3x.png new file mode 100644 index 0000000..0083455 Binary files /dev/null and b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-40pt@3x.png differ diff --git a/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-60pt@2x.png b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-60pt@2x.png new file mode 100644 index 0000000..0083455 Binary files /dev/null and b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-60pt@2x.png differ diff --git a/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-60pt@3x.png b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-60pt@3x.png new file mode 100644 index 0000000..e17fecf Binary files /dev/null and b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Artboard-60pt@3x.png differ diff --git a/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json old mode 100644 new mode 100755 index d8db8d6..67ebe83 --- a/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/TransitPal/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,43 +1,51 @@ { "images" : [ { - "idiom" : "iphone", "size" : "20x20", + "idiom" : "iphone", + "filename" : "Artboard-20pt@2x.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "20x20", + "idiom" : "iphone", + "filename" : "Artboard-20pt@3x.png", "scale" : "3x" }, { - "idiom" : "iphone", "size" : "29x29", + "idiom" : "iphone", + "filename" : "Artboard-29pt@2x.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "29x29", + "idiom" : "iphone", + "filename" : "Artboard-29pt@3x.png", "scale" : "3x" }, { - "idiom" : "iphone", "size" : "40x40", + "idiom" : "iphone", + "filename" : "Artboard-40pt@2x.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "40x40", + "idiom" : "iphone", + "filename" : "Artboard-40pt@3x.png", "scale" : "3x" }, { - "idiom" : "iphone", "size" : "60x60", + "idiom" : "iphone", + "filename" : "Artboard-60pt@2x.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "60x60", + "idiom" : "iphone", + "filename" : "Artboard-60pt@3x.png", "scale" : "3x" }, { @@ -86,8 +94,9 @@ "scale" : "2x" }, { - "idiom" : "ios-marketing", "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Artboard-1024pt.png", "scale" : "1x" } ], diff --git a/TransitPal/Resources/Assets.xcassets/Contents.json b/TransitPal/Resources/Assets.xcassets/Contents.json old mode 100644 new mode 100755 diff --git a/TransitPal/Views/TransitEventDetailView.swift b/TransitPal/Views/TransitEventDetailView.swift old mode 100644 new mode 100755 index a637d92..ff0b7e5 --- a/TransitPal/Views/TransitEventDetailView.swift +++ b/TransitPal/Views/TransitEventDetailView.swift @@ -11,13 +11,6 @@ import SwiftUI struct TransitEventDetailView : View { var event: TransitEvent = TransitEvent() - static var formatter: DateFormatter { - let formatter = DateFormatter() - formatter.dateStyle = .short - formatter.timeStyle = .short - return formatter - } - var body: some View { let isTrip = (event as? TransitTrip) != nil @@ -33,12 +26,12 @@ struct TransitEventDetailView : View { HStack { Text("Tagged on").bold() Spacer() - Text(Self.formatter.string(from: (event as! TransitTrip).Timestamp)) + Text(prettyDate(from: (event as! TransitTrip).Timestamp)) } HStack { Text("Tagged off").bold() Spacer() - Text(Self.formatter.string(from: (event as! TransitTrip).ExitTimestamp!)) + Text(prettyDate(from: (event as! TransitTrip).ExitTimestamp)) } HStack { Text("From").bold() @@ -64,7 +57,7 @@ struct TransitEventDetailView : View { HStack { Text("Date/Time").bold() Spacer() - Text(Self.formatter.string(from: (event as! TransitRefill).Timestamp)) + Text(prettyDate(from: (event as! TransitRefill).Timestamp)) } HStack { Text("Amount").bold() @@ -85,6 +78,13 @@ struct TransitEventDetailView : View { }.padding() } } + + func prettyDate(from date: Date?) -> String { + let formatter = DateFormatter() + formatter.dateStyle = .short + formatter.timeStyle = .short + return formatter.string(for: date) ?? "N/A" + } } #if DEBUG diff --git a/TransitPal/Views/TransitEventRow.swift b/TransitPal/Views/TransitEventRow.swift old mode 100644 new mode 100755 index 9562e77..8799e71 --- a/TransitPal/Views/TransitEventRow.swift +++ b/TransitPal/Views/TransitEventRow.swift @@ -26,7 +26,11 @@ struct TransitEventRow : View { if let trip = event as? TransitTrip { amount = trip.prettyFare - description = "\(trip.From.bestName(false)) → \(trip.To.bestName(false))" + if trip.To.hasName { + description = "\(trip.From.bestName(false)) → \(trip.To.bestName(false))" + } else { + description = "\(trip.From.bestName(false))" + } icon = trip.Mode.icon if let exitTime = trip.ExitTimestamp { timestamp = "\(timestamp) → \(dateFormatter.string(from: exitTime))" @@ -43,8 +47,8 @@ struct TransitEventRow : View { return HStack { Image(uiImage: image) VStack(alignment: .leading) { - Text(event.Agency.name.english).font(.headline).lineLimit(1) - Text(description).font(.callout).lineLimit(1) + Text(event.Agency.name.englishShort).font(.headline).lineLimit(1) + Text(description).font(.callout).lineLimit(nil) } Spacer() VStack(alignment: .trailing) { diff --git a/TransitPal/Views/TransitTripMapView.swift b/TransitPal/Views/TransitTripMapView.swift old mode 100644 new mode 100755 index 4175c82..4b4815d --- a/TransitPal/Views/TransitTripMapView.swift +++ b/TransitPal/Views/TransitTripMapView.swift @@ -18,7 +18,10 @@ struct TransitTripMapView: UIViewRepresentable { } func updateUIView(_ view: MKMapView, context: Context) { - let annotations = [self.from.annotation, self.to.annotation] + var annotations = [self.from.annotation] + if self.to.hasName { + annotations.append(self.to.annotation) + } view.addAnnotations(annotations) view.showAnnotations(annotations, animated: false) }