diff --git a/ConnectStats.xcodeproj/project.pbxproj b/ConnectStats.xcodeproj/project.pbxproj index 5a5ef41f..245098a6 100644 --- a/ConnectStats.xcodeproj/project.pbxproj +++ b/ConnectStats.xcodeproj/project.pbxproj @@ -1167,6 +1167,12 @@ 42FC98DC261C6A4D00ACF6E1 /* GCActivityTypeSelectionViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42FC98D8261C6A4D00ACF6E1 /* GCActivityTypeSelectionViewController.xib */; }; 42FC98F4261CFC0000ACF6E1 /* GCActivityTypeSelectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42FC98D7261C6A4D00ACF6E1 /* GCActivityTypeSelectionViewController.swift */; }; 42FC98F5261CFC0000ACF6E1 /* GCActivityTypeSelectionViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42FC98D8261C6A4D00ACF6E1 /* GCActivityTypeSelectionViewController.xib */; }; + 42FC992826218EE200ACF6E1 /* GCTooltipView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42FC992726218EE200ACF6E1 /* GCTooltipView.swift */; }; + 42FC992926218EE200ACF6E1 /* GCTooltipView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42FC992726218EE200ACF6E1 /* GCTooltipView.swift */; }; + 42FC992A26218EE200ACF6E1 /* GCTooltipView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42FC992726218EE200ACF6E1 /* GCTooltipView.swift */; }; + 42FC993C262193CA00ACF6E1 /* GCTooltipView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42FC993B262193CA00ACF6E1 /* GCTooltipView.xib */; }; + 42FC993D262193CA00ACF6E1 /* GCTooltipView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42FC993B262193CA00ACF6E1 /* GCTooltipView.xib */; }; + 42FC993E262193CA00ACF6E1 /* GCTooltipView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42FC993B262193CA00ACF6E1 /* GCTooltipView.xib */; }; 42FD55B91B90A39F0070B3B4 /* GCCellHealthDayActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = 42FD55B81B90A39F0070B3B4 /* GCCellHealthDayActivity.m */; }; 42FD55BA1B90A39F0070B3B4 /* GCCellHealthDayActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = 42FD55B81B90A39F0070B3B4 /* GCCellHealthDayActivity.m */; }; 42FFF6A7232EDAE1008714D5 /* user.json in Resources */ = {isa = PBXBuildFile; fileRef = 42FFF6A6232EDAE1008714D5 /* user.json */; }; @@ -2108,6 +2114,8 @@ 42FC177F1E196E4B00F55302 /* GCTestActivityFitFile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GCTestActivityFitFile.swift; sourceTree = ""; }; 42FC98D7261C6A4D00ACF6E1 /* GCActivityTypeSelectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = GCActivityTypeSelectionViewController.swift; path = src/GCActivityTypeSelectionViewController.swift; sourceTree = ""; }; 42FC98D8261C6A4D00ACF6E1 /* GCActivityTypeSelectionViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = GCActivityTypeSelectionViewController.xib; path = src/GCActivityTypeSelectionViewController.xib; sourceTree = ""; }; + 42FC992726218EE200ACF6E1 /* GCTooltipView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = GCTooltipView.swift; path = src/GCTooltipView.swift; sourceTree = ""; }; + 42FC993B262193CA00ACF6E1 /* GCTooltipView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = GCTooltipView.xib; path = src/GCTooltipView.xib; sourceTree = ""; }; 42FD55B71B90A39F0070B3B4 /* GCCellHealthDayActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GCCellHealthDayActivity.h; path = src/GCCellHealthDayActivity.h; sourceTree = ""; }; 42FD55B81B90A39F0070B3B4 /* GCCellHealthDayActivity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GCCellHealthDayActivity.m; path = src/GCCellHealthDayActivity.m; sourceTree = ""; }; 42FFF6A6232EDAE1008714D5 /* user.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = user.json; path = connectstatstestapp/samples/InitialSamples/user.json; sourceTree = SOURCE_ROOT; }; @@ -3400,6 +3408,7 @@ 428FF73D15F37440007A88FA /* UserInterface */ = { isa = PBXGroup; children = ( + 42FC991626218DAA00ACF6E1 /* ToolTips */, 424340FA1B7415C7001E22BB /* SpotLightSearch */, 42A66BCD160CFF7F00DA29A5 /* Cells */, 42A95B361632DB20000B2082 /* Maps */, @@ -4225,6 +4234,15 @@ path = ConnectStatsTestAppXCTests; sourceTree = ""; }; + 42FC991626218DAA00ACF6E1 /* ToolTips */ = { + isa = PBXGroup; + children = ( + 42FC992726218EE200ACF6E1 /* GCTooltipView.swift */, + 42FC993B262193CA00ACF6E1 /* GCTooltipView.xib */, + ); + name = ToolTips; + sourceTree = ""; + }; 42FD55B61B90A37A0070B3B4 /* Specialized */ = { isa = PBXGroup; children = ( @@ -4613,6 +4631,7 @@ 4211C53419AB043A000DEF87 /* version.plist in Resources */, 422CCE821B7EA81500A4DAEB /* Fields.xcassets in Resources */, 42CBD0C525E4EE880024BD28 /* TM_WORLD_BORDERS-0.2.dbf in Resources */, + 42FC993E262193CA00ACF6E1 /* GCTooltipView.xib in Resources */, 422CCE851B7EA8C100A4DAEB /* Weather.xcassets in Resources */, 429184C4231B13EA00FD6525 /* Colors-iOS13.xcassets in Resources */, 42BAB8D4231C07E700639928 /* credentials.json in Resources */, @@ -4677,6 +4696,7 @@ 428FF71815F36888007A88FA /* InfoPlist.strings in Resources */, 42CBD0C925E4EE880024BD28 /* TM_WORLD_BORDERS-0.2.prj in Resources */, 427CF8D222ABD6BC00894253 /* credentials.json in Resources */, + 42FC993C262193CA00ACF6E1 /* GCTooltipView.xib in Resources */, 42CBD0CC25E4EE880024BD28 /* TM_WORLD_BORDERS-0.2.shx in Resources */, 42CBD0C325E4EE880024BD28 /* TM_WORLD_BORDERS-0.2.dbf in Resources */, 422CCE7C1B7E9B6300A4DAEB /* Cells.xcassets in Resources */, @@ -4844,6 +4864,7 @@ files = ( 4295B13B2574192000728D1E /* test_activity_running_5881498219.db in Resources */, 42B5E49D1BA5BA2D000FAE4E /* strava_laps_141871826.json in Resources */, + 42FC993D262193CA00ACF6E1 /* GCTooltipView.xib in Resources */, 42B5E4881BA5BA2D000FAE4E /* strava_list_5.json in Resources */, 42B5E4771BA5BA2D000FAE4E /* test_activity_running_830807000.db in Resources */, 422A24F6247325FB00D6C2FB /* activity_424479793.json in Resources */, @@ -5359,6 +5380,7 @@ 424208971BCC49E200F3DB12 /* GCActivityPreviewingViewController.m in Sources */, 42D4CA7F24951AF2003F3AB7 /* GCLagPeriod.m in Sources */, 42FC98DA261C6A4D00ACF6E1 /* GCActivityTypeSelectionViewController.swift in Sources */, + 42FC992A26218EE200ACF6E1 /* GCTooltipView.swift in Sources */, 42BFC2331DCF4DF900EAD40E /* GCAppGlobal.swift in Sources */, 42BE67AB25A86FCE002505A2 /* GCGarminLoginSSORequest.swift in Sources */, 422FAF7119A1DD6000D09773 /* GCSettingsBugReportViewController.m in Sources */, @@ -5643,6 +5665,7 @@ 4209E1911DA44EC800B80735 /* GCActivitiesOrganizerListRegister.m in Sources */, 424D08C01DC5DA4E000B4620 /* GCAppPasswordManager.swift in Sources */, 4244676C184B7550009F807E /* GCActivityType.m in Sources */, + 42FC992826218EE200ACF6E1 /* GCTooltipView.swift in Sources */, 426B0F101DA119060091A734 /* GCUnit+FIT.m in Sources */, 423209361868D8F600C8F305 /* GCActivity+CalculatedTracks.m in Sources */, 42FC17751E195DE300F55302 /* FITFitFieldsStatistics.swift in Sources */, @@ -5781,6 +5804,7 @@ 42295E081EC6F4D900F4F7EE /* GCTestServiceGarmin.m in Sources */, 4211D45D259780B900967874 /* GCStravaRequestBase.swift in Sources */, 42FC98F4261CFC0000ACF6E1 /* GCActivityTypeSelectionViewController.swift in Sources */, + 42FC992926218EE200ACF6E1 /* GCTooltipView.swift in Sources */, 427DDCC01DB3D02B007745A7 /* GCGarminRequestHeartRateZones.m in Sources */, 42D4CA8524963F90003F3AB7 /* GCStatsDerivedHistoryViewController.m in Sources */, 42453BA61DD8B4E30073ACCA /* GCMapRouteLogicPointHolder.m in Sources */, @@ -6948,7 +6972,7 @@ repositoryURL = "https://github.com/roznet/rzutils-touch.git"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 1.0.1; + minimumVersion = 1.0.2; }; }; 422DCC16258A630E000DEE4B /* XCRemoteSwiftPackageReference "FitFileParser" */ = { diff --git a/ConnectStats.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ConnectStats.xcworkspace/xcshareddata/swiftpm/Package.resolved index 989ecfe4..bc0887f6 100644 --- a/ConnectStats.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ConnectStats.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -123,8 +123,8 @@ "repositoryURL": "https://github.com/roznet/rzutils-touch.git", "state": { "branch": null, - "revision": "8dfb8e43574e8340abfddf831583cbc5985017c1", - "version": "1.0.1" + "revision": "5a396243777c14257c4e0b23c9f2229fd25252ae", + "version": "1.0.2" } }, { diff --git a/ConnectStats/src/GCActivityTypeSelectionViewController.swift b/ConnectStats/src/GCActivityTypeSelectionViewController.swift index 279d11f0..f027a196 100644 --- a/ConnectStats/src/GCActivityTypeSelectionViewController.swift +++ b/ConnectStats/src/GCActivityTypeSelectionViewController.swift @@ -26,6 +26,7 @@ import UIKit +import RZUtilsTouchSwift class GCActivityTypeSelectionViewController: UIViewController { @@ -58,6 +59,12 @@ class GCActivityTypeSelectionViewController: UIViewController { } } + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + + } + /* // MARK: - Navigation diff --git a/ConnectStats/src/GCAppDelegate+Swift.m b/ConnectStats/src/GCAppDelegate+Swift.m index fb0d3cf5..5251f5d4 100644 --- a/ConnectStats/src/GCAppDelegate+Swift.m +++ b/ConnectStats/src/GCAppDelegate+Swift.m @@ -76,7 +76,12 @@ -(void)registerForPushNotifications{ } -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler{ - RZLog(RZLogInfo,@"remote notification %@", userInfo); + if( userInfo[@"activity_id"] != nil){ + RZLog(RZLogInfo,@"remote notification for activity %@",userInfo[@"activity_id"]); + }else{ + RZLog(RZLogInfo,@"remote notification %@", userInfo); + } + application.applicationIconBadgeNumber = 1; completionHandler(UIBackgroundFetchResultNewData); } @@ -165,6 +170,7 @@ -(void)startSuccessful{ [self settingsUpdateCheckPostStart]; [self startSuccessfulSwift]; + //[UIApplication sharedApplication].applicationIconBadgeNumber = 0; } } diff --git a/ConnectStats/src/GCAppDelegate.h b/ConnectStats/src/GCAppDelegate.h index 42f4a1ae..9385e2be 100644 --- a/ConnectStats/src/GCAppDelegate.h +++ b/ConnectStats/src/GCAppDelegate.h @@ -36,7 +36,6 @@ #import "GCAppActionDelegate.h" #import "GCActivityTypes.h" -@class GCSegmentOrganizer; @class GCConnectStatsStatus; NS_ASSUME_NONNULL_BEGIN @@ -53,7 +52,6 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, retain) GCHealthOrganizer * health; @property (nonatomic, retain) GCDerivedOrganizer * derived; @property (nonatomic, retain) GCWatchSessionManager * watch; -@property (nonatomic, retain) GCSegmentOrganizer * segments; @property (nullable, nonatomic, retain) NSURL * urlToOpen; @property (nonatomic, retain) GCConnectStatsStatus * remoteStatus; // Will be either the currnet location from the phone or the location of the current activity diff --git a/ConnectStats/src/GCAppDelegate.m b/ConnectStats/src/GCAppDelegate.m index 7e6fdcef..55b0c105 100644 --- a/ConnectStats/src/GCAppDelegate.m +++ b/ConnectStats/src/GCAppDelegate.m @@ -105,7 +105,6 @@ -(void)dealloc{ [_urlToOpen release]; [_actions release]; [_health release]; - [_segments release]; [_credentials release]; [_remoteStatus release]; [_locationManager release]; diff --git a/ConnectStats/src/GCAppGlobal.h b/ConnectStats/src/GCAppGlobal.h index 77281230..14305997 100644 --- a/ConnectStats/src/GCAppGlobal.h +++ b/ConnectStats/src/GCAppGlobal.h @@ -43,7 +43,6 @@ extern NSString * const kNotifyLocationRequestComplete; @class GCAppDelegate; @class GCActivity; @class HKHealthStore; -@class GCSegmentOrganizer; @class GCAppProfiles; @class GCHealthOrganizer; @class GCDerivedOrganizer; @@ -60,7 +59,6 @@ extern NSString * const kNotifyLocationRequestComplete; +(dispatch_queue_t)worker; +(GCAppProfiles*)profile; +(GCDerivedOrganizer*)derived; -+(GCSegmentOrganizer*)segments; +(NSArray*)recentRemoteMessages; +(void)recentRemoteMessagesReceived; diff --git a/ConnectStats/src/GCAppGlobal.m b/ConnectStats/src/GCAppGlobal.m index 2d3fc493..c1f68e7f 100644 --- a/ConnectStats/src/GCAppGlobal.m +++ b/ConnectStats/src/GCAppGlobal.m @@ -125,11 +125,6 @@ +(UINavigationController*)currentNavigationController{ return [appDelegate.actionDelegate currentNavigationController]; } -+(GCSegmentOrganizer*)segments{ - GCAppDelegate *appDelegate = _sharedApplicationDelegate(); - return appDelegate.segments; -} - +(NSArray*)recentRemoteMessages{ GCAppDelegate *appDelegate = _sharedApplicationDelegate(); return [appDelegate recentRemoteMessages]; diff --git a/ConnectStats/src/GCHistoryAggregatedActivityStats.m b/ConnectStats/src/GCHistoryAggregatedActivityStats.m index e9a37a29..3e5beb63 100644 --- a/ConnectStats/src/GCHistoryAggregatedActivityStats.m +++ b/ConnectStats/src/GCHistoryAggregatedActivityStats.m @@ -86,6 +86,8 @@ -(void)dealloc{ [_refOrNil release]; [_fields release]; [_foundFields release]; + [_activityTypeSelection release]; + [super dealloc]; } diff --git a/ConnectStats/src/GCStatsMultiFieldViewController.m b/ConnectStats/src/GCStatsMultiFieldViewController.m index 445561a8..2f49448a 100644 --- a/ConnectStats/src/GCStatsMultiFieldViewController.m +++ b/ConnectStats/src/GCStatsMultiFieldViewController.m @@ -45,6 +45,8 @@ #import "GCStatsDerivedHistoryViewController.h" #import "ConnectStats-Swift.h" @import RZUtilsSwift; +@import RZUtilsTouch; +@import RZUtilsTouchSwift; @interface GCStatsMultiFieldViewController () @property (nonatomic,retain) GCHistoryPerformanceAnalysis * performanceAnalysis; @@ -121,6 +123,15 @@ -(void)viewDidAppear:(BOOL)animated{ [super viewDidAppear:animated]; [GCAppGlobal startupRefreshIfNeeded]; + /* + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(){ + NSIndexPath * indexPath = [NSIndexPath indexPathForRow:1 inSection:0]; + + [self.tableView addTooltipAt:indexPath within:self.tabBarController.view]; + self.tableView.scrollEnabled = false; + //[self addTooltipInfoWithView:self.tableView]; + });*/ + } -(void)viewWillAppear:(BOOL)animated{ diff --git a/ConnectStats/src/GCTooltipView.swift b/ConnectStats/src/GCTooltipView.swift new file mode 100644 index 00000000..e88d109f --- /dev/null +++ b/ConnectStats/src/GCTooltipView.swift @@ -0,0 +1,71 @@ +// MIT License +// +// Created on 10/04/2021 for ConnectStats +// +// Copyright (c) 2021 Brice Rosenzweig +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + + + +import UIKit + +class GCTooltipView: UIView { + @IBOutlet var title: UILabel! + @IBOutlet var descriptionText: UITextView! + + /* + // Only override draw() if you perform custom drawing. + // An empty implementation adversely affects performance during animation. + override func draw(_ rect: CGRect) { + // Drawing code + } + */ + + static func newTooltip() -> GCTooltipView? { + guard let views = Bundle(for: self).loadNibNamed("GCTooltipView", owner: self, options: nil), + let tooltip = views[0] as? GCTooltipView + else { + return nil + } + return tooltip + } + + override func awakeFromNib() { + super.awakeFromNib() + } +} + +extension UIViewController { + + @objc func addTooltipInfo(view : UIView) { + if let tooltip = GCTooltipView.newTooltip() { + self.view.addSubview(tooltip) + + NSLayoutConstraint.activate( [ + tooltip.topAnchor.constraint(equalTo: view.bottomAnchor), + tooltip.centerYAnchor.constraint(equalTo: view.centerYAnchor, constant: 0.0), + tooltip.centerXAnchor.constraint(equalTo: view.centerXAnchor, constant: 0.0), + tooltip.leadingAnchor.constraint(greaterThanOrEqualTo: self.view.leadingAnchor,constant: 30.0), + tooltip.trailingAnchor.constraint(greaterThanOrEqualTo: self.view.trailingAnchor, constant: 30.0) + ]) + } + } +} diff --git a/ConnectStats/src/GCTooltipView.xib b/ConnectStats/src/GCTooltipView.xib new file mode 100644 index 00000000..1abdf99b --- /dev/null +++ b/ConnectStats/src/GCTooltipView.xib @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +