MESSENGER-4730 personal notes visibility old style

This commit is contained in:
Frank Rotermund
2023-09-15 07:39:41 +00:00
parent 5fc2300e28
commit 6a83893e3a
6 changed files with 96 additions and 36 deletions
+26 -1
View File
@@ -172,7 +172,8 @@ typedef NS_ENUM(NSUInteger, USER_INTERFACE)
TIMELINE_USER_AVATAR_INDEX,
TIMELINE_ENTER_ROOM_INDEX,
USER_INTERFACE_LANGUAGE_INDEX,
USER_INTERFACE_TIMELINE_STYLE_INDEX
USER_INTERFACE_TIMELINE_STYLE_INDEX,
PERSONAL_NOTES_INDEX
};
typedef NS_ENUM(NSUInteger, TIMELINE)
@@ -666,6 +667,9 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
//[sectionUserInterface addRowWithTag:USER_INTERFACE_LANGUAGE_INDEX];
[sectionUserInterface addRowWithTag:USER_INTERFACE_THEME_INDEX];
if (BWIBuildSettings.shared.bwiPersonalNotesVisibilityInSettings) {
[sectionUserInterface addRowWithTag:PERSONAL_NOTES_INDEX];
}
sectionUserInterface = [self updateTimeLine:sectionUserInterface];
[tmpSections addObject: sectionUserInterface];
@@ -2559,6 +2563,9 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
} else if (row == USER_INTERFACE_TIMELINE_STYLE_INDEX)
{
cell = [self buildMessageBubblesCellForTableView:tableView atIndexPath:indexPath];
} else if (row == PERSONAL_NOTES_INDEX)
{
cell = [self cellForPersonalNotesVisibility:tableView indexPath:indexPath row:row];
} else {
cell = [self cellForTimeline:tableView indexPath:indexPath row:row];
}
@@ -5408,6 +5415,24 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
[self updateSections];
}
- (UITableViewCell*) cellForPersonalNotesVisibility:(UITableView*)tableView indexPath:(NSIndexPath*)indexPath row:(NSInteger)row {
MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = [BWIL10n bwiSettingsEnableNotesRoomTitle];
labelAndSwitchCell.mxkSwitch.on = [[[PersonalNotesSettings alloc] init] personalNotesVisible];
labelAndSwitchCell.mxkSwitch.thumbTintColor = ThemeService.shared.theme.backgroundColor;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
labelAndSwitchCell.mxkSwitch.enabled = YES;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(togglePersonalNotesVisibility:) forControlEvents:UIControlEventTouchUpInside];
return labelAndSwitchCell;
}
- (void) togglePersonalNotesVisibility:(UISwitch* )sender {
PersonalNotesSettings* settings = [[PersonalNotesSettings alloc] init];
settings.personalNotesVisible = sender.on;
}
#pragma mark - ThreadsBetaCoordinatorBridgePresenterDelegate
- (void)threadsBetaCoordinatorBridgePresenterDelegateDidTapEnable:(ThreadsBetaCoordinatorBridgePresenter *)coordinatorBridgePresenter