wxr
2024-08-27 a616abd9b740e74eb7aea29cb692ca86ba1f7d7a
HDLLinPhoneSDK£¨OC£©/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m
@@ -27,6 +27,8 @@
@property (nonatomic, strong) UIButton *unlockImgBtn;  //开锁
@property (nonatomic, strong) UIButton *hangUpImgBtn;//挂断按钮
@property (nonatomic, strong) UIButton *hangUpTextBtn;
@property (nonatomic, strong) UIButton *hangUpAllImgBtn;//全部挂断按钮
@property (nonatomic, strong) UIButton *hangUpAllTextBtn;
@property (nonatomic, strong) UIButton *answerImgBtn;//接听按钮
@property (nonatomic, strong) UIButton *answerTextBtn;
@property (nonatomic, strong) UIButton *calltimeBtn; //通话时间按钮
@@ -51,7 +53,9 @@
    NSString * answerStr;
    NSString * unlockSuccessfullyStr;
    NSString * callingStr;
    NSString * hangUpStr;
    NSString * hangUpStr;;
    NSString * hangUpPhoneStr;
    NSString * hangUpAllStr;
    NSString * endOfCallStr;
    
    
@@ -123,6 +127,8 @@
        refuseStr = @"拒绝";
        answerStr = @"接听";
        hangUpStr = @"挂断";
        hangUpPhoneStr = @"挂断手机";
        hangUpAllStr = @"挂断全部";
        unlockSuccessfullyStr = @"开锁成功";
        callingStr = @"来电中...";
        endOfCallStr = @"通话结束";
@@ -136,6 +142,8 @@
        refuseStr = @"Refuse";
        answerStr = @"Answer";
        hangUpStr = @"Hang up";
        hangUpPhoneStr = @"Hang up";
        hangUpAllStr = @"hang up all";
        unlockSuccessfullyStr = @"Unlock successfully";
        callingStr = @"Incoming call";
        endOfCallStr = @"End of call";
@@ -195,6 +203,8 @@
    [self.unlockView addSubview:self.unlockImgBtn];
    [self.centerView addSubview:self.hangUpImgBtn];
    [self.centerView addSubview:self.hangUpTextBtn];
    [self.centerView addSubview:self.hangUpAllImgBtn];
    [self.centerView addSubview:self.hangUpAllTextBtn];
    [self.centerView addSubview:self.answerImgBtn];
    [self.centerView addSubview:self.answerTextBtn];
    [self.centerView addSubview:self.calltimeBtn];
@@ -330,10 +340,10 @@
    if (_hangUpImgBtn == nil) {
        _hangUpImgBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, Height66, Height66)];
        [_hangUpImgBtn setImage:[UIImage imageNamed:@"ic_esvideo_on_hangup"] forState:UIControlStateNormal];
        //        [_hangUpImgBtn setImage:[UIImage imageNamed:@"ic_esvideo_on_hangup"] forState:UIControlStateSelected];
        [_hangUpImgBtn.imageView setContentMode:UIViewContentModeScaleAspectFit];
        [_hangUpImgBtn addTarget:self action:@selector(hangUpAction) forControlEvents:UIControlEventTouchUpInside];
        _hangUpImgBtn.center = CGPointMake(APP_SCREEN_WIDTH/4, GetRealHeight(452) + Height66/2);
        _hangUpImgBtn.center = CGPointMake(APP_SCREEN_WIDTH/2, GetRealHeight(452) + Height66/2);
    }
    return _hangUpImgBtn;
}
@@ -353,11 +363,34 @@
    //2.页面关闭
    [self backAction];
}
//全部挂断 å›¾æ ‡æŒ‰é’®
- (UIButton *)hangUpAllImgBtn{
    if (_hangUpAllImgBtn == nil) {
        _hangUpAllImgBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, Height66, Height66)];
        [_hangUpAllImgBtn setImage:[UIImage imageNamed:@"ic_esvideo_on_hangup_all"] forState:UIControlStateNormal];
        [_hangUpAllImgBtn.imageView setContentMode:UIViewContentModeScaleAspectFit];
        [_hangUpAllImgBtn addTarget:self action:@selector(hangUpAllAction) forControlEvents:UIControlEventTouchUpInside];
        _hangUpAllImgBtn.center = CGPointMake(GetRealWidth(77.5), GetRealHeight(452) + Height66/2);
    }
    return _hangUpAllImgBtn;
}
//全部挂断按钮事件
-(void)hangUpAllAction{
    //1.回调事件
    if(self.hdlLinphoneCallDelegate != NULL){
        [self.hdlLinphoneCallDelegate onRejectAllCallAction];
    }
    //2.页面关闭
    [self backAction];
}
//拒接 æ–‡æœ¬æŒ‰é’®
- (UIButton *)hangUpTextBtn{
    if (_hangUpTextBtn == nil) {
        _hangUpTextBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, GetRealWidth(100), GetRealWidth(20))];
        [_hangUpTextBtn setTitle:@"拒绝" forState:UIControlStateNormal];
        [_hangUpTextBtn setTitle:hangUpPhoneStr forState:UIControlStateNormal];
        _hangUpTextBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
        _hangUpTextBtn.titleLabel.font = [UIFont fontWithName:APP_UIFont size:14.0];
        [_hangUpTextBtn setTitleColor:TextColor forState:UIControlStateNormal];
