Skip to content

Commit 6f8c19f

Browse files
committed
改 UI,2FA 适配屏幕尺寸
1 parent 35386b9 commit 6f8c19f

5 files changed

Lines changed: 30 additions & 16 deletions

File tree

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@
225225
4E8D5D621B45295D00B70936 /* TOTPGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E8D5D541B45295D00B70936 /* TOTPGenerator.m */; };
226226
4E8D5D631B45295D00B70936 /* UIColor+MobileColors.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E8D5D571B45295D00B70936 /* UIColor+MobileColors.m */; };
227227
4E8D5D661B45306900B70936 /* OTPListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E8D5D651B45306900B70936 /* OTPListViewController.m */; };
228-
4E8D5D6B1B453A1500B70936 /* tip_2FA@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E8D5D6A1B453A1500B70936 /* tip_2FA@2x.png */; };
229228
4E8D5D6E1B45400100B70936 /* ZXScanCodeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E8D5D6D1B45400100B70936 /* ZXScanCodeViewController.m */; };
230229
4E8D5D731B454D5000B70936 /* OTPAuthClock.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E8D5D721B454D5000B70936 /* OTPAuthClock.m */; };
231230
4E8D5D7D1B462ADB00B70936 /* OTPTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E8D5D7C1B462ADB00B70936 /* OTPTableViewCell.m */; };
@@ -240,8 +239,9 @@
240239
4E9113AB1A1CB19900AC9431 /* icon_file_state_look@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E9113A71A1CB19900AC9431 /* icon_file_state_look@2x.png */; };
241240
4E9113AC1A1CB19900AC9431 /* icon_file_state_pause@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E9113A81A1CB19900AC9431 /* icon_file_state_pause@2x.png */; };
242241
4E94C4E71B4A6AC700EB668A /* ScanBGView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E94C4E61B4A6AC700EB668A /* ScanBGView.m */; };
243-
4E94C4E91B4A82B600EB668A /* scan_line@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E94C4E81B4A82B600EB668A /* scan_line@2x.png */; };
244242
4E94C4ED1B4A867A00EB668A /* scan_bg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E94C4EC1B4A867A00EB668A /* scan_bg@2x.png */; };
243+
4E94C4EF1B4B73BB00EB668A /* scan_line@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E94C4EE1B4B73BB00EB668A /* scan_line@2x.png */; };
244+
4E94C4F11B4B75DB00EB668A /* tip_2FA@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E94C4F01B4B75DB00EB668A /* tip_2FA@2x.png */; };
245245
4E969CD01AF0EB87005C0CCE /* NSTimer+Common.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E969CCF1AF0EB87005C0CCE /* NSTimer+Common.m */; };
246246
4E96E7BB1A1B25D40037C098 /* DirectoryWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E96E7BA1A1B25D40037C098 /* DirectoryWatcher.m */; };
247247
4E96E7C81A1B46740037C098 /* QuickLook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E96E7C71A1B46740037C098 /* QuickLook.framework */; };
@@ -1101,7 +1101,6 @@
11011101
4E8D5D641B45306900B70936 /* OTPListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTPListViewController.h; sourceTree = "<group>"; };
11021102
4E8D5D651B45306900B70936 /* OTPListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTPListViewController.m; sourceTree = "<group>"; };
11031103
4E8D5D681B45322400B70936 /* Ease_2FA.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Ease_2FA.h; sourceTree = "<group>"; };
1104-
4E8D5D6A1B453A1500B70936 /* tip_2FA@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tip_2FA@2x.png"; sourceTree = "<group>"; };
11051104
4E8D5D6C1B45400100B70936 /* ZXScanCodeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXScanCodeViewController.h; sourceTree = "<group>"; };
11061105
4E8D5D6D1B45400100B70936 /* ZXScanCodeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXScanCodeViewController.m; sourceTree = "<group>"; };
11071106
4E8D5D711B454D5000B70936 /* OTPAuthClock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTPAuthClock.h; sourceTree = "<group>"; };
@@ -1122,8 +1121,9 @@
11221121
4E9113A81A1CB19900AC9431 /* icon_file_state_pause@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_file_state_pause@2x.png"; sourceTree = "<group>"; };
11231122
4E94C4E51B4A6AC700EB668A /* ScanBGView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScanBGView.h; sourceTree = "<group>"; };
11241123
4E94C4E61B4A6AC700EB668A /* ScanBGView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScanBGView.m; sourceTree = "<group>"; };
1125-
4E94C4E81B4A82B600EB668A /* scan_line@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "scan_line@2x.png"; sourceTree = "<group>"; };
11261124
4E94C4EC1B4A867A00EB668A /* scan_bg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "scan_bg@2x.png"; sourceTree = "<group>"; };
1125+
4E94C4EE1B4B73BB00EB668A /* scan_line@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "scan_line@2x.png"; sourceTree = "<group>"; };
1126+
4E94C4F01B4B75DB00EB668A /* tip_2FA@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tip_2FA@2x.png"; sourceTree = "<group>"; };
11271127
4E969CCE1AF0EB87005C0CCE /* NSTimer+Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTimer+Common.h"; sourceTree = "<group>"; };
11281128
4E969CCF1AF0EB87005C0CCE /* NSTimer+Common.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSTimer+Common.m"; sourceTree = "<group>"; };
11291129
4E96E7B91A1B25D40037C098 /* DirectoryWatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectoryWatcher.h; sourceTree = "<group>"; };
@@ -2337,9 +2337,9 @@
23372337
4E8D5D691B4539E300B70936 /* Images */ = {
23382338
isa = PBXGroup;
23392339
children = (
2340+
4E94C4EE1B4B73BB00EB668A /* scan_line@2x.png */,
23402341
4E94C4EC1B4A867A00EB668A /* scan_bg@2x.png */,
2341-
4E94C4E81B4A82B600EB668A /* scan_line@2x.png */,
2342-
4E8D5D6A1B453A1500B70936 /* tip_2FA@2x.png */,
2342+
4E94C4F01B4B75DB00EB668A /* tip_2FA@2x.png */,
23432343
);
23442344
path = Images;
23452345
sourceTree = "<group>";
@@ -3953,7 +3953,6 @@
39533953
8EF643B719FF7E2900F7EEB0 /* Input_OnlyText_Cell.xib in Resources */,
39543954
4EF17ED71B3C3112003CDD2D /* intro_icon_4@2x.png in Resources */,
39553955
4E6384031B33C8E900D98648 /* task_activity_icon_create@2x.png in Resources */,
3956-
4E8D5D6B1B453A1500B70936 /* tip_2FA@2x.png in Resources */,
39573956
4EACB4401A2C448F0097ABB3 /* button_file_download_unable@2x.png in Resources */,
39583957
8E8F7B2F19EF6306006BA8BD /* btn_privateMsg_black@2x.png in Resources */,
39593958
4E96E7E01A1B537E0037C098 /* icon_file_pdf@2x.png in Resources */,
@@ -4072,6 +4071,7 @@
40724071
4E66EE291A28226000DA1B3E /* button_file_move_enable@2x.png in Resources */,
40734072
8EA6D19319E240C40076D59C /* timeline_line_read@2x.png in Resources */,
40744073
4EF17EE31B3C3112003CDD2D /* intro_tip_3@3x.png in Resources */,
4074+
4E94C4EF1B4B73BB00EB668A /* scan_line@2x.png in Resources */,
40754075
4E96E7DF1A1B537E0037C098 /* icon_file_unknown@2x.png in Resources */,
40764076
8EA6D18619E240C40076D59C /* privatemessage_selected@2x.png in Resources */,
40774077
8E525C8D19F7E3F800496B34 /* blankpage_image_Sleep@2x.png in Resources */,
@@ -4114,7 +4114,6 @@
41144114
4E5F39071ACBFDCD0010515D /* keyboard_photo@2x.png in Resources */,
41154115
4E76D4DE1A5A7B4A0094A35E /* text_clear_btn@2x.png in Resources */,
41164116
4E96E7E41A1B537E0037C098 /* icon_file_xls@2x.png in Resources */,
4117-
4E94C4E91B4A82B600EB668A /* scan_line@2x.png in Resources */,
41184117
4EC461B41B39360F00D08970 /* file_changeType_MODIFY@2x.png in Resources */,
41194118
4EA679191A14BFA0001A0324 /* icon_file_folder_default@2x.png in Resources */,
41204119
4E6383D61B32665700D98648 /* project_item_readme@2x.png in Resources */,
@@ -4237,6 +4236,7 @@
42374236
4E96E7E31A1B537E0037C098 /* icon_file_txt@2x.png in Resources */,
42384237
8EA6D18919E240C40076D59C /* task_normal@2x.png in Resources */,
42394238
8EA6D19419E240C40076D59C /* timeline_line_unread@2x.png in Resources */,
4239+
4E94C4F11B4B75DB00EB668A /* tip_2FA@2x.png in Resources */,
42404240
4E996C081ABBF56A00C704F1 /* user_info_project@2x.png in Resources */,
42414241
8E97CE9C1A0C7E26006F9AD7 /* coding_emoji_05@2x.png in Resources */,
42424242
4E6383A61B3262D300D98648 /* taskPriority0@2x.png in Resources */,

Coding_iOS/Ease_2FA/Controllers/OTPListViewController.m

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,32 +92,46 @@ - (void)configUI{
9292
[self.myTableView removeFromSuperview];
9393
self.myTableView = nil;
9494

95+
UIImage *tipImage = [UIImage imageNamed:@"tip_2FA"];
9596
if (!_tipImageView) {
96-
_tipImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tip_2FA"]];
97+
_tipImageView = [[UIImageView alloc] initWithImage:tipImage];
9798
[self.view addSubview:_tipImageView];
9899
}
99100
if (!_tipLabel) {
100101
_tipLabel = [UILabel new];
101102
_tipLabel.numberOfLines = 0;
102103
_tipLabel.textAlignment = NSTextAlignmentCenter;
103-
_tipLabel.font = [UIFont systemFontOfSize:16];
104104
_tipLabel.textColor = [UIColor colorWithHexString:@"0x222222"];
105-
_tipLabel.text = @"Coding 两步验证指的是用户登录账户的时候,除了要输入用户名和密码,还要求用户输入一个手机生成的动态密码,为帐户额外添加了一层保护,即使入侵者窃取了用户的密码,也会因不能使用用户的手机而无法登录帐户";
105+
_tipLabel.text = @"启用两步验证后,登录 Coding 账户或进行敏感操作时都将需要输入密码和本客户端生成的验证码";
106106
[self.view addSubview:_tipLabel];
107107
}
108108
if (!_beginButton) {
109109
_beginButton = [UIButton buttonWithStyle:StrapSuccessStyle andTitle:@"开始验证" andFrame:CGRectMake(kPaddingLeftWidth, CGRectGetHeight(self.view.frame)- 20 - 45, kScreen_Width-kPaddingLeftWidth*2, 45) target:self action:@selector(beginButtonClicked:)];
110110
[self.view addSubview:_beginButton];
111111
}
112+
CGSize tipImageSize = tipImage.size;
113+
CGFloat scale = 1.0;
114+
if (kDevice_Is_iPhone6Plus) {
115+
scale = 1.0;
116+
_tipLabel.font = [UIFont systemFontOfSize:16];
117+
}else if (kDevice_Is_iPhone6){
118+
scale = 0.85;
119+
_tipLabel.font = [UIFont systemFontOfSize:15];
120+
}else{
121+
_tipLabel.font = [UIFont systemFontOfSize:15];
122+
scale = 0.75;
123+
}
124+
tipImageSize = CGSizeMake(ceil(tipImageSize.width *scale), ceil(tipImageSize.height *scale));
125+
112126
[_tipImageView mas_makeConstraints:^(MASConstraintMaker *make) {
113127
make.centerX.equalTo(self.view);
114-
make.top.mas_equalTo(kScreen_Height/6);
128+
make.top.mas_equalTo(ceil(kScreen_Height/7));
129+
make.size.mas_equalTo(tipImageSize);
115130
}];
116131
[_tipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
117132
make.centerX.equalTo(self.view);
118-
make.top.equalTo(_tipImageView.mas_bottom).offset(40);
119-
make.left.equalTo(self.view).offset(kPaddingLeftWidth);
120-
make.right.equalTo(self.view).offset(-kPaddingLeftWidth);
133+
make.top.equalTo(_tipImageView.mas_bottom).offset(20);
134+
make.width.mas_equalTo(kScreen_Width * 0.7);
121135
}];
122136
}
123137
}

Coding_iOS/Ease_2FA/Controllers/ZXScanCodeViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ - (void)configUI{
7373
_tipLabel = [UILabel new];
7474
_tipLabel.textAlignment = NSTextAlignmentCenter;
7575
_tipLabel.font = [UIFont boldSystemFontOfSize:16];
76-
_tipLabel.textColor = [UIColor whiteColor];
76+
_tipLabel.textColor = [[UIColor whiteColor] colorWithAlphaComponent:0.5];
7777
_tipLabel.text = @"将二维码放入框内,即可自动扫描";
7878
}
7979
if (!_lineView) {
-4.84 KB
Loading
4.29 KB
Loading

0 commit comments

Comments
 (0)