Today's Menu  Portugal
journal and plan nutrition
Y3GmailViewFooter.m
Go to the documentation of this file.
1 //
2 // Y3MailcoreViewFooter.m
3 // TodaysMenu
4 //
5 // Created by Don Zeek on 6/9/17.
6 // Copyright © 2017 net.dzeek.y2015.ios.portfolio. All rights reserved.
7 //
8 
9 
10 #import "Y3GmailViewFooter.h"
12 #import "Z5DataController.h"
15 
16 @implementation Y3GmailViewFooter
17 {
18  UIButton *scanEmailServerButton;
19  id<Y3GmailFooterDelegate, WKNavigationDelegate> gmailFtrDelegate;
20  // WKWebView *webView;
22  // float messageViewHeight;
23  CGRect viewBound;
24 }
25 // float testServerBarViewHeight = 42;
26 
27 - (instancetype) initWithDelegate:(id<Y3GmailFooterDelegate, WKNavigationDelegate>) delegate
28 {
29  self = [super init];
30  if (self) {
32  // messageViewHeight = 80;
34  }
35  return self;
36 }
37 
39 {
40  Z5GoogleLoginController *loginControl = [[[Z5DataController sharedInstance] remoteDataController] loginController];
41  float ret = 0.0;
42  if ([[loginControl signedIn] boolValue]) {
44  }
45  return ret;
46 }
47 - (void) appear:(CGRect)bound
48 {
49  [self setBackgroundColor:[UIColor greenColor]];
50  viewBound = bound;
51  [self addScanServerButton];
52 }
54 {
55  Z5GoogleLoginController *loginControl = [[[Z5DataController sharedInstance] remoteDataController] loginController];
56  if ([[loginControl signedIn] boolValue]) {
57 
58  CGRect scanEmailServerButtonFrame = CGRectMake(viewBound.size.width/2 + 2, 2.0, viewBound.size.width/2 - 4, scanMailBarViewHeight - 4.0);
59  scanEmailServerButton = [[UIButton alloc] initWithFrame:scanEmailServerButtonFrame];
60  [scanEmailServerButton setTitle:@"scan server" forState:UIControlStateNormal];
61  [scanEmailServerButton setTintColor:[UIColor blackColor]];
62  [scanEmailServerButton addTarget:self action:@selector(clickedScanServer) forControlEvents:UIControlEventTouchUpInside];
63  [scanEmailServerButton addGradientFace:[UIColor cyanColor]];
64  [self addSubview:scanEmailServerButton];
65  }
66 }
67 
69 {
70  [gmailFtrDelegate didTapScanServer];
71 }
72 
73 #pragma mark - Y3GmailLoginListener
74 - (void) signedIn: (GIDGoogleUser *)user
75 {
76  NSLog(@"GmailViewController.signedIn: %@", user.profile.name);
77  [self addScanServerButton];
78 }
79 - (void) signedOut:(GIDGoogleUser *)user
80 {
81  // self.service = nil;
82 }
83 
84 /*
85 // Only override drawRect: if you perform custom drawing.
86 // An empty implementation adversely affects performance during animation.
87 - (void)drawRect:(CGRect)rect {
88  // Drawing code
89 }
90 */
91 
92 @end
GIDProfileData * profile
Definition: GIDGoogleUser.h:24
instancetype sharedInstance()
id< U7ParamEditControlDelegate > delegate
Singleton interface to both core and remote data sources.
NSString * name