@@ -368,17 +401,31 @@
    }
    return _hangUpTextBtn;
}
//全部挂断 æ–‡æœ¬æŒ‰é’®
- (UIButton *)hangUpAllTextBtn{
    if (_hangUpAllTextBtn == nil) {
        _hangUpAllTextBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, GetRealWidth(100), GetRealWidth(20))];
        [_hangUpAllTextBtn setTitle:hangUpAllStr forState:UIControlStateNormal];
        _hangUpAllTextBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
        _hangUpAllTextBtn.titleLabel.font = [UIFont fontWithName:APP_UIFont size:14.0];
        [_hangUpAllTextBtn setTitleColor:TextColor forState:UIControlStateNormal];
        [_hangUpAllTextBtn setTitleColor:TextSelectColor forState:UIControlStateSelected];
        [_hangUpAllTextBtn addTarget:self action:@selector(screenshotAction) forControlEvents:UIControlEventTouchUpInside];
        _hangUpAllTextBtn.center = CGPointMake(_hangUpAllImgBtn.center.x, GetRealHeight(530));
    }
    return _hangUpAllTextBtn;
}
//接听 å›¾æ ‡æŒ‰é’®
- (UIButton *)answerImgBtn{
    if (_answerImgBtn == nil) {
        _answerImgBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, Height66, Height66)];
        [_answerImgBtn setImage:[UIImage imageNamed:@"ic_esvideo_on_answer"] forState:UIControlStateNormal];
        //        [_answerImgBtn setImage:[UIImage imageNamed:@"ic_esvideo_on_answer"] forState:UIControlStateSelected];
        [_answerImgBtn.imageView setContentMode:UIViewContentModeScaleAspectFit];
        [_answerImgBtn addTarget:self action:@selector(answerIAction) forControlEvents:UIControlEventTouchUpInside];
        
        _answerImgBtn.center = CGPointMake((APP_SCREEN_WIDTH/4)*3, GetRealHeight(452) + Height66/2);
        _answerImgBtn.center = CGPointMake(APP_SCREEN_WIDTH-GetRealWidth(77.5), GetRealHeight(452) + Height66/2);
    }
    return _answerImgBtn;
}
@@ -401,6 +448,8 @@
    
    _answerImgBtn.hidden = YES;
    _answerTextBtn.hidden = YES;
    _hangUpAllImgBtn.hidden = YES;
    _hangUpAllTextBtn.hidden = YES;
    
    //挂断按钮移动中间
    _hangUpImgBtn.center = CGPointMake(APP_CONTENT_WIDTH / 2, _hangUpImgBtn.center.y);
@@ -437,7 +486,7 @@
- (UIButton *)answerTextBtn{
    if (_answerTextBtn == nil) {
        _answerTextBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, GetRealWidth(100), GetRealWidth(20))];
        [_answerTextBtn setTitle:@"接听" forState:UIControlStateNormal];
        [_answerTextBtn setTitle:answerStr forState:UIControlStateNormal];
        _answerTextBtn.titleLabel.font = [UIFont fontWithName:APP_UIFont size:14.0];
        _answerTextBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
        //        _unlockTextBtn.titleLabel.textColor = TextColor;
@@ -618,7 +667,8 @@
//初始化参数
-(void)initData{
    //    _titleUILabel.text = [[LCApiKit sharedInstance] currentDeviceName];
    [_hangUpTextBtn setTitle:refuseStr forState:UIControlStateNormal];
    [_hangUpTextBtn setTitle:hangUpPhoneStr forState:UIControlStateNormal];
    [_hangUpAllTextBtn setTitle:hangUpAllStr forState:UIControlStateNormal];
    [_answerTextBtn setTitle:answerStr forState:UIControlStateNormal];
    
}