From 3555d60a9bf5438f934d9c4f9812b76e98cb491c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 22 Dec 2018 21:43:37 -0800 Subject: [PATCH] Add a quit tip for iOS and tvOS --- .../ViewControllers/StreamFrameViewController.h | 1 + .../ViewControllers/StreamFrameViewController.m | 13 ++++++++++++- Moonlight TV/Base.lproj/Main.storyboard | 8 ++++++++ iPad.storyboard | 8 ++++++++ iPhone.storyboard | 8 ++++++++ 5 files changed, 37 insertions(+), 1 deletion(-) diff --git a/Limelight/ViewControllers/StreamFrameViewController.h b/Limelight/ViewControllers/StreamFrameViewController.h index 77aaea5..94b765d 100644 --- a/Limelight/ViewControllers/StreamFrameViewController.h +++ b/Limelight/ViewControllers/StreamFrameViewController.h @@ -20,6 +20,7 @@ @interface StreamFrameViewController : UIViewController #endif @property (strong, nonatomic) IBOutlet UILabel *stageLabel; +@property (strong, nonatomic) IBOutlet UILabel *tipLabel; @property (strong, nonatomic) IBOutlet UIActivityIndicatorView *spinner; @property (nonatomic) StreamConfiguration* streamConfig; diff --git a/Limelight/ViewControllers/StreamFrameViewController.m b/Limelight/ViewControllers/StreamFrameViewController.m index 75fe0c1..ec8c822 100644 --- a/Limelight/ViewControllers/StreamFrameViewController.m +++ b/Limelight/ViewControllers/StreamFrameViewController.m @@ -71,7 +71,17 @@ [self.view addGestureRecognizer:_menuGestureRecognizer]; [self.view addGestureRecognizer:_menuDoubleTapGestureRecognizer]; #endif - + +#if TARGET_OS_TV + [self.tipLabel setText:@"Tip: Double tap the Menu button to disconnect from your PC"]; +#else + [self.tipLabel setText:@"Tip: Swipe from the left edge to disconnect from your PC"]; +#endif + + [self.tipLabel sizeToFit]; + self.tipLabel.textAlignment = NSTextAlignmentCenter; + self.tipLabel.center = CGPointMake(self.view.frame.size.width / 2, self.tipLabel.center.y); + _streamMan = [[StreamManager alloc] initWithConfig:self.streamConfig renderView:self.view connectionCallbacks:self]; @@ -165,6 +175,7 @@ // Leave the spinner spinning until it's obscured by // the first frame of video. self.stageLabel.hidden = YES; + self.tipLabel.hidden = YES; #if !TARGET_OS_TV [(StreamView*)self.view setupOnScreenControls: self->_controllerSupport swipeDelegate:self]; #endif diff --git a/Moonlight TV/Base.lproj/Main.storyboard b/Moonlight TV/Base.lproj/Main.storyboard index 2645447..f2fb285 100644 --- a/Moonlight TV/Base.lproj/Main.storyboard +++ b/Moonlight TV/Base.lproj/Main.storyboard @@ -119,12 +119,20 @@ + + diff --git a/iPad.storyboard b/iPad.storyboard index 0adef8d..1c6e146 100644 --- a/iPad.storyboard +++ b/iPad.storyboard @@ -292,6 +292,13 @@ + @@ -305,6 +312,7 @@ + diff --git a/iPhone.storyboard b/iPhone.storyboard index 98cf8a8..3f2ee24 100644 --- a/iPhone.storyboard +++ b/iPhone.storyboard @@ -293,6 +293,13 @@ + @@ -306,6 +313,7 @@ +