vector-im/element-ios/issues/5114 - Polls in the timeline.

This commit is contained in:
Stefan Ceriu
2021-11-19 17:40:52 +02:00
parent ef4abe6ed2
commit ac6561a3d3
47 changed files with 1717 additions and 223 deletions
+23 -2
View File
@@ -153,9 +153,10 @@ enum
ABOUT_THIRD_PARTY_INDEX,
};
enum
typedef NS_ENUM(NSUInteger, LABS_ENABLE)
{
LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX = 0
LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX,
LABS_ENABLE_POLLS
};
enum
@@ -551,6 +552,8 @@ TableViewSectionsDelegate>
{
Section *sectionLabs = [Section sectionWithTag:SECTION_TAG_LABS];
[sectionLabs addRowWithTag:LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX];
[sectionLabs addRowWithTag:LABS_ENABLE_POLLS];
sectionLabs.headerTitle = [VectorL10n settingsLabs];
if (sectionLabs.hasAnyRows)
{
@@ -2401,6 +2404,19 @@ TableViewSectionsDelegate>
cell = labelAndSwitchCell;
}
if (row == LABS_ENABLE_POLLS && BuildSettings.pollsEnabled)
{
MXKTableViewCellWithLabelAndSwitch *labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = [VectorL10n settingsLabsEnabledPolls];
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.roomScreenAllowPollsAction;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnablePolls:) forControlEvents:UIControlEventValueChanged];
cell = labelAndSwitchCell;
}
}
else if (section == SECTION_TAG_FLAIR)
{
@@ -3135,6 +3151,11 @@ TableViewSectionsDelegate>
RiotSettings.shared.enableRingingForGroupCalls = sender.isOn;
}
- (void)toggleEnablePolls:(UISwitch *)sender
{
RiotSettings.shared.roomScreenAllowPollsAction = sender.isOn;
}
- (void)togglePinRoomsWithMissedNotif:(UISwitch *)sender
{
RiotSettings.shared.pinRoomsWithMissedNotificationsOnHome = sender.isOn;