Browse Source

plex: add access to side menu with menu button at left in navigation bar

Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
Pierre SAGASPE 10 years ago
parent
commit
332c698fd9
1 changed files with 13 additions and 2 deletions
  1. 13 2
      Sources/VLCLocalPlexFolderListViewController.m

+ 13 - 2
Sources/VLCLocalPlexFolderListViewController.m

@@ -20,11 +20,10 @@
 #import "NSString+SupportedMedia.h"
 #import "VLCStatusLabel.h"
 #import "VLCAlertView.h"
+#import "UIBarButtonItem+Theme.h"
 
 @interface VLCLocalPlexFolderListViewController () <UITableViewDataSource, UITableViewDelegate, VLCLocalNetworkListCell, UISearchBarDelegate, UISearchDisplayDelegate>
 {
-    UIBarButtonItem *_backButton;
-
     NSMutableArray *_mutableObjectList;
     NSCache *_imageCache;
 
@@ -38,6 +37,7 @@
     UISearchBar *_searchBar;
     UISearchDisplayController *_searchDisplayController;
     UIRefreshControl *_refreshControl;
+    UIBarButtonItem *_menuButton;
 }
 @end
 
@@ -123,6 +123,9 @@
     [_refreshControl addTarget:self action:@selector(handleRefresh) forControlEvents:UIControlEventValueChanged];
     [self.tableView addSubview:_refreshControl];
 
+    _menuButton = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(menuButtonAction:)];
+    self.navigationItem.rightBarButtonItem = _menuButton;
+
     _searchData = [[NSMutableArray alloc] init];
     [_searchData removeAllObjects];
 }
@@ -135,6 +138,14 @@
     return YES;
 }
 
+- (IBAction)menuButtonAction:(id)sender
+{
+    [[(VLCAppDelegate*)[UIApplication sharedApplication].delegate revealController] toggleSidebar:![(VLCAppDelegate*)[UIApplication sharedApplication].delegate revealController].sidebarShowing duration:kGHRevealSidebarDefaultAnimationDuration];
+
+    if (self.isEditing)
+        [self setEditing:NO animated:YES];
+}
+
 #pragma mark - Table view data source
 
 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView