Skip to content
This repository has been archived by the owner on Oct 9, 2021. It is now read-only.

Commit

Permalink
Release SealTalk Demo version 1.3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
RongRobot committed Mar 24, 2019
1 parent 4cb1e16 commit 1f1e53e
Show file tree
Hide file tree
Showing 176 changed files with 4,668 additions and 1,440 deletions.
2 changes: 1 addition & 1 deletion ios-rongimdemo/AddAppKeyViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ - (void)onSave:(id)sender {
int env = [self.devField.text intValue];
if (env != 1 && env != 2) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert"
message:@"dev值必须是1或者2"
message:RCDLocalizedString(@"dev_value_must_1_or_2")
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:nil, nil];
Expand Down
32 changes: 24 additions & 8 deletions ios-rongimdemo/Debug/RCDDebugTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,21 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.textLabel.text = title;
cell.backgroundColor = [UIColor whiteColor];
cell.detailTextLabel.text = @"";
if ([title isEqualToString:@"显示ID"]) {
if ([title isEqualToString:RCDLocalizedString(@"show_ID")
]) {
[self setSwitchButtonCell:cell tag:DISPLAY_ID_TAG];
}
if ([title isEqualToString:@"显示在线状态"]) {
if ([title isEqualToString:RCDLocalizedString(@"show_online_status")
]) {
[self setSwitchButtonCell:cell tag:DISPLAY_ONLINE_STATUS_TAG];
}
if ([title isEqualToString:@"加入聊天室失败仍停留在会话界面"]) {
if ([title isEqualToString:RCDLocalizedString(@"Joining_the_chat_room_failed_to_stay_in_the_session_interface")
]) {
[self setSwitchButtonCell:cell tag:JOIN_CHATROOM_TAG];
}
if ([title isEqualToString:@"设置离线消息补偿时间"] || [title isEqualToString:@"设置全局免打扰时间"]) {
if ([title isEqualToString:RCDLocalizedString(@"Set_offline_message_compensation_time")
] || [title isEqualToString:RCDLocalizedString(@"Set_global_DND_time")
]) {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
return cell;
Expand Down Expand Up @@ -143,9 +148,19 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
#pragma mark init data for tabelview
- (void)initdata {
self.functions = [NSDictionary dictionaryWithObjectsAndKeys:
@[@"显示ID", @"显示在线状态"], @"显示设置",
@[@"强制Crash", @"发送Log", @"加入聊天室失败仍停留在会话界面"], @"自定义设置",
@[@"设置离线消息补偿时间", @"设置全局免打扰时间"], @"时间设置", nil];
@[RCDLocalizedString(@"show_ID")
, RCDLocalizedString(@"show_online_status")
], RCDLocalizedString(@"show_setting")
,
@[RCDLocalizedString(@"force_crash")
, RCDLocalizedString(@"send_log")
, RCDLocalizedString(@"Joining_the_chat_room_failed_to_stay_in_the_session_interface")
], RCDLocalizedString(@"custom_setting")
,
@[RCDLocalizedString(@"Set_offline_message_compensation_time")
, RCDLocalizedString(@"Set_global_DND_time")
], RCDLocalizedString(@"time_setting")
, nil];
}

#pragma mark UI setting
Expand Down Expand Up @@ -263,7 +278,8 @@ - (void)doCrash {
*/
- (void)pushToDebugVC {
RCDDebugViewController *vc = [[RCDDebugViewController alloc] init];
vc.title = @"设置离线消息补偿时间";
vc.title = RCDLocalizedString(@"Set_offline_message_compensation_time")
;
[self.navigationController pushViewController:vc animated:YES];
}

Expand Down
16 changes: 16 additions & 0 deletions ios-rongimdemo/PrefixHeader.pch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// PrefixHeader.pch
// RCloudMessage
//
// Created by zhangke on 2019/2/15.
// Copyright © 2019 RongCloud. All rights reserved.
//

#ifndef PrefixHeader_pch
#define PrefixHeader_pch

// Include any system framework and library headers here that should be included in all compilation units.
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
#define RCDLocalizedString(key) NSLocalizedStringFromTable(key, @"SealTalk", nil)

#endif /* PrefixHeader_pch */
21 changes: 14 additions & 7 deletions ios-rongimdemo/RCDAboutRongCloudTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ - (void)viewDidLoad {
self.tableView.backgroundColor = [UIColor colorWithHexString:@"f0f0f6" alpha:1.f];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

self.navigationItem.title = @"关于 SealTalk";
self.navigationItem.title = RCDLocalizedString(@"about_sealtalk")
;

RCDUIBarButtonItem *leftBtn =
[[RCDUIBarButtonItem alloc] initWithLeftBarButton:@"" target:self action:@selector(clickBackBtn:)];
[[RCDUIBarButtonItem alloc] initWithLeftBarButton:RCDLocalizedString(@"me")
target:self action:@selector(clickBackBtn:)];
self.navigationItem.leftBarButtonItem = leftBtn;
}

Expand Down Expand Up @@ -83,25 +85,29 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

case 1: {
[cell setCellStyle:DefaultStyle];
cell.leftLabel.text = @"更新日志";
cell.leftLabel.text = RCDLocalizedString(@"update_log")
;
return cell;
} break;

case 2: {
[cell setCellStyle:DefaultStyle];
cell.leftLabel.text = @"功能介绍";
cell.leftLabel.text = RCDLocalizedString(@"function_introduce")
;
return cell;
} break;

case 3: {
[cell setCellStyle:DefaultStyle];
cell.leftLabel.text = @"官方网站";
cell.leftLabel.text = RCDLocalizedString(@"offical_website")
;
return cell;
} break;

case 4: {
[versionCell setCellStyle:DefaultStyle_RightLabel_WithoutRightArrow];
versionCell.leftLabel.text = @"SealTalk 版本";
versionCell.leftLabel.text = RCDLocalizedString(@"SealTalk_version")
;
NSString *SealTalkVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"SealTalk Version"];
versionCell.rightLabel.text = SealTalkVersion;
NSString *isNeedUpdate = [[NSUserDefaults standardUserDefaults] objectForKey:@"isNeedUpdate"];
Expand All @@ -113,7 +119,8 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

case 5: {
[cell setCellStyle:DefaultStyle_RightLabel_WithoutRightArrow];
cell.leftLabel.text = @"SDK 版本";
cell.leftLabel.text = RCDLocalizedString(@"SDK_version")
;
NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
cell.rightLabel.text = version;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
Expand Down
22 changes: 13 additions & 9 deletions ios-rongimdemo/RCDAddFriendViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ - (void)viewDidLoad {

self.tableView.backgroundColor = HEXCOLOR(0xf0f0f6);
self.tableView.separatorColor = HEXCOLOR(0xdfdfdf);
self.navigationItem.title = @"添加好友";
self.navigationItem.title = RCDLocalizedString(@"add_contacts");

[self setHeaderView];
[self setFooterView];
Expand Down Expand Up @@ -102,13 +102,14 @@ - (void)setFooterView {
[self.addFriendBtn setBackgroundColor:[UIColor colorWithHexString:@"0099ff" alpha:1.0]];
self.addFriendBtn.layer.masksToBounds = YES;
self.addFriendBtn.layer.cornerRadius = 5.f;
[self.addFriendBtn setTitle:@"添加好友" forState:UIControlStateNormal];
[self.addFriendBtn setTitle:RCDLocalizedString(@"add_contacts") forState:UIControlStateNormal];
[view addSubview:self.addFriendBtn];
[self.addFriendBtn setTranslatesAutoresizingMaskIntoConstraints:NO];
[self.addFriendBtn addTarget:self action:@selector(actionAddFriend:) forControlEvents:UIControlEventTouchUpInside];

self.startChat = [[UIButton alloc] initWithFrame:CGRectMake(10, 30, self.view.bounds.size.width, 86)];
[self.startChat setTitle:@"发起会话" forState:UIControlStateNormal];
[self.startChat setTitle:RCDLocalizedString(@"start_chat")
forState:UIControlStateNormal];
[self.startChat setTintColor:[UIColor blackColor]];
[self.startChat setBackgroundColor:[UIColor colorWithHexString:@"0099ff" alpha:1.0]];
self.startChat.layer.masksToBounds = YES;
Expand Down Expand Up @@ -185,28 +186,31 @@ - (void)actionAddFriend:(id)sender {

if (friend && [friend.status isEqualToString:@"10"]) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil
message:@"已发送好友邀请"
message:RCDLocalizedString(@"friend_invite_had_send")
delegate:nil
cancelButtonTitle:@"确定"
cancelButtonTitle:RCDLocalizedString(@"confirm")

otherButtonTitles:nil, nil];
[alertView show];
} else {
[RCDHTTPTOOL requestFriend:_targetUserInfo.userId
complete:^(BOOL result) {
if (result) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil
message:@"请求已发送"
message:RCDLocalizedString(@"request_had_send")
delegate:nil
cancelButtonTitle:@"确定"
cancelButtonTitle:RCDLocalizedString(@"confirm")

otherButtonTitles:nil, nil];
[RCDHTTPTOOL getFriendscomplete:^(NSMutableArray *result){
}];
[alertView show];
} else {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil
message:@"请求失败,请重试"
message:RCDLocalizedString(@"request_fail_retry")
delegate:nil
cancelButtonTitle:@"确定"
cancelButtonTitle:RCDLocalizedString(@"confirm")

otherButtonTitles:nil, nil];
[alertView show];
}
Expand Down
3 changes: 2 additions & 1 deletion ios-rongimdemo/RCDBlackListViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ - (void)viewDidLoad {

self.tableView.tableFooterView = [UIView new];

self.title = @"黑名单";
self.title = RCDLocalizedString(@"blacklist")
;
}

#pragma mark - private
Expand Down
11 changes: 6 additions & 5 deletions ios-rongimdemo/RCDCSEvaluateView.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ - (instancetype)initWithEvaStarDic:(NSDictionary *)evaStarDic{
- (void)didClickSubmitButton{
if (self.model.isTagMust && self.model.tags.count > 0) {
if (self.selectTags.count == 0) {
[self showAlertWarning:@"请选择标签"];
[self showAlertWarning:RCDLocalizedString(@"choose_tag")];
return;
}
}
if (self.model.isInputMust && self.inputView.suggestText.text.length == 0) {
[self showAlertWarning:@"请填写你的想法"];
[self showAlertWarning:RCDLocalizedString(@"type_idea")];
return;
}
if (self.delegate && [self.delegate respondsToSelector:@selector(didSubmitEvaluate:star:tagString:suggest:)]) {
Expand Down Expand Up @@ -347,7 +347,8 @@ - (void)showAtWindow:(BOOL)isShow {
}

- (void)showAlertWarning:(NSString *)message{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:message delegate:nil cancelButtonTitle:nil otherButtonTitles:@"我知道了", nil];
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:message delegate:nil cancelButtonTitle:nil otherButtonTitles:RCDLocalizedString(@"i_know_it")
, nil];
[alertView show];
}

Expand Down Expand Up @@ -382,7 +383,7 @@ - (UIView *)titleView{

UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 50)];
titleLabel.textColor = HEXCOLOR(0x333333);
titleLabel.text = @"评价";
titleLabel.text = RCDLocalizedString(@"remark");
titleLabel.font = [UIFont systemFontOfSize:18];
titleLabel.textAlignment = NSTextAlignmentCenter;

Expand All @@ -401,7 +402,7 @@ - (UIButton *)submitButton{
_submitButton = [[UIButton alloc] init];
_submitButton.backgroundColor = HEXCOLOR(0x0099ff);
_submitButton.titleLabel.font = [UIFont systemFontOfSize:18];
[_submitButton setTitle:@"提交评价" forState:(UIControlStateNormal)];
[_submitButton setTitle:RCDLocalizedString(@"submit_remark") forState:(UIControlStateNormal)];
[_submitButton addTarget:self action:@selector(didClickSubmitButton) forControlEvents:(UIControlEventTouchUpInside)];
}
return _submitButton;
Expand Down
6 changes: 3 additions & 3 deletions ios-rongimdemo/RCDCSSolveView.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ - (instancetype)init{
}

- (void)setSubview{
self.solveTitle.text = @"请问客服是否解决了您的问题";
[self.solvedButton setTitle:@"已解决" forState:(UIControlStateNormal)];
[self.noSolveButton setTitle:@"未解决" forState:(UIControlStateNormal)];
self.solveTitle.text = RCDLocalizedString(@"cs_evaluate_resolved_title");
[self.solvedButton setTitle:RCDLocalizedString(@"cs_evaluate_resolved") forState:(UIControlStateNormal)];
[self.noSolveButton setTitle:RCDLocalizedString(@"cs_evaluate_unresolved") forState:(UIControlStateNormal)];
}

- (void)didClickSolveButton:(UIButton *)sender{
Expand Down
2 changes: 1 addition & 1 deletion ios-rongimdemo/RCDCSStarView.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ - (void)starTapBtn:(UIButton *)btn{
- (void)setStarTitle{
self.starTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 20)];
self.starTitle.textColor = HEXCOLOR(0x3c4d65);
self.starTitle.text = @"请您对客服进行评价";
self.starTitle.text = RCDLocalizedString(@"remark_customer");
self.starTitle.font = [UIFont systemFontOfSize:16];
self.starTitle.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.starTitle];
Expand Down
6 changes: 3 additions & 3 deletions ios-rongimdemo/RCDCSTagView.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ - (instancetype)init{
- (void)settagTitle{
self.tagTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 20)];
self.tagTitle.textColor = HEXCOLOR(0x3c4d65);
self.tagTitle.text = @"存在哪些问题";
self.tagTitle.text = RCDLocalizedString(@"cs_evaluate_problem_title");
self.tagTitle.font = [UIFont systemFontOfSize:16];
self.tagTitle.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.tagTitle];
Expand Down Expand Up @@ -72,9 +72,9 @@ - (void)didSelectTag:(UIButton *)sender{
- (void)isMustSelect:(BOOL)isMustSelect{
dispatch_async(dispatch_get_main_queue(), ^{
if (isMustSelect) {
self.tagTitle.text = @"存在哪些问题(必选)";
self.tagTitle.text = RCDLocalizedString(@"cs_evaluate_problem_must_title");
}else{
self.tagTitle.text = @"存在哪些问题";
self.tagTitle.text = RCDLocalizedString(@"cs_evaluate_problem_title");
}
});
}
Expand Down
32 changes: 20 additions & 12 deletions ios-rongimdemo/RCDChangePasswordViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ - (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.

self.navigationItem.title = @"密码修改";
self.navigationItem.title = RCDLocalizedString(@"change_password")
;

[self initialize];
[self setNavigationButton];
Expand All @@ -57,23 +58,25 @@ - (void)didReceiveMemoryWarning {
}

- (void)initialize {
self.oldPwdLabel = [self setLabel:@"原密码"];
self.oldPwdLabel = [self setLabel:RCDLocalizedString(@"old_password")];
self.oldPwdView = [self setSubView];
self.oldPwdTextField = [self setTextField:nil];
[self.view addSubview:self.oldPwdLabel];
[self.view addSubview:self.oldPwdView];
[self.oldPwdView addSubview:self.oldPwdTextField];

self.newsPwdLabel = [self setLabel:@"新密码"];
self.newsPwdLabel = [self setLabel:RCDLocalizedString(@"new_password")
];
self.newsPwdView = [self setSubView];
self.newsPwdTextField = [self setTextField:@"6-16位字符,区分大小写"];
self.newsPwdTextField = [self setTextField:RCDLocalizedString(@"password_hint")];
[self.view addSubview:self.newsPwdLabel];
[self.view addSubview:self.newsPwdView];
[self.newsPwdView addSubview:self.newsPwdTextField];

self.confirmPwdLabel = [self setLabel:@"确认密码"];
self.confirmPwdLabel = [self setLabel:RCDLocalizedString(@"confirm_new_password")
];
self.confirmPwdView = [self setSubView];
self.confirmPwdTextField = [self setTextField:@"6-16位字符,区分大小写"];
self.confirmPwdTextField = [self setTextField:RCDLocalizedString(@"password_hint")];
[self.view addSubview:self.confirmPwdLabel];
[self.view addSubview:self.confirmPwdView];
[self.confirmPwdView addSubview:self.confirmPwdTextField];
Expand All @@ -82,10 +85,11 @@ - (void)initialize {
}

- (void)setNavigationButton {
self.leftBtn = [[RCDUIBarButtonItem alloc] initWithLeftBarButton:@"设置" target:self action:@selector(clickBackBtn)];
self.leftBtn = [[RCDUIBarButtonItem alloc] initWithLeftBarButton:RCDLocalizedString(@"settings") target:self action:@selector(clickBackBtn)];
self.navigationItem.leftBarButtonItem = self.leftBtn;

self.rightBtn = [[RCDUIBarButtonItem alloc] initWithbuttonTitle:@"完成"
self.rightBtn = [[RCDUIBarButtonItem alloc] initWithbuttonTitle:RCDLocalizedString(@"done")

titleColor:[UIColor colorWithHexString:@"9fcdfd" alpha:1.0]
buttonFrame:CGRectMake(0, 0, 50, 30)
target:self
Expand Down Expand Up @@ -218,7 +222,8 @@ - (void)saveNewPassword:(id)sender {
if ([userPwd isEqualToString:self.oldPwdTextField.text]) {
NSInteger newPwdLength = self.newsPwdTextField.text.length;
if (newPwdLength < 6 || newPwdLength > 20) {
[self AlertShow:@"密码必须为6-16位字符,区分大小写"];
[self AlertShow:RCDLocalizedString(@"password_alert")
];
} else {
if ([self.newsPwdTextField.text isEqualToString:self.confirmPwdTextField.text]) {
[AFHttpTool changePassword:self.oldPwdTextField.text
Expand All @@ -235,20 +240,23 @@ - (void)saveNewPassword:(id)sender {
}];

} else {
[self AlertShow:@"填写的确认密码与新密码不一致"];
[self AlertShow:RCDLocalizedString(@"old_and_new_friend_different")
];
}
}

} else {
[self AlertShow:@"原密码填写错误"];
[self AlertShow:RCDLocalizedString(@"old_password_error")
];
}
}

- (void)AlertShow:(NSString *)content {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil
message:content
delegate:self
cancelButtonTitle:@"确定"
cancelButtonTitle:RCDLocalizedString(@"confirm")

otherButtonTitles:nil];
[alert show];
}
Expand Down
Loading

0 comments on commit 1f1e53e

Please sign in to comment.