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.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
RongRobot committed Nov 17, 2016
1 parent e89a28a commit e078803
Show file tree
Hide file tree
Showing 34 changed files with 247 additions and 126 deletions.
37 changes: 20 additions & 17 deletions ios-rongimdemo/RCDChangePasswordViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ - (void)viewDidLoad {
self.view.backgroundColor = [UIColor colorWithHexString:@"f0f0f6"
alpha:1.f];

[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(textFieldEditChanged:)
name:@"UITextFieldTextDidChangeNotification" object:nil];
}

- (void)didReceiveMemoryWarning {
Expand Down Expand Up @@ -247,14 +249,11 @@ - (void)saveNewPassword:(id)sender {
__weak __typeof(&*self) weakSelf = self;
NSString *userPwd = [DEFAULTS objectForKey:@"userPwd"];
if ([userPwd isEqualToString:self.oldPwdTextField.text]) {
if (self.newsPwdTextField.text.length > 20) {
[self AlertShow:@"密码不能大于20位!"];
return;
NSInteger newPwdLength = self.newsPwdTextField.text.length;
if (newPwdLength <6 || newPwdLength > 20) {
[self AlertShow:@"密码必须为6-16位字符,区分大小写"];
}
if (self.newsPwdTextField.text.length == 0) {
[self AlertShow:@"密码不能为空!"];
return;
} else {
else {
if ([self.newsPwdTextField.text isEqualToString:self.confirmPwdTextField.text]) {
[AFHttpTool changePassword:self.oldPwdTextField.text
newPwd:self.newsPwdTextField.text
Expand All @@ -270,12 +269,12 @@ - (void)saveNewPassword:(id)sender {
}];

} else {
[self AlertShow:@"确认密码填写有误"];
[self AlertShow:@"填写的确认密码与新密码不一致"];
}
}

} else {
[self AlertShow:@"原密码填写有误"];
[self AlertShow:@"原密码填写错误"];
}
}

Expand All @@ -292,13 +291,17 @@ - (void) clickBackBtn {
[self.navigationController popViewControllerAnimated:YES];
}

#pragma mark - UITextField Delegate
- (BOOL)textField:(UITextField *)textField
shouldChangeCharactersInRange:(NSRange)range
replacementString:(NSString *)string {
[self.rightBtn buttonIsCanClick:YES
buttonColor:[UIColor whiteColor]
barButtonItem:self.rightBtn];
return YES;
-(void)textFieldEditChanged:(NSNotification *)obj
{
if (self.oldPwdTextField.text.length > 0 || self.newsPwdTextField.text.length > 0 || self.confirmPwdTextField.text.length > 0) {
[self.rightBtn buttonIsCanClick:YES
buttonColor:[UIColor whiteColor]
barButtonItem:self.rightBtn];

} else {
[self.rightBtn buttonIsCanClick:NO
buttonColor:[UIColor colorWithHexString:@"9fcdfd" alpha:1.0]
barButtonItem:self.rightBtn];
}
}
@end
4 changes: 4 additions & 0 deletions ios-rongimdemo/RCDEditGroupNameViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#import <RongIMKit/RongIMKit.h>
#import "UIColor+RCColor.h"
#import "RCDUIBarButtonItem.h"
#import "RCDataBaseManager.h"

@interface RCDEditGroupNameViewController ()

Expand Down Expand Up @@ -119,6 +120,9 @@ - (void)clickDone:(id)sender {
[[RCIM sharedRCIM]
refreshGroupInfoCache:groupInfo
withGroupId:_groupInfo.groupId];
RCDGroupInfo *tempGroupInfo = [[RCDataBaseManager shareInstance] getGroupByGroupId:groupInfo.groupId];
tempGroupInfo.groupName = nameStr;
[[RCDataBaseManager shareInstance] insertGroupToDB:tempGroupInfo];
[self.navigationController
popViewControllerAnimated:YES];
}
Expand Down
3 changes: 0 additions & 3 deletions ios-rongimdemo/RCDGroupSettingsTableViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,4 @@

@property(nonatomic, strong) RCDGroupInfo *Group;

@property(nonatomic, strong) NSMutableArray *GroupMemberList;


@end
124 changes: 61 additions & 63 deletions ios-rongimdemo/RCDGroupSettingsTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ - (void)viewDidLoad {

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if (collectionViewResource.count < 1) {
[self startLoad];
}
if(self.Group.number){
self.title = [NSString stringWithFormat:@"群组信息(%@)",self.Group.number];
}else{
Expand Down Expand Up @@ -212,11 +214,11 @@ - (void)startLoad {

}];
}
_GroupMemberList = [[RCDataBaseManager shareInstance] getGroupMember:groupId];
_GroupMemberList = [self moveCreator:_GroupMemberList];
NSArray *resultList = [[RCDUserInfoManager shareInstance] getFriendInfoList:_GroupMemberList];
_GroupMemberList = [[NSMutableArray alloc] initWithArray:resultList];
for (RCUserInfo *user in _GroupMemberList) {
NSMutableArray *groupMemberList = [[RCDataBaseManager shareInstance] getGroupMember:groupId];
groupMemberList = [self moveCreator:groupMemberList];
NSArray *resultList = [[RCDUserInfoManager shareInstance] getFriendInfoList:groupMemberList];
groupMemberList = [[NSMutableArray alloc] initWithArray:resultList];
for (RCUserInfo *user in groupMemberList) {
[[RCDUserInfoManager shareInstance]
getFriendInfo:user.userId
completion:^(RCUserInfo *user) {
Expand All @@ -228,10 +230,10 @@ - (void)startLoad {
}];
}

if ([_GroupMemberList count] > 0) {
if ([groupMemberList count] > 0) {
/******************添加headerview*******************/
collectionViewResource =
[[NSMutableArray alloc] initWithArray:_GroupMemberList];
[[NSMutableArray alloc] initWithArray:groupMemberList];
//dispatch_async(dispatch_get_main_queue(), ^{
[self setHeaderView];
// });
Expand All @@ -245,51 +247,16 @@ - (void)startLoad {
weakSelf.title = [NSString stringWithFormat:@"群组信息(%lu)",(unsigned long)result.count];
RCDBaseSettingTableViewCell *cell =
(RCDBaseSettingTableViewCell *)
[weakSelf.tableView viewWithTag:RCDGroupSettingsTableViewCellGroupNameTag];
[self.tableView viewWithTag:RCDGroupSettingsTableViewCellGroupNameTag];
cell.leftLabel.text = [NSString stringWithFormat:@"全部群成员(%lu)", (unsigned long)result.count];
});
collectionViewResource = [NSMutableArray new];
//<<<<<<< HEAD
// weakSelf.GroupMemberList = [NSMutableArray new];
// [collectionViewResource
// addObjectsFromArray:result];
// [weakSelf.GroupMemberList addObjectsFromArray:result];
// weakSelf.GroupMemberList = [weakSelf moveCreator:weakSelf.GroupMemberList];
// [weakSelf limitDisplayMemberCount];
// UIImage *addImage =
// [UIImage imageNamed:@"add_member"];
// [collectionViewResource addObject:addImage];
// if (isCreator == YES) {
// UIImage *delImage =
// [UIImage imageNamed:@"delete_member"];
// [collectionViewResource addObject:delImage];
// }
// [headerView reloadData];
// headerView.frame = CGRectMake(
// 0, 0,
// [UIScreen mainScreen].bounds.size.width,
// headerView.collectionViewLayout
// .collectionViewContentSize.height);
// CGRect frame = headerView.frame;
// frame.size.height += 14;
// weakSelf.tableView.tableHeaderView = [[UIView alloc] initWithFrame:frame];
// [weakSelf.tableView.tableHeaderView addSubview:headerView];
// weakSelf.tableView.tableHeaderView.backgroundColor = [UIColor whiteColor];
//
// [weakSelf.tableView reloadData];
//=======
_GroupMemberList = [NSMutableArray new];
[_GroupMemberList addObjectsFromArray:result];
_GroupMemberList = [self moveCreator:_GroupMemberList];
NSArray *resultList = [[RCDUserInfoManager shareInstance] getFriendInfoList:_GroupMemberList];
_GroupMemberList = [[NSMutableArray alloc] initWithArray:resultList];
[collectionViewResource
addObjectsFromArray:_GroupMemberList];
NSMutableArray *tempArray = result;
tempArray = [self moveCreator:tempArray];
NSArray *resultList = [[RCDUserInfoManager shareInstance] getFriendInfoList:tempArray];
NSMutableArray *groupMemberList = [[NSMutableArray alloc] initWithArray:resultList];
collectionViewResource = [groupMemberList mutableCopy];
[self setHeaderView];
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData];
});
//>>>>>>> dev
[[RCDataBaseManager shareInstance]
insertGroupMemberToDB:result
groupId:groupId
Expand Down Expand Up @@ -750,7 +717,9 @@ - (void)tableView:(UITableView *)tableView
case 0:{
RCDGroupMembersTableViewController *GroupMembersVC =
[[RCDGroupMembersTableViewController alloc] init];
GroupMembersVC.GroupMembers =_GroupMemberList;
NSMutableArray *groupMemberList = [[RCDataBaseManager shareInstance] getGroupMember:_Group.groupId];
groupMemberList = [self moveCreator:groupMemberList];
GroupMembersVC.GroupMembers = groupMemberList;
[self.navigationController pushViewController:GroupMembersVC animated:YES];
}break;

Expand Down Expand Up @@ -909,9 +878,11 @@ - (void)collectionView:(UICollectionView *)collectionView
contactSelectedVC.groupId = _Group.groupId;
contactSelectedVC.isAllowsMultipleSelection = YES;
NSMutableArray *membersId = [NSMutableArray new];
for (RCUserInfo *user in _GroupMemberList) {
NSString *userId = user.userId;
[membersId addObject:userId];
for (id user in collectionViewResource) {
if ([user isKindOfClass:[RCUserInfo class]]) {
NSString *userId = ((RCUserInfo*)user).userId;
[membersId addObject:userId];
}
}
//判断如果是创建者
if (isCreator == YES) {
Expand All @@ -925,11 +896,16 @@ - (void)collectionView:(UICollectionView *)collectionView
}
//点减号
if (indexPath.row == collectionViewResource.count - 1) {
if (collectionViewResource.count == 3) {
return;
}
contactSelectedVC.titleStr = @"移除成员";
NSMutableArray *members = [NSMutableArray new];
for (RCUserInfo *user in _GroupMemberList) {
if (![user.userId isEqualToString:creatorId]) {
[members addObject:user];
for (id user in collectionViewResource) {
if ([user isKindOfClass:[RCUserInfo class]]) {
if (![((RCUserInfo *)user).userId isEqualToString:creatorId]) {
[members addObject:user];
}
}
}
contactSelectedVC.delGroupMembers = members;
Expand All @@ -947,7 +923,7 @@ - (void)collectionView:(UICollectionView *)collectionView
return;
}
}
RCUserInfo *selectedUser = [_GroupMemberList objectAtIndex:indexPath.row];
RCUserInfo *selectedUser = [collectionViewResource objectAtIndex:indexPath.row];
BOOL isFriend = NO;
NSArray *friendList = [[RCDataBaseManager shareInstance] getAllFriends];
for (RCDUserInfo *friend in friendList) {
Expand All @@ -963,14 +939,14 @@ - (void)collectionView:(UICollectionView *)collectionView
[[RCDPersonDetailViewController alloc]init];
[self.navigationController pushViewController:detailViewController
animated:YES];
RCUserInfo *user = [_GroupMemberList objectAtIndex:indexPath.row];
RCUserInfo *user = [collectionViewResource objectAtIndex:indexPath.row];
detailViewController.userId = user.userId;
} else {
RCDAddFriendViewController *addViewController = [[RCDAddFriendViewController alloc]init];

addViewController.targetUserInfo =

[_GroupMemberList objectAtIndex:indexPath.row];
[collectionViewResource objectAtIndex:indexPath.row];

[self.navigationController pushViewController:addViewController

Expand All @@ -982,13 +958,28 @@ - (void)didReceiveMessageNotification:(NSNotification *)notification {
RCMessage *message = notification.object;
if ([message.content isMemberOfClass:[RCGroupNotificationMessage class]]) {
RCGroupNotificationMessage *groupNotification = (RCGroupNotificationMessage *)message.content;
if ([groupNotification.operation isEqualToString:GroupNotificationMessage_GroupOperationQuit] || [groupNotification.operation isEqualToString:@"Dismiss"]) {
if ([groupNotification.operation isEqualToString:@"Dismiss"]) {
return;
} else if ([groupNotification.operation isEqualToString:@"Quit"] || [groupNotification.operation isEqualToString:@"Add"] || [groupNotification.operation isEqualToString:@"Kicked"]) {
[RCDHTTPTOOL getGroupMembersWithGroupId:message.targetId
Block:^(NSMutableArray *result) {
[[RCDataBaseManager shareInstance]
insertGroupMemberToDB:result
groupId:message.targetId
complete:^(BOOL results) {
dispatch_async(dispatch_get_main_queue(), ^{
self.title = [NSString stringWithFormat:@"群组信息(%lu)",(unsigned long)result.count];
[self refreshHeaderView];
[self refreshTabelViewInfo];
});
}];
}];
} else if ([groupNotification.operation isEqualToString:@"Rename"]) {
dispatch_async(dispatch_get_main_queue(), ^{
[self refreshTabelViewInfo];
});

}
dispatch_async(dispatch_get_main_queue(), ^{
[self startLoad];
[self refreshTabelViewInfo];
});
}
}

Expand All @@ -1003,6 +994,13 @@ - (void)refreshTabelViewInfo {
}];
}

- (void)refreshHeaderView {
NSMutableArray *groupMemberList = [[RCDataBaseManager shareInstance] getGroupMember:groupId];
collectionViewResource =
[[NSMutableArray alloc] initWithArray:groupMemberList];
[self setHeaderView];
}

- (void)limitDisplayMemberCount {
if (isCreator == YES && [collectionViewResource count] > 18) {
NSRange rang = NSMakeRange(18, [collectionViewResource count] - 18);
Expand Down
4 changes: 4 additions & 0 deletions ios-rongimdemo/RCDMainTabBarViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@

@interface RCDMainTabBarViewController : UITabBarController<UITabBarControllerDelegate>

+ (RCDMainTabBarViewController *)shareInstance;

@property (nonatomic, assign) NSUInteger selectedTabBarIndex;

@end
11 changes: 10 additions & 1 deletion ios-rongimdemo/RCDMainTabBarViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ @interface RCDMainTabBarViewController ()

@implementation RCDMainTabBarViewController

+ (RCDMainTabBarViewController *)shareInstance {
static RCDMainTabBarViewController *instance = nil;
static dispatch_once_t predicate;
dispatch_once(&predicate, ^{
instance = [[[self class] alloc] init];
});
return instance;
}

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
Expand Down Expand Up @@ -95,6 +104,7 @@ -(void)setTabBarItems {
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
NSUInteger index = tabBarController.selectedIndex;
[RCDMainTabBarViewController shareInstance].selectedTabBarIndex = index;
switch (index) {
case 0:
{
Expand Down Expand Up @@ -124,7 +134,6 @@ - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewCon
default:
break;
}
[[NSNotificationCenter defaultCenter] postNotificationName:@"NotifyTabBarIndex" object:[NSString stringWithFormat:@"%lu",(unsigned long)index]];
}

-(void)changeSelectedIndex:(NSNotification *)notify {
Expand Down
5 changes: 3 additions & 2 deletions ios-rongimdemo/RCDReceiptDetailsTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ - (void)setHeaderView {
}

-(void)setHeaderViewAutolayout {
self.headerView.frame = CGRectMake(0, 0, self.tableView.frame.size.width, self.headerViewHeight);
[self.headerView
addConstraints:[NSLayoutConstraint
constraintsWithVisualFormat:@"H:|-9.5-[_nameLabel]-100-|"
Expand All @@ -195,7 +196,7 @@ -(void)setHeaderViewAutolayout {
metrics:nil
views:self.headerSubViews]];
NSUInteger lines = [self numberOfRowsInLabel:self.messageContentLabel];
if (lines < 4) {
if (lines <= 4) {
self.openAndCloseButton.hidden = YES;

self.MessageContentLabelConstraints = [NSLayoutConstraint
Expand All @@ -210,7 +211,7 @@ -(void)setHeaderViewAutolayout {
self.headerView.frame = CGRectMake(0, 0, self.tableView.frame.size.width, self.headerViewHeight);
self.tableView.tableHeaderView = self.headerView;
}
if (lines >= 4) {
if (lines > 4) {
self.MessageContentLabelConstraints = [[NSLayoutConstraint
constraintsWithVisualFormat:@"V:|-7.5-[_nameLabel(21)]-7-[_messageContentLabel]-8.5-[_openAndCloseButton(14)]"
options:0
Expand Down
2 changes: 1 addition & 1 deletion ios-rongimdemo/RCloudMessage.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2075,7 +2075,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#echo \"*Begin copy redpacket libray*\"\n#if [ ! -d \"framework/JrmfIMLib\" ]; then\ncp -rf ../ios-3rd-vendor/jrmf/AlipaySDK ./framework/\ncp -rf ../ios-3rd-vendor/jrmf/JrmfIMLib ./framework/\n#else\n#SIZE1=`stat ./framework/JrmfIMLib/JrmfPacketKit.framework/JrmfPacketKit | awk '{print $8}'`\n#SIZE2=`stat ../ios-3rd-vendor/jrmf/JrmfIMLib/JrmfPacketKit.framework/JrmfPacketKit | awk '{print $8}'`\n\n#if [ $SIZE1==$SIZE2 ]\n#then\n#SIZE3=`stat ./framework/JrmfIMLib/JYangToolKit.framework/JYangToolKit | awk '{print $8}'`\n#SIZE4=`stat ../ios-3rd-vendor/jrmf/JrmfIMLib/JYangToolKit.framework/JYangToolKit | awk '{print $8}'`\n\n#if [ $SIZE3==$SIZE4 ]\n#then\n#echo \"no need copy redpacket library, already exist!\"\n#else\n#cp -rf ../ios-3rd-vendor/jrmf/AlipaySDK ./framework/\n#cp -rf ../ios-3rd-vendor/jrmf/JrmfIMLib ./framework/\n#fi\n#else\n#cp -rf ../ios-3rd-vendor/jrmf/AlipaySDK ./framework/\n#cp -rf ../ios-3rd-vendor/jrmf/JrmfIMLib ./framework/\n#fi\n#fi\necho \"*Finished copy redpacket libray*\"";
shellScript = "sh xcodebuild.sh";
};
/* End PBXShellScriptBuildPhase section */

Expand Down
Loading

0 comments on commit e078803

Please sign in to comment.