Message bubbles: Move bubbles settings to labs section atm.

This commit is contained in:
SBiOSoftWhare
2022-02-10 14:59:45 +01:00
committed by Stefan Ceriu
parent 13a59eb845
commit eabf7350f3
+27 -12
View File
@@ -158,7 +158,8 @@ typedef NS_ENUM(NSUInteger, ABOUT)
typedef NS_ENUM(NSUInteger, LABS_ENABLE)
{
LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX = 0,
LABS_ENABLE_THREADS_INDEX
LABS_ENABLE_THREADS_INDEX,
LABS_ENABLE_MESSAGE_BUBBLES_INDEX
};
typedef NS_ENUM(NSUInteger, SECURITY)
@@ -508,7 +509,9 @@ TableViewSectionsDelegate>
if (BuildSettings.roomScreenAllowTimelineStyleConfiguration)
{
[sectionUserInterface addRowWithTag:USER_INTERFACE_TIMELINE_STYLE_INDEX];
// NOTE: Message bubbles are under labs section atm
// [sectionUserInterface addRowWithTag:USER_INTERFACE_TIMELINE_STYLE_INDEX];
}
[tmpSections addObject: sectionUserInterface];
@@ -566,6 +569,7 @@ TableViewSectionsDelegate>
Section *sectionLabs = [Section sectionWithTag:SECTION_TAG_LABS];
[sectionLabs addRowWithTag:LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX];
[sectionLabs addRowWithTag:LABS_ENABLE_THREADS_INDEX];
[sectionLabs addRowWithTag:LABS_ENABLE_MESSAGE_BUBBLES_INDEX];
sectionLabs.headerTitle = [VectorL10n settingsLabs];
if (sectionLabs.hasAnyRows)
{
@@ -1469,6 +1473,22 @@ TableViewSectionsDelegate>
return [footerText copy];
}
- (UITableViewCell *)buildMessageBubblesCellForTableView:
(UITableView*)tableView
atIndexPath:(NSIndexPath*)indexPath
{
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];
return labelAndSwitchCell;
}
#pragma mark - 3Pid Add
- (void)showAuthenticationIfNeededForAdding:(MX3PIDMedium)medium withSession:(MXSession*)session completion:(void (^)(NSDictionary* authParams))completion
@@ -2206,16 +2226,7 @@ TableViewSectionsDelegate>
}
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;
cell = [self buildMessageBubblesCellForTableView:tableView atIndexPath:indexPath];
}
}
else if (section == SECTION_TAG_IGNORED_USERS)
@@ -2446,6 +2457,10 @@ TableViewSectionsDelegate>
cell = labelAndSwitchCell;
}
else if (row == LABS_ENABLE_MESSAGE_BUBBLES_INDEX)
{
cell = [self buildMessageBubblesCellForTableView:tableView atIndexPath:indexPath];
}
}
else if (section == SECTION_TAG_FLAIR)
{