Skip to content

Commit

Permalink
Added sidebar. UI improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
syahmi committed Sep 23, 2012
1 parent d77318b commit 68a052a
Show file tree
Hide file tree
Showing 49 changed files with 950 additions and 21 deletions.
149 changes: 141 additions & 8 deletions WaktuSolat.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions WaktuSolat/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#import "AppDelegate.h"
#import "KawasanViewController.h"
#import "WaktuSolatViewController.h"
#import "MFSideMenu.h"
#import "SideMenuViewController.h"

@implementation AppDelegate

Expand Down Expand Up @@ -62,7 +64,17 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
self.window.rootViewController = navigationController;
[self.window makeKeyAndVisible];

SideMenuViewController *sideMenuViewController = [[SideMenuViewController alloc] init];

MenuOptions options = MenuButtonEnabled|BackButtonEnabled;
// make sure to display the navigation controller before calling this
[MFSideMenuManager configureWithNavigationController:navigationController
sideMenuController:sideMenuViewController
menuSide:MenuLeftHandSide
options:options];

[self _rateApp];
[SideMenuViewController release];

return YES;
}
Expand Down
10 changes: 9 additions & 1 deletion WaktuSolat/KawasanViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ - (void)viewDidAppear:(BOOL)animated
self.navigationController.toolbarHidden = YES;
}

- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];

self.tableView.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mainBackground.png"]];
}

- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
Expand Down Expand Up @@ -80,6 +87,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

if(cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier] autorelease];
cell.backgroundView = [ [[UIImageView alloc] initWithImage:[ [UIImage imageNamed:@"cellBackgroundLocation.png"] stretchableImageWithLeftCapWidth:0.0 topCapHeight:5.0] ]autorelease];
cell.textLabel.font = [UIFont fontWithName:@"Helvetica" size:16];
cell.selectionStyle = UITableViewCellSelectionStyleGray;
}
Expand All @@ -105,7 +113,7 @@ - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger
{
UIView *headerView = [[UIView alloc] init];
headerView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"headerView.png"]];
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 1, 320, 20)];
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 1, 320, 20)];
titleLabel.text = [self tableView:tableView titleForHeaderInSection:section];
titleLabel.shadowColor = [UIColor whiteColor];
titleLabel.shadowOffset = CGSizeMake(0.5, 0.5);
Expand Down
13 changes: 13 additions & 0 deletions WaktuSolat/MFSideMenu/MFSideMenu.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// MFSideMenu.h
//
// Created by Michael Frederick on 3/17/12.
//

#ifndef MFSideMenu_h
#define MFSideMenu_h

#import "MFSideMenuManager.h"
#import "UIViewController+MFSideMenu.h"

#endif
47 changes: 47 additions & 0 deletions WaktuSolat/MFSideMenu/MFSideMenuManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//
// MFSideMenuManager.h
//
// Created by Michael Frederick on 3/18/12.
//

#import <Foundation/Foundation.h>

#define kSidebarWidth 270

typedef enum {
MenuLeftHandSide, // show the menu on the left hand side
MenuRightHandSide // show the menu on the right hand side
} MenuSide;

typedef enum {
MenuButtonEnabled = 1 << 0, // enable the 'menu' UIBarButtonItem
BackButtonEnabled = 1 << 1 // enable the 'back' UIBarButtonItem
} MenuOptions;


@interface MFSideMenuManager : NSObject<UIGestureRecognizerDelegate> {
CGPoint originalOrigin;
}

@property (nonatomic, strong) UINavigationController *navigationController;
@property (nonatomic, strong) UITableViewController *sideMenuController;
@property (nonatomic, assign) MenuSide menuSide;
@property (nonatomic, assign) MenuOptions options;

+ (MFSideMenuManager *) sharedManager;

+ (void) configureWithNavigationController:(UINavigationController *)controller
sideMenuController:(id)menuController;

+ (void) configureWithNavigationController:(UINavigationController *)controller
sideMenuController:(id)menuController
menuSide:(MenuSide)side
options:(MenuOptions)options;

// the x position of the nav controller when the menu is shown
+ (CGFloat) menuVisibleNavigationControllerXPosition;

+ (BOOL) menuButtonEnabled;
+ (BOOL) backButtonEnabled;

@end
Loading

0 comments on commit 68a052a

Please sign in to comment.