Permalink
Browse files

webcast fix. timetable portrait mode. homepage portrait mode. homepag…

…e UI
  • Loading branch information...
satyamag committed Jul 14, 2011
1 parent a46d6b8 commit c8dc18d776f55cee485ad06efe4bd060cd8de197
@@ -41,12 +41,12 @@
</object>
<object class="IBUIView" id="707596870">
<reference key="NSNextResponder"/>
- <int key="NSvFlags">274</int>
+ <int key="NSvFlags">302</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIImageView" id="499157365">
<reference key="NSNextResponder" ref="707596870"/>
- <int key="NSvFlags">292</int>
+ <int key="NSvFlags">302</int>
<string key="NSFrameSize">{824, 50}</string>
<reference key="NSSuperview" ref="707596870"/>
<reference key="NSWindow"/>
@@ -60,7 +60,7 @@
</object>
<object class="IBUILabel" id="295649998">
<reference key="NSNextResponder" ref="707596870"/>
- <int key="NSvFlags">292</int>
+ <int key="NSvFlags">294</int>
<string key="NSFrame">{{123, 5}, {267, 21}}</string>
<reference key="NSSuperview" ref="707596870"/>
<reference key="NSWindow"/>
@@ -91,7 +91,7 @@
</object>
<object class="IBUILabel" id="294065560">
<reference key="NSNextResponder" ref="707596870"/>
- <int key="NSvFlags">292</int>
+ <int key="NSvFlags">294</int>
<string key="NSFrame">{{133, 24}, {246, 21}}</string>
<reference key="NSSuperview" ref="707596870"/>
<reference key="NSWindow"/>
@@ -116,7 +116,7 @@
</object>
<object class="IBUIImageView" id="264278459">
<reference key="NSNextResponder" ref="707596870"/>
- <int key="NSvFlags">292</int>
+ <int key="NSvFlags">294</int>
<string key="NSFrame">{{0, 51}, {512, 138}}</string>
<reference key="NSSuperview" ref="707596870"/>
<reference key="NSWindow"/>
@@ -126,7 +126,7 @@
</object>
<object class="IBUIWebView" id="652037548">
<reference key="NSNextResponder" ref="707596870"/>
- <int key="NSvFlags">292</int>
+ <int key="NSvFlags">294</int>
<string key="NSFrame">{{0, 51}, {512, 138}}</string>
<reference key="NSSuperview" ref="707596870"/>
<reference key="NSWindow"/>
@@ -141,7 +141,7 @@
</object>
<object class="IBUIImageView" id="899213233">
<reference key="NSNextResponder" ref="707596870"/>
- <int key="NSvFlags">292</int>
+ <int key="NSvFlags">293</int>
<string key="NSFrame">{{487, 27}, {15, 15}}</string>
<reference key="NSSuperview" ref="707596870"/>
<reference key="NSWindow"/>
@@ -244,10 +244,10 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="899213233"/>
<reference ref="294065560"/>
- <reference ref="652037548"/>
<reference ref="264278459"/>
<reference ref="499157365"/>
<reference ref="295649998"/>
+ <reference ref="652037548"/>
</object>
<reference key="parent" ref="0"/>
</object>
View
@@ -29,7 +29,6 @@
IBOutlet UITableView *recentAnnouncements, *recentTimetable;
- IBOutlet UIView *timetable;
NSMutableArray *announcementCells;
NSMutableArray *timetableCells;
NSMutableArray *announcements;
View
@@ -35,7 +35,14 @@ @implementation IVLEMain
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
- UIImage *blackboardImage = [UIImage imageNamed:@"home_page_announcements_bg.png"];
+
+ NSString *imageName;
+ if ([UIDevice currentDevice].orientation!=UIDeviceOrientationLandscapeLeft && [UIDevice currentDevice].orientation!=UIDeviceOrientationLandscapeRight) {
+ imageName= @"home_page_announcements_bg_portrait.png";
+ }
+ else imageName= @"home_page_announcements_bg.png";
+
+ UIImage *blackboardImage = [UIImage imageNamed:imageName];
[self.view setBackgroundColor:[UIColor colorWithPatternImage:blackboardImage]];
//added by SJ, memory managemment
@@ -49,6 +56,8 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
return self;
}
+
+
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
@@ -57,11 +66,11 @@ - (void)viewDidLoad {
UIImage *bgImage = [UIImage imageNamed:@"modules_workbin_3rd_column.png"];
- timetable.tag = kHomePageTimetableViewTag;
+ recentTimetable.tag = kHomePageTimetableViewTag;
recentAnnouncements.tag = kHomePageAnnouncementsViewTag;
self.view.frame = CGRectMake(0,0,1024, 768);
- [timetable setBackgroundColor:[UIColor colorWithPatternImage:bgImage]];
+ [recentTimetable setBackgroundColor:[UIColor colorWithPatternImage:bgImage]];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshScreen:) name:kNotificationRefreshScreen object:nil];
@@ -90,30 +99,12 @@ - (void)viewDidLoad {
}
[[NSNotificationCenter defaultCenter] postNotificationName:kNotificationSetupHomePageComponents object:nil];
}
-
-
+ [self.view setAutoresizesSubviews:YES];
/*if ([IVLE instance].authenticationToken == nil) {
[self performSelector:@selector(displayLogin) withObject:nil afterDelay:0.0];
}*/
}
-
-//- (void) memoryManagementOfViewControllers: (id) mainScreen {
-// //return;
-// NSLog(@"inmemoryManagementOfViewControllers");
-// //memory management by SJ
-// if (currentActiveMainViewController != nil) {
-// if (kDebugMemoryManagement) {
-// NSLog(@"released %@", currentActiveMainViewController);
-// }
-// [currentActiveMainViewController release];
-// currentActiveMainViewController = nil;
-// }
-// if (kDebugMemoryManagement){
-// NSLog(@"assigning %@", mainScreen);
-// }
-// currentActiveMainViewController = mainScreen;
-//
-//}
+
-(void) setUpHomePageComponents:(NSNotification*)notification {
@@ -122,7 +113,6 @@ -(void) setUpHomePageComponents:(NSNotification*)notification {
[self.view addSubview:recentAnnouncements];
- [self.view addSubview:timetable];
[pageControlView addSubview:eventsPageControl];
[rightHandSideView addSubview:pageControlView];
[rightHandSideView addSubview:eventsScrollView];
@@ -131,6 +121,7 @@ -(void) setUpHomePageComponents:(NSNotification*)notification {
}
- (void) setUpEventsView {
+ NSLog(@"%f,%f",eventsScrollView.frame.size.width,eventsScrollView.frame.size.height);
//setting up events
eventsScrollView.delegate = self;
@@ -224,22 +215,6 @@ - (IBAction)changePage:(id)sender
pageControlIsChangingPage = YES;
}
-//-(void)backToLogin:(NSNotification*)notification {
-//
-// while ([[self.view subviews] count]) {
-// [[[self.view subviews] lastObject] removeFromSuperview];
-// }
-//
-//
-// IVLELoginNew *login = [[IVLELoginNew alloc] init];
-//
-// [self memoryManagementOfViewControllers:login];
-// login.view.frame= CGRectMake(0, 50, 1024, 718);
-// login.wantsFullScreenLayout = YES;
-// login.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
-// login.modalPresentationStyle = UIModalPresentationCurrentContext;
-// [self presentModalViewController:login animated:NO];
-//}
-(void) viewDidAppear:(BOOL)animated {
@@ -290,8 +265,15 @@ -(void) setUpAnnouncementsView {
for (int i=0; i<[announcements count]; i++) {
HomePageModuleAnnouncementCell *cell;
+
+ NSString *orientationIdentifier;
+ if ([UIDevice currentDevice].orientation!=UIDeviceOrientationLandscapeLeft && [UIDevice currentDevice].orientation!=UIDeviceOrientationLandscapeRight) {
+ orientationIdentifier= @"HomePageModuleAnnouncementCellPortrait";
+ }
+ else orientationIdentifier= @"HomePageModuleAnnouncementCell";
+
- NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"HomePageModuleAnnouncementCell"
+ NSArray *nib = [[NSBundle mainBundle] loadNibNamed:orientationIdentifier
owner:self
options:nil];
cell = [nib objectAtIndex:0];
@@ -328,7 +310,7 @@ -(void) setUpAnnouncementsView {
[announcementCells addObject:cell];
}
- [NSTimer scheduledTimerWithTimeInterval:2.5 target:self selector:@selector(updateAnnouncementsTable) userInfo:nil repeats:NO];
+ [NSTimer scheduledTimerWithTimeInterval:4.0 target:self selector:@selector(updateAnnouncementsTable) userInfo:nil repeats:NO];
}
-(void) updateAnnouncementsTable {
@@ -447,6 +429,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.eventDate.textColor = kWorkbinFontColor;
// cell.eventType.textColor = kWorkbinFontColor;
cell.backgroundColor = [UIColor clearColor];
+
return cell;
}
@@ -491,6 +474,13 @@ - (void)displayLogin{
[self presentModalViewController:login animated:NO];
}
+-(void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
+ if (fromInterfaceOrientation == UIInterfaceOrientationPortrait || fromInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
+ [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"home_page_announcements_bg.png"]]];
+ }
+ else
+ [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"home_page_announcements_bg_portrait.png"]]];
+}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Overriden to allow any orientation.
@@ -521,7 +511,7 @@ - (void)viewDidUnload {
- (void)dealloc {
//NSLog(@"main dealloc");
- [timetable release];
+ [recentTimetable release];
[recentAnnouncements release];
[timetableCells release];
Oops, something went wrong.

0 comments on commit c8dc18d

Please sign in to comment.