Add custom checkboxes to multiselection tables.

Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Ivan Sein 2018-06-27 13:50:29 +02:00
Родитель 5a0fefc779
Коммит 801455efe4
11 изменённых файлов: 56 добавлений и 4 удалений

Просмотреть файл

@ -308,7 +308,10 @@
cell.contactImage.layer.cornerRadius = 24.0;
cell.contactImage.layer.masksToBounds = YES;
cell.accessoryType = ([self isParticipantAlreadySelected:participant]) ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
UIImageView *checkboxChecked = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"checkbox-checked"]];
UIImageView *checkboxUnchecked = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"checkbox-unchecked"]];
cell.accessoryView = ([self isParticipantAlreadySelected:participant]) ? checkboxChecked : checkboxUnchecked;
return cell;
}

Просмотреть файл

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "checkbox-checked.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "checkbox-checked@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "checkbox-checked@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Двоичные данные
VideoCalls/Images.xcassets/checkbox-checked.imageset/checkbox-checked.png поставляемый Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 633 B

Двоичные данные
VideoCalls/Images.xcassets/checkbox-checked.imageset/checkbox-checked@2x.png поставляемый Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.2 KiB

Двоичные данные
VideoCalls/Images.xcassets/checkbox-checked.imageset/checkbox-checked@3x.png поставляемый Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.7 KiB

Просмотреть файл

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "checkbox-unchecked.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "checkbox-unchecked@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "checkbox-unchecked@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Двоичные данные
VideoCalls/Images.xcassets/checkbox-unchecked.imageset/checkbox-unchecked.png поставляемый Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 693 B

Двоичные данные
VideoCalls/Images.xcassets/checkbox-unchecked.imageset/checkbox-unchecked@2x.png поставляемый Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.4 KiB

Двоичные данные
VideoCalls/Images.xcassets/checkbox-unchecked.imageset/checkbox-unchecked@3x.png поставляемый Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.1 KiB

Просмотреть файл

@ -78,10 +78,10 @@
cell.contactImage.layer.cornerRadius = 24.0;
cell.contactImage.layer.masksToBounds = YES;
cell.accessoryType = UITableViewCellAccessoryNone;
cell.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"checkbox-unchecked"]];
for (NCUser *user in _selectedParticipants) {
if ([user.userId isEqualToString:contact.userId]) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
cell.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"checkbox-checked"]];
}
}

Просмотреть файл

@ -277,7 +277,10 @@
cell.contactImage.layer.cornerRadius = 24.0;
cell.contactImage.layer.masksToBounds = YES;
cell.accessoryType = ([self isParticipantAlreadySelected:participant]) ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
UIImageView *checkboxChecked = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"checkbox-checked"]];
UIImageView *checkboxUnchecked = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"checkbox-unchecked"]];
cell.accessoryView = ([self isParticipantAlreadySelected:participant]) ? checkboxChecked : checkboxUnchecked;
return cell;
}