set image for securityButton

This commit is contained in:
Danmei Chen 2018-11-09 16:50:38 +01:00
parent 74174dd4b1
commit e62ca22d23
5 changed files with 8 additions and 2 deletions

View file

@ -229,6 +229,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[_tableController setChatRoom:_chatRoom];
_chatView.hidden = NO;
[_encryptedButton setImage:[FastAddressBook imageForSecurityLevel:linphone_chat_room_get_security_level(_chatRoom)] forState:UIControlStateNormal];
[self update];
[self shareFile];
}

View file

@ -127,7 +127,7 @@ static UICompositeViewDescription *compositeDescription = nil;
DevicesMenuEntry *entry = [_devicesMenuEntries objectAtIndex:indexPath.row];
[ContactDisplay setDisplayNameLabel:cell.addressLabel forAddress:linphone_participant_get_address(entry->participant)];
cell.devices = linphone_participant_get_devices(entry->participant);
cell.participant = entry->participant;
[cell update:(entry->numberOfDevices != 0)];
return cell;

View file

@ -16,6 +16,7 @@
@property (weak, nonatomic) IBOutlet UIButton *securityButton;
@property (weak, nonatomic) IBOutlet UITableView *devicesTable;
@property bctbx_list_t *devices;
@property LinphoneParticipant *participant;
- (IBAction)onSecurityCallClick:(id)sender;
- (id)initWithIdentifier:(NSString *)identifier;

View file

@ -27,13 +27,17 @@
}
- (void)update:(BOOL)listOpen {
_devices = linphone_participant_get_devices(_participant);
UIImage *image = [FastAddressBook imageForSecurityLevel:linphone_participant_get_security_level(_participant)];
if (bctbx_list_size(_devices) == 1) {
[_securityButton setImage:image forState:UIControlStateNormal];
_securityButton.hidden = FALSE;
_dropMenuButton.hidden = TRUE;
} else {
UIImage *image = listOpen ? [UIImage imageNamed:@"chevron_list_open"] : [UIImage imageNamed:@"chevron_list_close"];
[_dropMenuButton setImage:image forState:UIControlStateNormal];
}
[_securityImage setImage:image];
}
- (IBAction)onSecurityCallClick:(id)sender {

View file

@ -58,7 +58,7 @@
return [UIImage imageNamed:@"security_2_indicator.png.png"];
default:
return nil;
return [UIImage imageNamed:@"security_toogle_icon_grey.png"];
}
}