Skip to content

Commit 7cef0f1

Browse files
author
Chuan Ren
authored
Merge pull request #647 from firebase/tos
2 parents cd5ad5e + 67b74cd commit 7cef0f1

File tree

2 files changed

+43
-30
lines changed

2 files changed

+43
-30
lines changed

Auth/FirebaseAuthUI/FUIAuthPickerViewController.m

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,30 @@
4242
/** @var kButtonContainerBottomMargin
4343
@brief The magin between sign in buttons and the bottom of the content view.
4444
*/
45-
static const CGFloat kButtonContainerBottomMargin = 56.0f;
45+
static const CGFloat kButtonContainerBottomMargin = 48.0f;
4646

4747
/** @var kButtonContainerTopMargin
4848
@brief The margin between sign in buttons and the top of the content view.
4949
*/
5050
static const CGFloat kButtonContainerTopMargin = 16.0f;
5151

52+
/** @var kTOSViewBottomMargin
53+
@brief The margin between privacy policy and TOS view and the bottom of the content view.
54+
*/
55+
static const CGFloat kTOSViewBottomMargin = 24.0f;
56+
57+
/** @var kTOSViewHorizontalMargin
58+
@brief The margin between privacy policy and TOS view and the left or right of the content view.
59+
*/
60+
static const CGFloat kTOSViewHorizontalMargin = 16.0f;
61+
5262
@implementation FUIAuthPickerViewController {
5363
UIView *_buttonContainerView;
5464

5565
IBOutlet FUIPrivacyAndTermsOfServiceView *_privacyPolicyAndTOSView;
5666

5767
IBOutlet UIView *_contentView;
58-
68+
5969
IBOutlet UIScrollView *_scrollView;
6070
}
6171

@@ -134,18 +144,18 @@ - (void)viewDidLayoutSubviews {
134144
// old layout behavior.
135145
if (!_scrollView) {
136146
CGFloat distanceFromCenterToBottom =
137-
CGRectGetHeight(_buttonContainerView.frame) / 2.0f + kButtonContainerBottomMargin;
147+
CGRectGetHeight(_buttonContainerView.frame) / 2.0f + kButtonContainerBottomMargin + kTOSViewBottomMargin;
138148
CGFloat centerY = CGRectGetHeight(self.view.bounds) - distanceFromCenterToBottom;
139149
// Compensate for bounds adjustment if any.
140150
centerY += self.view.bounds.origin.y;
141151
_buttonContainerView.center = CGPointMake(self.view.center.x, centerY);
142152
return;
143153
}
144-
154+
145155
CGFloat buttonContainerHeight = CGRectGetHeight(_buttonContainerView.frame);
146156
CGFloat buttonContainerWidth = CGRectGetWidth(_buttonContainerView.frame);
147-
CGFloat contentViewHeight = kButtonContainerTopMargin +
148-
buttonContainerHeight + kButtonContainerBottomMargin;
157+
CGFloat contentViewHeight = kButtonContainerTopMargin + buttonContainerHeight
158+
+ kButtonContainerBottomMargin + kTOSViewBottomMargin;
149159
CGFloat contentViewWidth = CGRectGetWidth(self.view.bounds);
150160
_scrollView.frame = self.view.frame;
151161
CGFloat scrollViewHeight;
@@ -168,7 +178,10 @@ - (void)viewDidLayoutSubviews {
168178
buttonContainerWidth,
169179
buttonContainerHeight);
170180
CGFloat privacyViewHeight = CGRectGetHeight(_privacyPolicyAndTOSView.frame);
171-
_privacyPolicyAndTOSView.frame = CGRectMake(0, contentViewHeight - privacyViewHeight, contentViewWidth, privacyViewHeight);
181+
_privacyPolicyAndTOSView.frame = CGRectMake(kTOSViewHorizontalMargin, contentViewHeight
182+
- privacyViewHeight - kTOSViewBottomMargin,
183+
contentViewWidth - kTOSViewHorizontalMargin*2,
184+
privacyViewHeight);
172185
}
173186

174187
#pragma mark - Actions

