Settings: Profile avatar is not clickable

https://github.com/vector-im/vector-ios/issues/351
This commit is contained in:
giomfo
2016-05-31 16:27:23 +02:00
parent aab232192f
commit f37fc4f123
6 changed files with 27 additions and 122 deletions
+18 -10
View File
@@ -603,6 +603,12 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)();
profileCell.mxkImageViewTrailingConstraint.constant = 10;
profileCell.mxkImageViewWidthConstraint.constant = profileCell.mxkImageViewHeightConstraint.constant = 30;
profileCell.mxkImageViewDisplayBoxType = MXKTableViewCellDisplayBoxTypeCircle;
// tap on avatar to update it
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onProfileAvatarTap:)];
[profileCell.mxkImageView addGestureRecognizer:tap];
}
profileCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_profile_picture", @"Vector", nil);
@@ -628,9 +634,6 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)();
}
}
[profileCell.mxkImageView.layer setCornerRadius:profileCell.mxkImageView.frame.size.width / 2];
profileCell.mxkImageView.clipsToBounds = YES;
cell = profileCell;
}
else if (row == userSettingsDisplayNameIndex)
@@ -1037,13 +1040,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)();
{
if (row == userSettingsProfilePictureIndex)
{
mediaPicker = [MediaPickerViewController mediaPickerViewController];
mediaPicker.mediaTypes = @[(NSString *)kUTTypeImage];
mediaPicker.delegate = self;
UINavigationController *navigationController = [UINavigationController new];
[navigationController pushViewController:mediaPicker animated:NO];
[self presentViewController:navigationController animated:YES completion:nil];
[self onProfileAvatarTap:nil];
}
else if (row == userSettingsChangePasswordIndex)
{
@@ -1420,6 +1417,17 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)();
}
}
- (void)onProfileAvatarTap:(UITapGestureRecognizer *)recognizer
{
mediaPicker = [MediaPickerViewController mediaPickerViewController];
mediaPicker.mediaTypes = @[(NSString *)kUTTypeImage];
mediaPicker.delegate = self;
UINavigationController *navigationController = [UINavigationController new];
[navigationController pushViewController:mediaPicker animated:NO];
[self presentViewController:navigationController animated:YES completion:nil];
}
#pragma mark - MediaPickerViewController Delegate
- (void)dismissMediaPicker