Merge pull request #5342 from vector-im/steve/5321_bubbles_lauching

Message bubbles: Add settings and build flag
This commit is contained in:
SBiOSoftWhare
2022-01-13 09:50:23 +01:00
committed by GitHub
142 changed files with 72 additions and 2 deletions
+28 -2
View File
@@ -134,7 +134,8 @@ typedef NS_ENUM(NSUInteger, LOCAL_CONTACTS)
typedef NS_ENUM(NSUInteger, USER_INTERFACE)
{
USER_INTERFACE_LANGUAGE_INDEX = 0,
USER_INTERFACE_THEME_INDEX
USER_INTERFACE_THEME_INDEX,
USER_INTERFACE_TIMELINE_STYLE_INDEX
};
typedef NS_ENUM(NSUInteger, IDENTITY_SERVER)
@@ -514,9 +515,16 @@ TableViewSectionsDelegate>
}
Section *sectionUserInterface = [Section sectionWithTag:SECTION_TAG_USER_INTERFACE];
sectionUserInterface.headerTitle = [VectorL10n settingsUserInterface];
[sectionUserInterface addRowWithTag:USER_INTERFACE_LANGUAGE_INDEX];
[sectionUserInterface addRowWithTag:USER_INTERFACE_THEME_INDEX];
sectionUserInterface.headerTitle = [VectorL10n settingsUserInterface];
if (BuildSettings.roomScreenAllowTimelineStyleConfiguration)
{
[sectionUserInterface addRowWithTag:USER_INTERFACE_TIMELINE_STYLE_INDEX];
}
[tmpSections addObject: sectionUserInterface];
Section *sectionAdvanced = [Section sectionWithTag:SECTION_TAG_ADVANCED];
@@ -2226,6 +2234,19 @@ TableViewSectionsDelegate>
[cell vc_setAccessoryDisclosureIndicatorWithCurrentTheme];
cell.selectionStyle = UITableViewCellSelectionStyleDefault;
}
else if (row == USER_INTERFACE_TIMELINE_STYLE_INDEX)
{
MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = [VectorL10n settingsEnableRoomMessageBubbles];
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.roomScreenEnableMessageBubbles;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
labelAndSwitchCell.mxkSwitch.enabled = YES;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableRoomMessageBubbles:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
}
else if (section == SECTION_TAG_IGNORED_USERS)
{
@@ -3874,6 +3895,11 @@ TableViewSectionsDelegate>
RiotSettings.shared.showNSFWPublicRooms = sender.isOn;
}
- (void)toggleEnableRoomMessageBubbles:(UISwitch *)sender
{
RiotSettings.shared.roomScreenEnableMessageBubbles = sender.isOn;
}
#pragma mark - TextField listener
- (IBAction)textFieldDidChange:(id)sender