Gemfile.lock

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,69 +2,69 @@ GEM
22
remote: https://rubygems.org/
33
specs:
44
CFPropertyList (3.0.0)
5-
activesupport (4.2.10)
5+
activesupport (4.2.11.1)
66
i18n (~> 0.7)
77
minitest (~> 5.1)
88
thread_safe (~> 0.3, >= 0.3.4)
99
tzinfo (~> 1.1)
10-
atomos (0.1.2)
10+
atomos (0.1.3)
1111
claide (1.0.2)
12-
cocoapods (1.5.3)
12+
cocoapods (1.6.1)
1313
activesupport (>= 4.0.2, < 5)
1414
claide (>= 1.0.2, < 2.0)
15-
cocoapods-core (= 1.5.3)
15+
cocoapods-core (= 1.6.1)
1616
cocoapods-deintegrate (>= 1.0.2, < 2.0)
17-
cocoapods-downloader (>= 1.2.0, < 2.0)
17+
cocoapods-downloader (>= 1.2.2, < 2.0)
1818
cocoapods-plugins (>= 1.0.0, < 2.0)
1919
cocoapods-search (>= 1.0.0, < 2.0)
2020
cocoapods-stats (>= 1.0.0, < 2.0)
21-
cocoapods-trunk (>= 1.3.0, < 2.0)
21+
cocoapods-trunk (>= 1.3.1, < 2.0)
2222
cocoapods-try (>= 1.1.0, < 2.0)
2323
colored2 (~> 3.1)
2424
escape (~> 0.0.4)
25-
fourflusher (~> 2.0.1)
25+
fourflusher (>= 2.2.0, < 3.0)
2626
gh_inspector (~> 1.0)
27-
molinillo (~> 0.6.5)
27+
molinillo (~> 0.6.6)
2828
nap (~> 1.0)
29-
ruby-macho (~> 1.1)
30-
xcodeproj (>= 1.5.7, < 2.0)
31-
cocoapods-core (1.5.3)
29+
ruby-macho (~> 1.4)
30+
xcodeproj (>= 1.8.1, < 2.0)
31+
cocoapods-core (1.6.1)
3232
activesupport (>= 4.0.2, < 6)
3333
fuzzy_match (~> 2.0.4)
3434
nap (~> 1.0)
35-
cocoapods-deintegrate (1.0.2)
36-
cocoapods-downloader (1.2.1)
35+
cocoapods-deintegrate (1.0.3)
36+
cocoapods-downloader (1.2.2)
3737
cocoapods-plugins (1.0.0)
3838
nap
3939
cocoapods-search (1.0.0)
40-
cocoapods-stats (1.0.0)
41-
cocoapods-trunk (1.3.0)
40+
cocoapods-stats (1.1.0)
41+
cocoapods-trunk (1.3.1)
4242
nap (>= 0.8, < 2.0)
4343
netrc (~> 0.11)
4444
cocoapods-try (1.1.0)
4545
colored2 (3.1.2)
46-
concurrent-ruby (1.0.5)
46+
concurrent-ruby (1.1.5)
4747
escape (0.0.4)
48-
fourflusher (2.0.1)
48+
fourflusher (2.2.0)
4949
fuzzy_match (2.0.4)
5050
gh_inspector (1.1.3)
5151
i18n (0.9.5)
5252
concurrent-ruby (~> 1.0)
5353
minitest (5.11.3)
54-
molinillo (0.6.5)
54+
molinillo (0.6.6)
5555
nanaimo (0.2.6)
5656
nap (1.1.0)
5757
netrc (0.11.0)
58-
ruby-macho (1.2.0)
58+
ruby-macho (1.4.0)
5959
thread_safe (0.3.6)
6060
tzinfo (1.2.5)
6161
thread_safe (~> 0.1)
62-
xcodeproj (1.5.9)
62+
xcodeproj (1.8.1)
6363
CFPropertyList (>= 2.3.3, < 4.0)
64-
atomos (~> 0.1.2)
64+
atomos (~> 0.1.3)
6565
claide (>= 1.0.2, < 2.0)
6666
colored2 (~> 3.1)
67-
nanaimo (~> 0.2.5)
67+
nanaimo (~> 0.2.6)
6868

6969
PLATFORMS
7070
ruby
@@ -75,4 +75,4 @@ DEPENDENCIES
7575
xcodeproj
7676

7777
BUNDLED WITH
78-
1.16.1
78+
1.17.2

0 commit comments

Comments
 (0)