Today's Menu  Portugal
journal and plan nutrition
Instance Methods | List of all members
P2SnapMealGalleryViewController Class Reference

#import <P2SnapMealGalleryViewController.h>

Inheritance diagram for P2SnapMealGalleryViewController:
Inheritance graph
[legend]
Collaboration diagram for P2SnapMealGalleryViewController:
Collaboration graph
[legend]

Instance Methods

(void) - viewDidLoad [implementation]
 
(void) - viewWillAppear: [implementation]
 
(void) - deviceOrientationDidChange: [implementation]
 
(void) - orientLoadUI [implementation]
 
(void) - viewDidLoadPortrait [implementation]
 
(void) - viewDidLoadLandscape [implementation]
 
(void) - orientAppearUI [implementation]
 
(void) - viewDidAppearPortrait [implementation]
 
(void) - viewDidAppearLandscape [implementation]
 
(void) - fetchScaleBackgroundImg [implementation]
 
(CGRect) - screenBound [implementation]
 
(void) - clickedMeal:atRow: [implementation]
 

Detailed Description

Snap Meals Gallery

dot_inline_dotgraph_3.png
msc_inline_mscgraph_1

Definition at line 15 of file P2SnapMealGalleryViewController.h.

Method Documentation

◆ clickedMeal:atRow:()

- (void) clickedMeal: (Meal *)  meal
atRow: (NSUInteger)  row 
implementation

Definition at line 234 of file P2SnapMealGalleryViewController.m.

234  : (Meal *)meal atRow: (NSUInteger)row
235 {
236 
237 }

◆ deviceOrientationDidChange:()

- (void) deviceOrientationDidChange: (NSNotification *)  notification
implementation

Definition at line 99 of file P2SnapMealGalleryViewController.m.

99  :(NSNotification *)notification {
100  NSLog(@"P2SnapMealGalleryViewController.deviceOrientationDidChange: %@", notification);
101  [self orientAppearUI];
102 }

◆ fetchScaleBackgroundImg()

- (void) fetchScaleBackgroundImg
implementation

Definition at line 210 of file P2SnapMealGalleryViewController.m.

211 {
212  // fetch, scale, and add a subview background image
213  CGRect totalFrame = self.view.frame;
214  mealGalleryOverallSize = totalFrame.size;
215  UIImage *backgrdImage = [UIImage imageNamed:@"elphie.png"];
216  CGSize photoSize = [backgrdImage size];
217  float resizeRatio = photoSize.height / totalFrame.size.height;
218  UIImage *resizedImage = [UIImage imageWithCGImage:[backgrdImage CGImage]
219  scale:backgrdImage.scale * resizeRatio
220  orientation:(backgrdImage.imageOrientation) ];
221  snapGalleryImageBackground = [[UIImageView alloc] initWithImage:resizedImage];
222  [self.view addSubview:snapGalleryImageBackground];
223  // end - fetch, scale, and add a subview background image
224 }

◆ orientAppearUI()

- (void) orientAppearUI
implementation

Definition at line 172 of file P2SnapMealGalleryViewController.m.

172  {
173  NSLog(@"P2SnapMealViewController.orientAppearUI");
174  UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
175  switch (orientation)
176  {
177  case UIDeviceOrientationPortrait:
178  case UIDeviceOrientationFaceUp:
179  {
180  [self viewDidAppearPortrait];
181  }
182  break;
183  case UIDeviceOrientationLandscapeLeft:
184  case UIDeviceOrientationLandscapeRight:
185  {
186  [self viewDidAppearLandscape];
187  }
188  break;
189  default:
190  {
191  NSLog(@"P2SnapMealViewController.viewDidLoad: unk orrientation");
192  }
193  break;
194  }
195 }

◆ orientLoadUI()

- (void) orientLoadUI
implementation

Definition at line 104 of file P2SnapMealGalleryViewController.m.

104  {
105  NSLog(@"P2SnapMealGalleryViewController.orientLoadUI");
106  UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
107  switch (orientation)
108  {
109  case UIDeviceOrientationPortrait:
110  case UIDeviceOrientationFaceUp:
111  {
112  [self viewDidLoadPortrait];
113  }
114  break;
115  case UIDeviceOrientationLandscapeLeft:
116  case UIDeviceOrientationLandscapeRight:
117  {
118  [self viewDidLoadLandscape];
119  }
120  break;
121  default:
122  {
123  NSLog(@"P2SnapMealGalleryViewController.orientLoadUI: unk orrientation");
124  }
125  break;
126  }
127 }

◆ screenBound()

- (CGRect) screenBound
implementation

