MESSENGER-5610 change profile hint

This commit is contained in:
Arnfried Griesert
2024-02-16 06:46:48 +00:00
parent 0bc6ec93e0
commit 3d75c4ad84
9 changed files with 185 additions and 1 deletions
+16 -1
View File
@@ -878,6 +878,7 @@ SSOAuthenticationPresenterDelegate>
[self.tableView registerClass:MXKTableViewCellWithLabelAndTextField.class forCellReuseIdentifier:[MXKTableViewCellWithLabelAndTextField defaultReuseIdentifier]];
[self.tableView registerClass:MXKTableViewCellWithLabelAndSwitch.class forCellReuseIdentifier:[MXKTableViewCellWithLabelAndSwitch defaultReuseIdentifier]];
[self.tableView registerClass:MXKTableViewCellWithLabelAndMXKImageView.class forCellReuseIdentifier:[MXKTableViewCellWithLabelAndMXKImageView defaultReuseIdentifier]];
[self.tableView registerClass:BWITableViewCellWithLabelAndMXKImageView.class forCellReuseIdentifier:[BWITableViewCellWithLabelAndMXKImageView defaultReuseIdentifier]]; // bwi: 5610
[self.tableView registerClass:TableViewCellWithPhoneNumberTextField.class forCellReuseIdentifier:[TableViewCellWithPhoneNumberTextField defaultReuseIdentifier]];
[self.tableView registerNib:MXKTableViewCellWithTextView.nib forCellReuseIdentifier:[MXKTableViewCellWithTextView defaultReuseIdentifier]];
[self.tableView registerNib:SectionFooterView.nib forHeaderFooterViewReuseIdentifier:[SectionFooterView defaultReuseIdentifier]];
@@ -2004,13 +2005,20 @@ SSOAuthenticationPresenterDelegate>
if (row == USER_SETTINGS_PROFILE_PICTURE_INDEX)
{
MXKTableViewCellWithLabelAndMXKImageView *profileCell = [tableView dequeueReusableCellWithIdentifier:[MXKTableViewCellWithLabelAndMXKImageView defaultReuseIdentifier] forIndexPath:indexPath];
BWITableViewCellWithLabelAndMXKImageView *profileCell = [tableView dequeueReusableCellWithIdentifier:[BWITableViewCellWithLabelAndMXKImageView defaultReuseIdentifier] forIndexPath:indexPath];
// bwi: keep reference to cell image view
bwiProfileImage = profileCell.mxkImageView;
profileCell.mxkLabelLeadingConstraint.constant = tableView.vc_separatorInset.left;
profileCell.mxkImageViewTrailingConstraint.constant = 10;
profileCell.bwiHintLeadingConstraint.constant = tableView.vc_separatorInset.left;
if(![BWIBuildSettings.shared showChangeProfilePictureHint] || ![BWIBuildSettings.shared isFederationEnabled]) {
// Change constraints to get the default spacing when no hint is shown
profileCell.bwiHintTopConstraint.constant = 0;
profileCell.bwiHintBottomConstraint.constant = 5.5;
}
profileCell.mxkImageViewWidthConstraint.constant = profileCell.mxkImageViewHeightConstraint.constant = 30;
profileCell.mxkImageViewDisplayBoxType = MXKTableViewCellDisplayBoxTypeCircle;
@@ -2026,6 +2034,13 @@ SSOAuthenticationPresenterDelegate>
profileCell.accessibilityIdentifier=@"SettingsVCProfilPictureStaticText";
profileCell.mxkLabel.textColor = ThemeService.shared.theme.textPrimaryColor;
if([BWIBuildSettings.shared showChangeProfilePictureHint] && [BWIBuildSettings.shared isFederationEnabled]) {
profileCell.bwiHint.text = [BWIL10n settingsChangeProfileAvatarHint];
profileCell.bwiHint.textColor = ThemeService.shared.theme.textSecondaryColor;
} else {
profileCell.bwiHint.text = nil;
}
// if the user defines a new avatar
if (newAvatarImage)
{