Feature/4014 new layout notes room

This commit is contained in:
Frank Rotermund
2023-01-27 10:18:49 +00:00
committed by JanNiklas Grabowski
parent e57b51ed09
commit 0d1b84b04e
17 changed files with 169 additions and 67 deletions
+5 -32
View File
@@ -159,7 +159,6 @@ typedef NS_ENUM(NSUInteger, USER_INTERFACE)
{
//USER_INTERFACE_LANGUAGE_INDEX = 0,
USER_INTERFACE_THEME_INDEX = 0,
USER_INTERFACE_PERSONAL_NOTES,
TIMELINE_SIMPLE_INDEX,
TIMELINE_TIMESTAMP_INDEX,
TIMELINE_DELETED_MESSAGES_INDEX,
@@ -626,10 +625,6 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
[sectionUserInterface addRowWithTag:USER_INTERFACE_THEME_INDEX];
sectionUserInterface = [self updateTimeLine:sectionUserInterface];
[tmpSections addObject: sectionUserInterface];
if (BWIBuildSettings.shared.bwiPersonalNotesRoom) {
[sectionUserInterface addRowWithTag:USER_INTERFACE_PERSONAL_NOTES];
}
if (BWIBuildSettings.shared.bwiShowTimelineSettings) {
Section *sectionTimeline = [Section sectionWithTag:SECTION_TAG_TIMELINE];
@@ -2454,26 +2449,24 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kSettingsViewControllerPhoneBookCountryCellId];
}
NSString *theme = RiotSettings.shared.userInterfaceTheme;
if (!theme)
{
theme = @"auto";
}
theme = [NSString stringWithFormat:@"settings_ui_theme_%@", theme];
NSString *i18nTheme = NSLocalizedStringFromTable(theme, @"Vector", nil);
cell.textLabel.textColor = ThemeService.shared.theme.textPrimaryColor;
cell.textLabel.text = [VectorL10n settingsUiTheme];
cell.detailTextLabel.text = i18nTheme;
[cell vc_setAccessoryDisclosureIndicatorWithCurrentTheme];
cell.selectionStyle = UITableViewCellSelectionStyleDefault;
} else if (row == USER_INTERFACE_PERSONAL_NOTES) {
cell = [self cellForPersonalNotes:tableView indexPath:indexPath];
} else if (row == USER_INTERFACE_TIMELINE_STYLE_INDEX)
{
cell = [self buildMessageBubblesCellForTableView:tableView atIndexPath:indexPath];
@@ -5149,26 +5142,6 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
#pragma mark - bwi Messenger Additions
- (UITableViewCell*) cellForPersonalNotes:(UITableView*)tableView indexPath:(NSIndexPath*)indexPath {
MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
PersonalNotesSettings *settings = [[PersonalNotesSettings alloc] init];
labelAndSwitchCell.mxkLabel.text = BWIL10n.bwiSettingsEnableNotesRoomTitle;
labelAndSwitchCell.mxkSwitch.on = settings.personalNotesVisible;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
labelAndSwitchCell.mxkSwitch.enabled = YES;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(togglePersonalNotesService:) forControlEvents:UIControlEventTouchUpInside];
return labelAndSwitchCell;
}
- (void)togglePersonalNotesService:(UISwitch*)theSwitch
{
PersonalNotesSettings *settings = [[PersonalNotesSettings alloc] init];
settings.personalNotesVisible = theSwitch.isOn;
}
- (NSString*) bwiDowntimeCellText {
NSString *downtimeText = [NSString stringWithFormat:@"\n%@\n\n", [[[ServerDowntimeDefaultService alloc] init] downtimeText]];
return downtimeText;