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

#import <Y3GmailViewHeader.h>

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

Instance Methods

(instancetype) - initWithDelegate:
 
(void) - appear:
 
(void) - signedIn: [implementation]
 
(void) - signedOut: [implementation]
 

Class Methods

(float) + heightRequirement
 

Properties

GIDSignInButtonsignInButton
 
id< Y3GmailHeaderProtocol > msgHeaderDelegate
 

Detailed Description

Definition at line 21 of file Y3GmailViewHeader.h.

Method Documentation

◆ appear:()

- (void) appear: (CGRect)  frame

Definition at line 36 of file Y3GmailViewHeader.m.

36  :(CGRect)bound
37 {
38  // CGRect totalFrame = self.frame;
39  NSLog(@"GmailViewHeader.appear: size: %3.2f x %3.2f",
40  [self bounds].size.width, [self bounds].size.height);
41 
42  Z5GoogleLoginController *loginControl = [[[Z5DataController sharedInstance] remoteDataController] loginController];
43 
44  Boolean isLoggedIn = [[loginControl signedIn] boolValue];
45  if (isLoggedIn) {
46  [self.contentView setBackgroundColor:[UIColor brownColor]];
47 
48  CGRect loginInfoLabelFrame = CGRectMake(2.0, 2.0, bound.size.width/2, loginInfoViewHeight - 4.0);
49 
50  loginInfoLabel = [[UILabel alloc] initWithFrame:loginInfoLabelFrame];
51  [loginInfoLabel setFont:[UIFont fontWithName:@"Helvetica-Bold" size:16.0]];
52  [loginInfoLabel setTextAlignment:NSTextAlignmentCenter];
53  [loginInfoLabel setBackgroundColor:[[Z5DataController sharedInstance] wheatColor]];
54  // [loginInfoLabel setTextColor:[UIColor blackColor]];
55  [self addSubview:loginInfoLabel];
56  NSString *loginName = [[_msgHeaderDelegate getLoggedInProfile] name];
57  [loginInfoLabel setText:loginName];
58 
59  } else {
60  CGRect signInButtonFrame = CGRectMake(bound.size.width/2 + 2,
61  2.0,
62  bound.size.width/2 - 4,
64 
65 
66 
67 
68  [loginControl configureGoogleSignIn];
70  signIn.uiDelegate = (id<GIDSignInUIDelegate>)_msgHeaderDelegate;
71  signIn.delegate = loginControl;
72 
73  _signInButton = [[GIDSignInButton alloc] init];
74  [_signInButton setFrame:signInButtonFrame];
75  _signInButton.layer.cornerRadius = 8;
76  _signInButton.layer.borderColor = [[UIColor blackColor] CGColor];
77  _signInButton.layer.borderWidth = 3.0;
78  _signInButton .clipsToBounds = YES;
79  [self addSubview:_signInButton];
80  }
81  //[self declareLogin];
82 }
id< GIDSignInDelegate > delegate
Definition: GIDSignIn.h:103
instancetype sharedInstance()
UILabel * loginInfoLabel
id< GIDSignInUIDelegate > uiDelegate
Definition: GIDSignIn.h:106
Singleton interface to both core and remote data sources.
GIDSignIn * sharedInstance()
static float loginInfoViewHeight

◆ heightRequirement()

+ (float) heightRequirement

Definition at line 31 of file Y3GmailViewHeader.m.

32 {
33  float ret = loginInfoViewHeight;
34  return ret;
35 }
static float loginInfoViewHeight

◆ initWithDelegate:()

- (instancetype) initWithDelegate: (id<Y3GmailHeaderProtocol>)  delegate

Definition at line 21 of file Y3GmailViewHeader.m.

21  :(id<Y3GmailHeaderProtocol>) delegate
22 {
23  self = [super init];
24  if (self) {
25  _msgHeaderDelegate = delegate;
26  }
27  return self;
28 }
id< U7ParamEditControlDelegate > delegate

◆ signedIn:()

- (void) signedIn: (GIDGoogleUser *)  user
implementation

Definition at line 112 of file Y3GmailViewHeader.m.

112  : (GIDGoogleUser *)user
113 {
114  NSLog(@"Y3GmailViewHeader.signedIn: %@", user.profile.name);
115  // [self setNeedsDisplay];
116 }
GIDProfileData * profile
Definition: GIDGoogleUser.h:24
NSString * name

◆ signedOut:()

- (void) signedOut: (GIDGoogleUser *)  user
implementation

Definition at line 117 of file Y3GmailViewHeader.m.

117  : (GIDGoogleUser *)user
118 {
119  NSLog(@"Y3GmailViewHeader.signedOut: %@", user.profile.name);
120  // [self setNeedsDisplay];
121 }
GIDProfileData * profile
Definition: GIDGoogleUser.h:24
NSString * name

Property Documentation

◆ msgHeaderDelegate

- (id<Y3GmailHeaderProtocol>) msgHeaderDelegate
readwritenonatomicstrong

Definition at line 24 of file Y3GmailViewHeader.h.

◆ signInButton

- (GIDSignInButton*) signInButton
readwritenonatomicstrong

Definition at line 23 of file Y3GmailViewHeader.h.


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