23 - (instancetype) initWithFrame:(CGRect)frame andDelegate:(
id<V7GoogleLoginProtocol>)delegate
25 self = [
super initWithFrame:frame];
28 controlbarFrame = CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height);
43 [
self appear:controlbarFrame];
52 if (nil==[loginControl username]) {
54 NSLog(
@"V7GoogleLoginControlbar.appear: not logged in");
57 NSLog(
@"V7GoogleLoginControlbar.appear: user: %@",
58 [loginControl username]);
61 [
self setBackgroundColor:[UIColor greenColor]];
63 float submitButtonWidth = 132;
64 float submitButtonHeight = 32;
65 CGRect logOutFrame = CGRectMake(bound.size.width - (submitButtonWidth+ 20.0), 2.0, submitButtonWidth, submitButtonHeight);
66 CGRect forwardButtonFrame = CGRectMake(bound.size.width - 76, 4, 48, 48);
67 _forwardButton = [[UIButton alloc] initWithFrame: forwardButtonFrame];
68 [_forwardButton addTarget:self action:@selector(createEntryOnDrive) forControlEvents:UIControlEventTouchUpInside];
69 UIImage *forwardButtonImage = [UIImage imageNamed:@"forwardButton.png"];
70 [_forwardButton setImage:forwardButtonImage forState:UIControlStateNormal];
71 [
self addSubview:_forwardButton];
75 CGRect loginInfoLabelFrame = CGRectMake(2.0, 2.0, bound.size.width/2,
loginInfoViewHeight - 4.0);
77 loginInfoLabel = [[UILabel alloc] initWithFrame:loginInfoLabelFrame];
78 [loginInfoLabel setFont:[UIFont fontWithName:@"Helvetica-Bold" size:16.0]];
80 [loginInfoLabel postAttributedText:loginName];
81 [loginInfoLabel setTextAlignment:NSTextAlignmentCenter];
83 [loginInfoLabel.layer setBorderColor: [[UIColor blackColor] CGColor]];
84 [loginInfoLabel.layer setBorderWidth: 2.0];
87 [
self addSubview:loginInfoLabel];
89 [
self setBackgroundColor:[UIColor cyanColor]];
91 CGRect signInButtonFrame = CGRectMake(bound.size.width/2 + 2,
93 bound.size.width/2 - 4,
101 signIn.
uiDelegate = (id<GIDSignInUIDelegate>)
self;
105 [_signInButton setFrame:signInButtonFrame];
106 _signInButton.layer.cornerRadius = 8;
107 _signInButton.layer.borderColor = [[UIColor blackColor] CGColor];
108 _signInButton.layer.borderWidth = 3.0;
109 _signInButton .clipsToBounds = YES;
110 [
self addSubview:_signInButton];
124 NSLog(
@"V7GoogleLoginControlbar.createEntryOnDrive");
129 #pragma mark - GIDSignInUIDelegate 136 error:(NSError *) error
138 NSLog(
@"V7GoogleLoginControlbar.signInWillDispatch");
148 - (void) signIn:(
GIDSignIn *) signIn presentViewController:(UIViewController *) viewController
150 NSLog(
@"V7GoogleLoginControlbar.presentViewController: %@",
151 NSStringFromClass([viewController
class]));
159 - (void) signIn:(
GIDSignIn *) signIn dismissViewController: (UIViewController *) viewController
161 NSLog(
@"V7GoogleLoginControlbar.dismissViewController: %@",
162 NSStringFromClass([viewController
class]));
175 NSLog(
@"V7GoogleLoginControlbar.signedIn: %@", user.
profile.
name);
176 [loginGoogleDelegate regenerateLoginView];
181 [loginGoogleDelegate regenerateLoginView];
id< GIDSignInDelegate > delegate
void addLoginListener:(id< Z5GoogleLoginListener > ear)
void appear:(CGRect bound)
void createEntryOnDrive()
instancetype sharedInstance()
float loginInfoViewHeight
id< U7ParamEditControlDelegate > delegate
float heightRequirement()
id< GIDSignInUIDelegate > uiDelegate
id< V7GoogleLoginProtocol > loginGoogleDelegate
GIDProfileData * getLoggedInProfile()
Singleton interface to both core and remote data sources.
GIDSignIn * sharedInstance()
void configureGoogleSignIn()