Selaa lähdekoodia

fix one drive navigation bar replace custom back bar button with system cancel button change status bar style

Tobias Conradi 10 vuotta sitten
vanhempi
commit
5bc53fb63c

+ 5 - 0
Sources/VLCOneDriveController.m

@@ -85,6 +85,7 @@
                 scopes:_liveScopes
               delegate:self
              userState:@"login"];
+    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:YES];
 }
 
 - (void)logout
@@ -109,6 +110,8 @@
 
 - (void)authCompleted:(LiveConnectSessionStatus)status session:(LiveConnectSession *)session userState:(id)userState
 {
+    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];
+
     APLog(@"OneDrive: authCompleted, status %i, state %@", status, userState);
 
     if (session != NULL && [userState isEqualToString:@"init"] && status == 1)
@@ -131,6 +134,8 @@
 
 - (void)authFailed:(NSError *)error userState:(id)userState
 {
+    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];
+
     APLog(@"OneDrive auth failed: %@, %@", error, userState);
     _activeSession = NO;
 

+ 2 - 3
Sources/VLCPlaybackController.h

@@ -16,10 +16,9 @@
 @class VLCPlaybackController;
 
 @protocol VLCPlaybackControllerDelegate <NSObject>
-
 @optional
 - (void)playbackPositionUpdated:(VLCPlaybackController *)controller;
-- (void)playbackRateUpdated:(float)rate forPlaybackController:(VLCPlaybackController *)controller;
+//- (void)playbackRateUpdated:(float)rate forPlaybackController:(VLCPlaybackController *)controller;
 - (void)mediaPlayerStateChanged:(VLCMediaPlayerState)currentState
                       isPlaying:(BOOL)isPlaying
 currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
@@ -29,7 +28,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
 - (void)presentingViewControllerShouldBeClosed:(VLCPlaybackController *)controller;
 - (void)presentingViewControllerShouldBeClosedAfterADelay:(VLCPlaybackController *)controller;
 - (void)showStatusMessage:(NSString *)statusMessage forPlaybackController:(VLCPlaybackController *)controller;
-- (void)audioOnlyPlaybackWasDetected:(BOOL)audioOnly forPlaybackController:(VLCPlaybackController *)controller;
+//- (void)audioOnlyPlaybackWasDetected:(BOOL)audioOnly forPlaybackController:(VLCPlaybackController *)controller;
 - (void)displayMetadataForPlaybackController:(VLCPlaybackController *)controller
                                        title:(NSString *)title
                                      artwork:(UIImage *)artwork

+ 48 - 0
patches/onedrive/0002-NavigationBar-UI-fixes.patch

@@ -0,0 +1,48 @@
+From 82221b97a7f0c35b5915471d21a6d1d88eba1e2e Mon Sep 17 00:00:00 2001
+From: Tobias Conradi <videolan@tobias-conradi.de>
+Date: Wed, 29 Apr 2015 22:19:20 +0200
+Subject: [PATCH] NavigationBar UI fixes
+
+---
+ src/LiveSDK/Library/Internal/LiveAuthDialog.m | 25 ++++++-------------------
+ 1 file changed, 6 insertions(+), 19 deletions(-)
+
+diff --git a/src/LiveSDK/Library/Internal/LiveAuthDialog.m b/src/LiveSDK/Library/Internal/LiveAuthDialog.m
+index ea3eba2..162085e 100644
+--- a/src/LiveSDK/Library/Internal/LiveAuthDialog.m
++++ b/src/LiveSDK/Library/Internal/LiveAuthDialog.m
+@@ -75,25 +75,12 @@
+     [super viewDidLoad];
+     
+     self.webView.delegate = self;
+-    
+-    // Override the left button to show a back button
+-    // which is used to dismiss the modal view    
+-    UIImage *buttonImage = [LiveAuthHelper getBackButtonImage]; 
+-    //create the button and assign the image
+-    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
+-    [button setImage:buttonImage 
+-            forState:UIControlStateNormal];
+-    //set the frame of the button to the size of the image
+-    button.frame = CGRectMake(0, 0, buttonImage.size.width, buttonImage.size.height);
+-    
+-    [button addTarget:self 
+-               action:@selector(dismissView:) 
+-     forControlEvents:UIControlEventTouchUpInside]; 
+-    
+-    //create a UIBarButtonItem with the button as a custom view
+-    self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc]
+-                                              initWithCustomView:button]autorelease];  
+-    
++
++	UIBarButtonItem *dismissBarButton = [[[UIBarButtonItem alloc]
++										  initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
++										  target:self action:@selector(dismissView:)]autorelease];
++	self.navigationItem.leftBarButtonItem = dismissBarButton;
++
+     //Load the Url request in the UIWebView.
+     NSURLRequest *requestObj = [NSURLRequest requestWithURL:_startUrl];
+     [webView loadRequest:requestObj];    
+-- 
+2.2.1
+