Commit 3e497392114832c469c3a4cb8f8f969c925ad8c1
Merge branch 'master' of bj.gitlab.cnlive.com:ios-team/LiveVideoCloud
Showing
8 changed files
with
102 additions
and
32 deletions
LiveVideoCloud/AppCustoms/Main/View/LVCTabBar.m
... | ... | @@ -43,13 +43,15 @@ |
43 | 43 | { |
44 | 44 | [super layoutSubviews]; |
45 | 45 | |
46 | - self.liveBtn.top = self.height - 96 / 2; | |
47 | - _liveBtn.left = SCREEN_WIDTH * 0.5 - 96 / 4; | |
48 | - _liveBtn.width = 96 / 2; | |
49 | - _liveBtn.height = 96 / 2; | |
46 | + CGFloat liveW = 96 / 2; | |
47 | + CGFloat liveH = 96 / 2; | |
48 | + self.liveBtn.top = self.height - liveH; | |
49 | + _liveBtn.left = SCREEN_WIDTH * 0.5 - liveW / 2; | |
50 | + _liveBtn.width = liveW; | |
51 | + _liveBtn.height = liveH; | |
50 | 52 | |
51 | 53 | CGFloat buttonY = 19 - 3;//19 - 3.5; |
52 | - CGFloat buttonW = (self.width - 96 / 2)/ 4; | |
54 | + CGFloat buttonW = (self.width - liveW)/ 4; | |
53 | 55 | CGFloat buttonH = 30; |
54 | 56 | |
55 | 57 | NSInteger index = 0; |
... | ... | @@ -59,7 +61,7 @@ |
59 | 61 | CGFloat buttonX = index * buttonW; |
60 | 62 | if (index >= 2) |
61 | 63 | { |
62 | - buttonX += 96 / 2; | |
64 | + buttonX += liveW; | |
63 | 65 | } |
64 | 66 | |
65 | 67 | subView.frame = CGRectMake(buttonX, buttonY, buttonW, buttonH); | ... | ... |
LiveVideoCloud/AppDelegate/AppDelegate.m
... | ... | @@ -51,16 +51,23 @@ |
51 | 51 | |
52 | 52 | // 20170327 20170328 |
53 | 53 | |
54 | - | |
55 | - CNLiveChatUserInfo *userInfo = [[CNLiveChatUserInfo alloc] initWithUserId:@"2017063339" name:@"设计的" portrait:@"http://b.hiphotos.baidu.com/zhidao/wh%3D450%2C600/sign=f0c5c08030d3d539c16807c70fb7c566/8ad4b31c8701a18bbef9f231982f07082838feba.jpg"]; | |
56 | - | |
57 | - | |
58 | - [[CNLiveChatManager sharedCNLiveChatManager] loginServer:userInfo success:^(NSString *userId) { | |
59 | - NSLog(@"连接服务器-----success"); | |
54 | + if ([UserTools isLogin]) { | |
55 | + | |
56 | + CNLiveChatUserInfo *userInfo = [[CNLiveChatUserInfo alloc] initWithUserId:[UserInformationModel manager].uid name:[UserInformationModel manager].nickname portrait:[UserInformationModel manager].faceUrl]; | |
57 | + | |
58 | + [[CNLiveChatManager sharedCNLiveChatManager] loginServer:userInfo success:^(NSString *userId) { | |
59 | + NSLog(@"连接服务器-----success"); | |
60 | + } error:^(CNLiveChatConnectErrorCode errors) { | |
61 | + NSLog(@"连接服务器失败-----%ld", errors); | |
62 | + }]; | |
63 | + } else { | |
60 | 64 | |
61 | - } error:^(CNLiveChatConnectErrorCode errors) { | |
62 | - NSLog(@"连接服务器失败-----%ld", errors); | |
63 | - }]; | |
65 | + [[CNLiveChatManager sharedCNLiveChatManager] connectServerSuccess:^{ | |
66 | + NSLog(@"连接服务器-----success"); | |
67 | + } error:^(CNLiveChatConnectErrorCode errors) { | |
68 | + NSLog(@"连接服务器失败-----%ld", errors); | |
69 | + }]; | |
70 | + } | |
64 | 71 | |
65 | 72 | [self.window makeKeyAndVisible]; |
66 | 73 | ... | ... |
LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftViews/GiftListView.m
... | ... | @@ -26,6 +26,7 @@ |
26 | 26 | @property (nonatomic ,weak ) LiveBaseView * _Nullable liveBaseView; |
27 | 27 | @property (nonatomic, strong) AnimQueueManager * animQueueManager; |
28 | 28 | @property (nonatomic ,strong) GiftModel * _Nullable model; |
29 | +@property (nonatomic ,strong) UIScrollView * _Nullable scrollView; | |
29 | 30 | @property (nonatomic ,assign) BOOL isSelectedGift; |
30 | 31 | @property (nonatomic ,assign) NSInteger curruntSelectIdx; |
31 | 32 | |
... | ... | @@ -53,6 +54,7 @@ |
53 | 54 | scrollView.showsVerticalScrollIndicator = NO; |
54 | 55 | scrollView.showsHorizontalScrollIndicator = NO; |
55 | 56 | [self addSubview:scrollView]; |
57 | + self.scrollView = scrollView; | |
56 | 58 | |
57 | 59 | int line = 0; |
58 | 60 | int row = 0; |
... | ... | @@ -155,17 +157,40 @@ |
155 | 157 | #pragma mark - 选择礼物点击 |
156 | 158 | - (void)gestureClick:(UITapGestureRecognizer *)gesture |
157 | 159 | { |
158 | - _isSelectedGift = YES; | |
159 | 160 | NSInteger tag = gesture.view.tag - 10; |
160 | 161 | NSLog(@"%zd",tag); |
161 | 162 | |
162 | -// if (_curruntSelectIdx == tag && _isSelectedGift) { | |
163 | -// _isSelectedGift = NO; | |
164 | -// _curruntSelectIdx = -1; | |
165 | -// } | |
166 | -// _curruntSelectIdx = tag; | |
167 | - | |
168 | - //右上角添加✔️,再次点击去掉✔️ | |
163 | + if (_curruntSelectIdx == 0 && _isSelectedGift == NO) {//没选过 | |
164 | + UIView *giftView = gesture.view; | |
165 | + | |
166 | + UIImageView *bgView = [[UIImageView alloc] initWithFrame:giftView.bounds]; | |
167 | + bgView.backgroundColor = [UIColor blackColor]; | |
168 | + bgView.tag = giftView.tag + 100; | |
169 | + bgView.alpha = 0.2; | |
170 | + [giftView addSubview:bgView]; | |
171 | + } | |
172 | + | |
173 | + if (_curruntSelectIdx != 0 && _isSelectedGift == YES) {//选过 | |
174 | + UIView *gView = gesture.view; | |
175 | + for (UIView *view in self.scrollView.subviews) {//移除上一个bgView | |
176 | + if (view.tag == _curruntSelectIdx) { | |
177 | + for (UIView *bg in view.subviews) { | |
178 | + if (bg.tag == view.tag + 100) { | |
179 | + [bg removeFromSuperview]; | |
180 | + break; | |
181 | + } | |
182 | + } | |
183 | + } | |
184 | + } | |
185 | + //增加当前bgView | |
186 | + UIImageView *bgView = [[UIImageView alloc] initWithFrame:gView.bounds]; | |
187 | + bgView.backgroundColor = [UIColor blackColor]; | |
188 | + bgView.tag = gView.tag + 100; | |
189 | + bgView.alpha = 0.2; | |
190 | + [gView addSubview:bgView]; | |
191 | + } | |
192 | + _isSelectedGift = YES; | |
193 | + _curruntSelectIdx = gesture.view.tag; | |
169 | 194 | |
170 | 195 | GiftModel *model = self.giftArray[tag]; |
171 | 196 | model.sender = [CNLiveChatManager sharedCNLiveChatManager].currentUserInfo.name; | ... | ... |
LiveVideoCloud/Classes/Sections/LiveSections/Controller/LVCVerifyViewController.m
... | ... | @@ -16,6 +16,24 @@ |
16 | 16 | |
17 | 17 | @implementation LVCVerifyViewController |
18 | 18 | |
19 | +- (void)viewDidAppear:(BOOL)animated | |
20 | +{ | |
21 | + [super viewDidAppear:animated]; | |
22 | + // 禁用返回手势 | |
23 | + if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { | |
24 | + self.navigationController.interactivePopGestureRecognizer.enabled = NO; | |
25 | + } | |
26 | +} | |
27 | + | |
28 | +- (void)viewWillDisappear:(BOOL)animated | |
29 | +{ | |
30 | + [super viewWillDisappear:animated]; | |
31 | + // 开启返回手势 | |
32 | + if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { | |
33 | + self.navigationController.interactivePopGestureRecognizer.enabled = YES; | |
34 | + } | |
35 | +} | |
36 | + | |
19 | 37 | - (void)viewDidLoad { |
20 | 38 | [super viewDidLoad]; |
21 | 39 | ... | ... |
LiveVideoCloud/Classes/Sections/Mine/Login/Controller/LoginViewController.m
... | ... | @@ -89,14 +89,25 @@ |
89 | 89 | |
90 | 90 | [UserTools saveUserinfoDic:result[@"data"]]; |
91 | 91 | [SVProgressHUD dismiss]; |
92 | - | |
92 | + | |
93 | + NSString *uId = result[@"data"][@"uid"]; | |
94 | + NSString *name = result[@"data"][@"nickName"]; | |
95 | + NSString *protrait = result[@"data"][@"faceUrl"]; | |
96 | + //断开聊天SDK连接,以用户信息登录 | |
97 | + [[CNLiveChatManager sharedCNLiveChatManager] logoutServer]; | |
98 | + CNLiveChatUserInfo *userInfo = [[CNLiveChatUserInfo alloc] initWithUserId:uId name:name portrait:protrait]; | |
99 | + [[CNLiveChatManager sharedCNLiveChatManager] loginServer:userInfo success:^(NSString *userId) { | |
100 | + NSLog(@"login CNLiveChat Success"); | |
101 | + } error:^(CNLiveChatConnectErrorCode errors) { | |
102 | + NSLog(@"login error %zd",errors); | |
103 | + }]; | |
104 | + | |
93 | 105 | if(self.isModalButton) { |
94 | 106 | [self dismissViewControllerAnimated:YES completion:NULL]; |
95 | 107 | } else { |
96 | 108 | [self.navigationController popViewControllerAnimated:YES]; |
97 | 109 | } |
98 | - | |
99 | - | |
110 | + | |
100 | 111 | } else { |
101 | 112 | [SVProgressHUD dismiss]; |
102 | 113 | [SVProgressHUD setMinimumDismissTimeInterval:1.0]; | ... | ... |
LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCVodPlayerController.m
... | ... | @@ -61,6 +61,16 @@ typedef enum { |
61 | 61 | - (void)viewWillDisappear:(BOOL)animated |
62 | 62 | { |
63 | 63 | [super viewWillDisappear:animated]; |
64 | + | |
65 | + [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault]; | |
66 | + [[UIApplication sharedApplication] setStatusBarHidden: NO withAnimation:UIStatusBarAnimationNone]; | |
67 | + | |
68 | + self.navigationController.navigationBar.hidden = NO; | |
69 | +} | |
70 | + | |
71 | +- (void)viewDidDisappear:(BOOL)animated { | |
72 | + [super viewDidDisappear:animated]; | |
73 | + | |
64 | 74 | [_player stop]; |
65 | 75 | [_autoHideTimer invalidate]; |
66 | 76 | _autoHideTimer = nil; |
... | ... | @@ -68,10 +78,7 @@ typedef enum { |
68 | 78 | _currentTimer = nil; |
69 | 79 | [[NSNotificationCenter defaultCenter]removeObserver:self name:MPMoviePlayerPlaybackStateDidChangeNotification object:nil]; |
70 | 80 | [_playerSuperView removeFromSuperview]; |
71 | - | |
72 | - [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault]; | |
73 | - [[UIApplication sharedApplication] setStatusBarHidden: NO withAnimation:UIStatusBarAnimationNone]; | |
74 | - self.navigationController.navigationBar.hidden = NO; | |
81 | + | |
75 | 82 | } |
76 | 83 | |
77 | 84 | - (void)viewDidLoad { | ... | ... |
LiveVideoCloud/animation.xcassets/tabBar/ic_camera.imageset/Contents.json
LiveVideoCloud/animation.xcassets/tabBar/ic_camera_sel.imageset/Contents.json
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | "images" : [ |
3 | 3 | { |
4 | 4 | "idiom" : "universal", |
5 | + "filename" : "ic_camera_sel.png", | |
5 | 6 | "scale" : "1x" |
6 | 7 | }, |
7 | 8 | { |
... | ... | @@ -10,7 +11,6 @@ |
10 | 11 | }, |
11 | 12 | { |
12 | 13 | "idiom" : "universal", |
13 | - "filename" : "ic_camera_sel.png", | |
14 | 14 | "scale" : "3x" |
15 | 15 | } |
16 | 16 | ], | ... | ... |