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

#import <V7GoogDriveControlbarView.h>

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

Instance Methods

(instancetype) - initWithDelegate:andFrame:
 
(void) - userLoggedIn:
 
(void) - showRecipeOption:
 
(void) - placeLoginButton
 
(float) - heightRequirement [implementation]
 
(void) - appear: [implementation]
 
(void) - fillViewOnAppearance: [implementation]
 
(void) - clickRecipeButton [implementation]
 

Properties

GIDSignInButtonsignInButton
 

Detailed Description

Definition at line 15 of file V7GoogDriveControlbarView.h.

Method Documentation

◆ appear:()

- (void) appear: (CGRect)  bound
implementation

Definition at line 47 of file V7GoogDriveControlbarView.m.

47  :(CGRect)bound
48 {
49  float viewWidth = bound.size.width;
50  NSLog(@"Z7GoogDriveControlBar.appear: bound: %3.2f/%3.2f %3.2f/%3.2f",
51  bound.origin.x, bound.origin.y, bound.size.width, bound.size.height);
52 
53  buttonSize = CGSizeMake(viewWidth * 0.50 - 4.0, 40.0);
54  [self fillViewOnAppearance:self.bounds];
55 }
CGSize buttonSize

◆ clickRecipeButton()

- (void) clickRecipeButton
implementation

Definition at line 111 of file V7GoogDriveControlbarView.m.

112 {
113  NSLog(@"Z7GoogDriveControlBar: clickRecipeButton");
114 }

◆ fillViewOnAppearance:()

- (void) fillViewOnAppearance: (CGRect)  parentBound
implementation

Definition at line 57 of file V7GoogDriveControlbarView.m.

57  : (CGRect) parentBound
58 {
59  float viewWidth = parentBound.size.width;
60  NSLog(@"Z7GoogDriveControlBar.fillViewForDelegate: viewWidth: %3.2f", viewWidth);
61  buttonSize = CGSizeMake(viewWidth * 0.5, 40.0);
62  // CGRect totalFrame = self.frame;
63 
64  if (isUserLoggedIn) {
65  [self setBackgroundColor:[UIColor orangeColor]];
66  [self placeLoginButton];
67  } else {
68  [self setBackgroundColor:[UIColor yellowColor]];
69  }
70 }
CGSize buttonSize

◆ heightRequirement()

- (float) heightRequirement
implementation

Definition at line 43 of file V7GoogDriveControlbarView.m.

44 {
45  return buttonSize.height + 2;
46 }
CGSize buttonSize

◆ initWithDelegate:andFrame:()

- (instancetype) initWithDelegate: (id<V7GoogDriveControlDelegate>)  delegate
andFrame: (CGRect)  frame 

Definition at line 30 of file V7GoogDriveControlbarView.m.

30  :(id<V7GoogDriveControlDelegate>) dele andFrame: (CGRect)frame
31 {
32  self = [super initWithFrame:frame];
33  if (self) {
34  delegate = dele;
35  [self setClipsToBounds:YES];
36  NSLog(@"Z7GoogDriveControlbar.initWithDelegate: (%@) finish init", NSStringFromClass([delegate class]));
37  }
38  return self;
39 }
id< V7GoogDriveControlDelegate > delegate

◆ placeLoginButton()

- (void) placeLoginButton

Definition at line 72 of file V7GoogDriveControlbarView.m.

73 {
74  CGRect totalFrame = self.frame;
75  float buttonWidth = 160.0;
76 // CGRect signInButtonFrame = CGRectMake(totalFrame.size.width * 0.45,
77 // totalFrame.size.height * 0.1,
78 // totalFrame.size.width * 0.1,
79 // totalFrame.size.height * 0.05);
80  CGRect signInButtonFrame = CGRectMake(totalFrame.size.width - buttonWidth - 12.0,
81  2.0,
82  buttonWidth,
83  totalFrame.size.height -4.0);
84 
85  Z5GoogleLoginController *loginControl = [[[Z5DataController sharedInstance] remoteDataController] loginController];
86 
87  [loginControl configureGoogleSignIn];
89  signIn.uiDelegate = (id<GIDSignInUIDelegate>)delegate;
90  signIn.delegate = loginControl;
91 
92  _signInButton = [[GIDSignInButton alloc] init];
93  _signInButton.layer.cornerRadius = 8;
94  _signInButton.layer.borderColor = [[UIColor blackColor] CGColor];
95  _signInButton.layer.borderWidth = 3.0;
96  _signInButton .clipsToBounds = YES;
97 
98  NSLog(@"Z7GoogDriveControlBar.placeLoginButton: init/size: %3.2f %3.2f", [_signInButton frame].size.width, [_signInButton frame].size.height); // 120x48
99  [_signInButton setFrame:signInButtonFrame];
100  [self addSubview:_signInButton];
101 }
id< GIDSignInDelegate > delegate
Definition: GIDSignIn.h:103
id< V7GoogDriveControlDelegate > delegate
instancetype sharedInstance()
id< GIDSignInUIDelegate > uiDelegate
Definition: GIDSignIn.h:106
Singleton interface to both core and remote data sources.
GIDSignIn * sharedInstance()

◆ showRecipeOption:()

- (void) showRecipeOption: (Boolean)  flag

Definition at line 107 of file V7GoogDriveControlbarView.m.

107  :(Boolean)flag
108 {
109  ;
110 }

◆ userLoggedIn:()

- (void) userLoggedIn: (BOOL)  flag

Definition at line 102 of file V7GoogDriveControlbarView.m.

102  :(BOOL) flag
103 {
104  isUserLoggedIn = flag;
105  [_signInButton setHidden:flag];
106 }

Property Documentation

◆ signInButton

- (GIDSignInButton*) signInButton
readwritenonatomicstrong

Definition at line 17 of file V7GoogDriveControlbarView.h.


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