Authored by 盖剑秋

Reset UI after push end.

@@ -88,7 +88,7 @@ @@ -88,7 +88,7 @@
88 [startButton setTitle:@"开始直播" forState:UIControlStateNormal]; 88 [startButton setTitle:@"开始直播" forState:UIControlStateNormal];
89 89
90 UIButton *closeButton = [UIButton buttonWithType:UIButtonTypeCustom]; 90 UIButton *closeButton = [UIButton buttonWithType:UIButtonTypeCustom];
91 - closeButton.frame = CGRectMake(280-18-8, 8, 18, 18); 91 + closeButton.frame = CGRectMake(280-36, 0, 36, 36);
92 [closeButton setImage:[UIImage imageNamed:@"home_btn_close"] forState:UIControlStateNormal]; 92 [closeButton setImage:[UIImage imageNamed:@"home_btn_close"] forState:UIControlStateNormal];
93 [bg addSubview:closeButton]; 93 [bg addSubview:closeButton];
94 [closeButton addTarget:self action:@selector(closeButtonPressed) forControlEvents:UIControlEventTouchUpInside]; 94 [closeButton addTarget:self action:@selector(closeButtonPressed) forControlEvents:UIControlEventTouchUpInside];
@@ -115,6 +115,15 @@ @@ -115,6 +115,15 @@
115 115
116 } 116 }
117 117
  118 +- (void)resetAfterPushEnd {
  119 + dispatch_async(dispatch_get_main_queue(), ^{
  120 + [self.barrageViewController reset];
  121 + self.emojiCountLabel.text = @"0";
  122 + self.timeLabel.text = @"00:00:00";
  123 + self.onlineCountLabel.text = @"0";
  124 + });
  125 +}
  126 +
118 - (YH_BarrageViewController *) barrageViewController 127 - (YH_BarrageViewController *) barrageViewController
119 { 128 {
120 if (_barrageViewController == nil) { 129 if (_barrageViewController == nil) {
@@ -545,6 +554,7 @@ @@ -545,6 +554,7 @@
545 554
546 [[YH_NetworkAdapter adapter] setStatusWithStat:PushStatusEnd andRoomId:_currentChannel.room completion:^(BOOL flag, NSError *error) { 555 [[YH_NetworkAdapter adapter] setStatusWithStat:PushStatusEnd andRoomId:_currentChannel.room completion:^(BOOL flag, NSError *error) {
547 _currentChannel = nil; 556 _currentChannel = nil;
  557 + [self resetAfterPushEnd];
548 }]; 558 }];
549 [_socketService logout]; 559 [_socketService logout];
550 _socketService=nil; 560 _socketService=nil;
@@ -84,6 +84,9 @@ @@ -84,6 +84,9 @@
84 [_scrollingTableViewTimer invalidate]; 84 [_scrollingTableViewTimer invalidate];
85 _scrollingTableViewTimer = nil; 85 _scrollingTableViewTimer = nil;
86 } 86 }
  87 +
  88 + [self resetDataMutableArray];
  89 + [self reloadData];
87 } 90 }
88 - (void)resetDataMutableArray 91 - (void)resetDataMutableArray
89 { 92 {