Definition at line 225 of file P2SnapMealGalleryViewController.m.

226 {
227  CGRect bound = self.view.bounds;
228  NSLog(@"P2SnapMealViewController.screenBound: bound: (%3.2f,%3.2f)-(%3.2fx%3.2f",
229  bound.origin.x, bound.origin.y, bound.size.width, bound.size.height);
230  return bound;
231 }

◆ viewDidAppearLandscape()

- (void) viewDidAppearLandscape
implementation

Definition at line 205 of file P2SnapMealGalleryViewController.m.

206 {
207  NSLog(@"P2SnapMealViewController.viewDidAppearLandscape");
208 }

◆ viewDidAppearPortrait()

- (void) viewDidAppearPortrait
implementation

Definition at line 197 of file P2SnapMealGalleryViewController.m.

198 {
199  CGRect bound = self.view.bounds;
200  // NSLog(@"P2SnapMealViewController.viewDidAppearPortrait: bound: (%3.2f,%3.2f)-(%3.2fx%3.2f)",
201  // bound.origin.x, bound.origin.y, bound.size.width, bound.size.height);
202  [tableSpecial appear:bound];
203 }

◆ viewDidLoad()

- (void) viewDidLoad
implementation

Definition at line 80 of file P2SnapMealGalleryViewController.m.

81 {
82  [super viewDidLoad];
83  self.title = @"Meal Memory Lane";
84 
85  [self orientLoadUI];
86 
87  [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
88  [[NSNotificationCenter defaultCenter] addObserver:self
89  selector:@selector(deviceOrientationDidChange:)
90  name: UIDeviceOrientationDidChangeNotification
91  object: nil];
92 }

◆ viewDidLoadLandscape()

- (void) viewDidLoadLandscape
implementation

Definition at line 147 of file P2SnapMealGalleryViewController.m.

148 {
149  navbarBottomEdge = self.navigationController.navigationBar.frame.origin.y
150  + self.navigationController.navigationBar.frame.size.height;
151 
152  // fetch, scale, and add a subview background image
153  CGRect totalFrame = self.view.frame;
154  mealGalleryOverallSize = totalFrame.size;
155  UIImage *backgrdImage = [UIImage imageNamed:@"elphieLandscape.png"];
156  CGSize photoSize = [backgrdImage size];
157  float resizeRatio = photoSize.width / totalFrame.size.width;
158  UIImage *resizedImage = [UIImage imageWithCGImage:[backgrdImage CGImage]
159  scale:backgrdImage.scale * resizeRatio
160  orientation:(backgrdImage.imageOrientation) ];
161  snapGalleryImageBackground = [[UIImageView alloc] initWithImage:resizedImage];
162  [self.view addSubview:snapGalleryImageBackground];
163  // end - fetch, scale, and add a subview background image
164 
165  float tableWidth = self.view.bounds.size.width;
166  CGRect headFrame = CGRectMake(4.0, navbarBottomEdge, tableWidth - 12.0, 420.0); tableSpecial = [[U5MealPanoramaView alloc] initWithFrame:headFrame andDelegate:self];
167  float headerVert = [tableSpecial heightRequirement];
168  NSLog(@"P2SnapMealViewController.viewDidLoadLandscape: headerVert: %3.2f", headerVert);
169  [tableSpecial reloadMeals];
170 }

◆ viewDidLoadPortrait()

- (void) viewDidLoadPortrait
implementation

Definition at line 129 of file P2SnapMealGalleryViewController.m.

130 {
131  navbarBottomEdge = self.navigationController.navigationBar.frame.origin.y
132  + self.navigationController.navigationBar.frame.size.height;
133 
134  [self fetchScaleBackgroundImg];
135 
136  float tableWidth = self.view.bounds.size.width;
137  float tableHeight = self.view.bounds.size.height - navbarBottomEdge;
138  CGRect headFrame = CGRectMake(4.0, navbarBottomEdge+4.0, tableWidth-8.0, tableHeight-8.0);
139 
140  tableSpecial = [[U5MealPanoramaView alloc] initWithFrame:headFrame andDelegate:self];
141  float headerVert = [tableSpecial heightRequirement];
142  NSLog(@"P2SnapMealViewController.viewDidLoadPortrait: headerVert: %3.2f", headerVert);
143  [tableSpecial reloadMeals];
144  [self.view addSubview:tableSpecial];
145 }

◆ viewWillAppear:()

- (void) viewWillAppear: (BOOL)  animated
implementation

Definition at line 94 of file P2SnapMealGalleryViewController.m.

94  :(BOOL)animated
95 {
96  [self orientAppearUI];
97 }

The documentation for this class was generated from the following files: