summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2019-12-12 10:22:00 -0500
committerNicoleYarroch <nicole@livio.io>2019-12-12 10:22:00 -0500
commit45a2006cd2a966ee9dcbcc0be48700e93c9cf95e (patch)
treef152e1ab9213b008fe39408a0ce28e416e43656f
parent4161518c33f904d76798c7658afbc6b13750d09f (diff)
downloadsdl_ios-bugfix/lockscreen_fixes.tar.gz
Added test view controllersbugfix/lockscreen_fixes
-rw-r--r--Example Apps/Example ObjC/AppDelegate.h3
-rw-r--r--Example Apps/Example ObjC/AppDelegate.m28
-rw-r--r--Example Apps/Example ObjC/Base.lproj/ConnectionIAPTableViewController.storyboard25
-rw-r--r--Example Apps/Example ObjC/ConnectionIAPTableViewController.m27
-rw-r--r--Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist2
-rw-r--r--SmartDeviceLink-iOS.xcodeproj/project.pbxproj16
-rw-r--r--SmartDeviceLink_Example/PasswordViewController.h17
-rw-r--r--SmartDeviceLink_Example/PasswordViewController.m36
-rw-r--r--SmartDeviceLink_Example/PopupViewController.h17
-rw-r--r--SmartDeviceLink_Example/PopupViewController.m36
10 files changed, 199 insertions, 8 deletions
diff --git a/Example Apps/Example ObjC/AppDelegate.h b/Example Apps/Example ObjC/AppDelegate.h
index b86efb1a6..3f77674a3 100644
--- a/Example Apps/Example ObjC/AppDelegate.h
+++ b/Example Apps/Example ObjC/AppDelegate.h
@@ -7,6 +7,9 @@
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
+@property (strong, nonatomic) UIWindow *passwordWindow;
+@property (strong, nonatomic) UIWindow *popupWindow;
+@property (strong, nonatomic) UIWindow *networkConnectionWindow;
@end
diff --git a/Example Apps/Example ObjC/AppDelegate.m b/Example Apps/Example ObjC/AppDelegate.m
index 1ceb6f765..9e55f5f70 100644
--- a/Example Apps/Example ObjC/AppDelegate.m
+++ b/Example Apps/Example ObjC/AppDelegate.m
@@ -7,6 +7,9 @@
#import "ProxyManager.h"
#import "SDLLogMacros.h"
#import "SDLManager.h"
+#import "ConnectionIAPTableViewController.h"
+#import "PasswordViewController.h"
+#import "PopupViewController.h"
@interface AppDelegate ()
@@ -16,9 +19,30 @@
@implementation AppDelegate
-
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
- return YES;
+ // Password window
+ self.passwordWindow = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
+ self.passwordWindow.rootViewController = [PasswordViewController new];
+ [self.passwordWindow makeKeyAndVisible];
+
+ // Popup window
+ self.popupWindow = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
+ self.popupWindow.rootViewController = [PopupViewController new];
+ [self.popupWindow makeKeyAndVisible];
+
+ // Network connection window
+ UIStoryboard *iapControllerStoryboard = [UIStoryboard storyboardWithName:@"ConnectionIAPTableViewController" bundle:[NSBundle mainBundle]];
+ ConnectionIAPTableViewController *iapController = [iapControllerStoryboard instantiateInitialViewController];
+ self.networkConnectionWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
+ self.networkConnectionWindow.backgroundColor = UIColor.greenColor;
+ self.networkConnectionWindow.rootViewController = iapController;
+
+ self.window = self.networkConnectionWindow;
+ [self.window makeKeyAndVisible];
+
+ [ProxyManager.sharedManager startWithProxyTransportType:ProxyTransportTypeIAP];
+
+ return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
diff --git a/Example Apps/Example ObjC/Base.lproj/ConnectionIAPTableViewController.storyboard b/Example Apps/Example ObjC/Base.lproj/ConnectionIAPTableViewController.storyboard
index ec5eba61f..deca3f719 100644
--- a/Example Apps/Example ObjC/Base.lproj/ConnectionIAPTableViewController.storyboard
+++ b/Example Apps/Example ObjC/Base.lproj/ConnectionIAPTableViewController.storyboard
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15400" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="J12-ul-Tx1">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="J12-ul-Tx1">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15404"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
@@ -44,6 +44,27 @@
</constraints>
</tableViewCellContentView>
</tableViewCell>
+ <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="Mx9-1E-Df2">
+ <rect key="frame" x="0.0" y="54" width="375" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Mx9-1E-Df2" id="aKL-ab-vrF">
+ <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <subviews>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dhF-ce-EKB">
+ <rect key="frame" x="150" y="7" width="75" height="30"/>
+ <state key="normal" title="Show Alert"/>
+ <connections>
+ <action selector="showAlert:" destination="J12-ul-Tx1" eventType="touchUpInside" id="bN1-Ol-u2i"/>
+ </connections>
+ </button>
+ </subviews>
+ <constraints>
+ <constraint firstItem="dhF-ce-EKB" firstAttribute="centerX" secondItem="aKL-ab-vrF" secondAttribute="centerX" id="Jaw-St-ydT"/>
+ <constraint firstItem="dhF-ce-EKB" firstAttribute="centerY" secondItem="aKL-ab-vrF" secondAttribute="centerY" id="W8z-oz-qLD"/>
+ </constraints>
+ </tableViewCellContentView>
+ </tableViewCell>
</cells>
</tableViewSection>
</sections>
diff --git a/Example Apps/Example ObjC/ConnectionIAPTableViewController.m b/Example Apps/Example ObjC/ConnectionIAPTableViewController.m
index bfb931069..645d38b1d 100644
--- a/Example Apps/Example ObjC/ConnectionIAPTableViewController.m
+++ b/Example Apps/Example ObjC/ConnectionIAPTableViewController.m
@@ -3,9 +3,8 @@
// SmartDeviceLink-iOS
#import "ConnectionIAPTableViewController.h"
-
#import "ProxyManager.h"
-
+#import "SmartDeviceLink.h"
@interface ConnectionIAPTableViewController ()
@@ -95,5 +94,29 @@
}
}
+- (IBAction)showAlert:(id)sender {
+ UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"title" message:@"mesaage." preferredStyle:UIAlertControllerStyleActionSheet];
+ UIAlertAction *act1 = [UIAlertAction actionWithTitle:@"001" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+
+ }];
+ [alert addAction:act1];
+
+ int count = 1;
+ for (UIWindow *window in [UIApplication sharedApplication].windows) {
+ SDLLogE(@"\n%d:\n\t\trootviewController: %@\n\t\twindow: %@", count, window.rootViewController, window.self);
+ count += 1;
+ }
+
+ for (UIWindow *window in [UIApplication sharedApplication].windows) {
+ if (window.isKeyWindow) {
+ UIViewController *topViewController = window.rootViewController;
+ if (topViewController == nil) {
+ return;
+ }
+ [topViewController presentViewController:alert animated:YES completion:nil];
+ break;
+ }
+ }
+}
@end
diff --git a/Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist b/Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist
index 8e00f2ea6..1d001773f 100644
--- a/Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist
+++ b/Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist
@@ -47,8 +47,6 @@
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
- <key>UIMainStoryboardFile</key>
- <string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
index 09553a611..8af2ecde3 100644
--- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
+++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
@@ -1362,6 +1362,10 @@
88665B6C220B796A00D9DA77 /* SDLPerformAppServiceInteractionResponseSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 88665B6B220B796A00D9DA77 /* SDLPerformAppServiceInteractionResponseSpec.m */; };
88665B73220B80F400D9DA77 /* SDLWeatherAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = 88665B71220B80F400D9DA77 /* SDLWeatherAlert.h */; settings = {ATTRIBUTES = (Public, ); }; };
88665B74220B80F400D9DA77 /* SDLWeatherAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 88665B72220B80F400D9DA77 /* SDLWeatherAlert.m */; };
+ 886A03C723A28FC0001B0AF9 /* PasswordViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 886A03C523A28FC0001B0AF9 /* PasswordViewController.h */; };
+ 886A03C823A28FC0001B0AF9 /* PasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 886A03C623A28FC0001B0AF9 /* PasswordViewController.m */; };
+ 886A03CB23A28FD9001B0AF9 /* PopupViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 886A03C923A28FD9001B0AF9 /* PopupViewController.h */; };
+ 886A03CC23A28FD9001B0AF9 /* PopupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 886A03CA23A28FD9001B0AF9 /* PopupViewController.m */; };
8877F5EB1F34A3BE00DC128A /* SDLSendHapticDataSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 8877F5EA1F34A3BE00DC128A /* SDLSendHapticDataSpec.m */; };
8877F5EE1F34A72200DC128A /* SDLSendHapticDataResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 8877F5EC1F34A72200DC128A /* SDLSendHapticDataResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
8877F5EF1F34A72200DC128A /* SDLSendHapticDataResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 8877F5ED1F34A72200DC128A /* SDLSendHapticDataResponse.m */; };
@@ -3107,6 +3111,10 @@
88665B6B220B796A00D9DA77 /* SDLPerformAppServiceInteractionResponseSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLPerformAppServiceInteractionResponseSpec.m; sourceTree = "<group>"; };
88665B71220B80F400D9DA77 /* SDLWeatherAlert.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLWeatherAlert.h; sourceTree = "<group>"; };
88665B72220B80F400D9DA77 /* SDLWeatherAlert.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLWeatherAlert.m; sourceTree = "<group>"; };
+ 886A03C523A28FC0001B0AF9 /* PasswordViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PasswordViewController.h; sourceTree = "<group>"; };
+ 886A03C623A28FC0001B0AF9 /* PasswordViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PasswordViewController.m; sourceTree = "<group>"; };
+ 886A03C923A28FD9001B0AF9 /* PopupViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PopupViewController.h; sourceTree = "<group>"; };
+ 886A03CA23A28FD9001B0AF9 /* PopupViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PopupViewController.m; sourceTree = "<group>"; };
8877F5EA1F34A3BE00DC128A /* SDLSendHapticDataSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLSendHapticDataSpec.m; sourceTree = "<group>"; };
8877F5EC1F34A72200DC128A /* SDLSendHapticDataResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLSendHapticDataResponse.h; sourceTree = "<group>"; };
8877F5ED1F34A72200DC128A /* SDLSendHapticDataResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLSendHapticDataResponse.m; sourceTree = "<group>"; };
@@ -3970,6 +3978,10 @@
5D1FF2B421304580000EB9B4 /* ConnectionIAPTableViewController.m */,
5D1FF2B321304580000EB9B4 /* ConnectionTCPTableViewController.h */,
5D1FF2B621304581000EB9B4 /* ConnectionTCPTableViewController.m */,
+ 886A03C523A28FC0001B0AF9 /* PasswordViewController.h */,
+ 886A03C623A28FC0001B0AF9 /* PasswordViewController.m */,
+ 886A03C923A28FD9001B0AF9 /* PopupViewController.h */,
+ 886A03CA23A28FD9001B0AF9 /* PopupViewController.m */,
);
name = Connection;
sourceTree = "<group>";
@@ -6542,6 +6554,7 @@
1EB59CB3202D9B5F00343A61 /* SDLSeatMemoryActionType.h in Headers */,
88665B73220B80F400D9DA77 /* SDLWeatherAlert.h in Headers */,
008DB36122EA7482003F458C /* SDLGetInteriorVehicleDataConsent.h in Headers */,
+ 886A03CB23A28FD9001B0AF9 /* PopupViewController.h in Headers */,
1EB59CC3202DB40400343A61 /* SDLSeatControlCapabilities.h in Headers */,
1EB59CB7202D9C8100343A61 /* SDLSeatMemoryAction.h in Headers */,
1EB59CBB202DA1B400343A61 /* SDLSupportedSeat.h in Headers */,
@@ -6980,6 +6993,7 @@
5D61FE0B1A84238C00846EE7 /* SDLVehicleType.h in Headers */,
5D07C0312044AD0C00D1ECDC /* SDLAsynchronousRPCRequestOperation.h in Headers */,
5D61FCC31A84238C00846EE7 /* SDLHMIPermissions.h in Headers */,
+ 886A03C723A28FC0001B0AF9 /* PasswordViewController.h in Headers */,
5D61FE131A84238C00846EE7 /* SDLWiperStatus.h in Headers */,
5D07C02D2044AC9100D1ECDC /* SDLSequentialRPCRequestOperation.h in Headers */,
88EEC5BB220A327B005AA2F9 /* SDLPublishAppServiceResponse.h in Headers */,
@@ -7468,6 +7482,7 @@
5D61FD781A84238C00846EE7 /* SDLSamplingRate.m in Sources */,
1EAA472A2034388D000FE74B /* SDLAudioControlData.m in Sources */,
888DBAEC22D52431002A0AE2 /* SDLCloseApplication.m in Sources */,
+ 886A03CC23A28FD9001B0AF9 /* PopupViewController.m in Sources */,
5D61FC681A84238C00846EE7 /* SDLComponentVolumeStatus.m in Sources */,
5D61FDB61A84238C00846EE7 /* SDLSyncMsgVersion.m in Sources */,
5D61FC501A84238C00846EE7 /* SDLBodyInformation.m in Sources */,
@@ -7613,6 +7628,7 @@
5D76E3251D39767000647CFA /* SDLLockScreenPresenter.m in Sources */,
5D61FC771A84238C00846EE7 /* SDLDeleteFile.m in Sources */,
5D61FC811A84238C00846EE7 /* SDLDeleteSubMenuResponse.m in Sources */,
+ 886A03C823A28FC0001B0AF9 /* PasswordViewController.m in Sources */,
DA9F7E681DCBFAD400ACAE48 /* SDLOasisAddress.m in Sources */,
EEB19330205028BE00A8940C /* SDLControlFramePayloadTransportEventUpdate.m in Sources */,
5D61FC7B1A84238C00846EE7 /* SDLDeleteInteractionChoiceSet.m in Sources */,
diff --git a/SmartDeviceLink_Example/PasswordViewController.h b/SmartDeviceLink_Example/PasswordViewController.h
new file mode 100644
index 000000000..858a0708e
--- /dev/null
+++ b/SmartDeviceLink_Example/PasswordViewController.h
@@ -0,0 +1,17 @@
+//
+// PasswordViewController.h
+// SmartDeviceLink
+//
+// Created by Nicole on 12/12/19.
+// Copyright © 2019 smartdevicelink. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface PasswordViewController : UIViewController
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink_Example/PasswordViewController.m b/SmartDeviceLink_Example/PasswordViewController.m
new file mode 100644
index 000000000..90c4e0e96
--- /dev/null
+++ b/SmartDeviceLink_Example/PasswordViewController.m
@@ -0,0 +1,36 @@
+//
+// PasswordViewController.m
+// SmartDeviceLink
+//
+// Created by Nicole on 12/12/19.
+// Copyright © 2019 smartdevicelink. All rights reserved.
+//
+
+#import "PasswordViewController.h"
+
+@interface PasswordViewController ()
+
+@end
+
+@implementation PasswordViewController
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+ self.view.backgroundColor = UIColor.redColor;
+
+ UILabel *lable = [[UILabel alloc]initWithFrame:CGRectMake(60, 200, 350, 80)];
+ lable.text = NSLocalizedString(@"Password window. Should not show", @"comment");
+ [self.view addSubview:lable];
+}
+
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+ // Get the new view controller using [segue destinationViewController].
+ // Pass the selected object to the new view controller.
+}
+*/
+
+@end
diff --git a/SmartDeviceLink_Example/PopupViewController.h b/SmartDeviceLink_Example/PopupViewController.h
new file mode 100644
index 000000000..916e76213
--- /dev/null
+++ b/SmartDeviceLink_Example/PopupViewController.h
@@ -0,0 +1,17 @@
+//
+// PopupViewController.h
+// SmartDeviceLink
+//
+// Created by Nicole on 12/12/19.
+// Copyright © 2019 smartdevicelink. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface PopupViewController : UIViewController
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink_Example/PopupViewController.m b/SmartDeviceLink_Example/PopupViewController.m
new file mode 100644
index 000000000..ff5c77b47
--- /dev/null
+++ b/SmartDeviceLink_Example/PopupViewController.m
@@ -0,0 +1,36 @@
+//
+// PopupViewController.m
+// SmartDeviceLink
+//
+// Created by Nicole on 12/12/19.
+// Copyright © 2019 smartdevicelink. All rights reserved.
+//
+
+#import "PopupViewController.h"
+
+@interface PopupViewController ()
+
+@end
+
+@implementation PopupViewController
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+ self.view.backgroundColor = UIColor.blueColor;
+
+ UILabel *lable = [[UILabel alloc]initWithFrame:CGRectMake(60, 200, 350, 80)];
+ lable.text = NSLocalizedString(@"Popup window. Should not show", @"comment");
+ [self.view addSubview:lable];
+}
+
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+ // Get the new view controller using [segue destinationViewController].
+ // Pass the selected object to the new view controller.
+}
+*/
+
+@end