mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 08:03:50 +02:00
Add NotificationSettings and Keywords UI and VM
This commit is contained in:
@@ -1918,7 +1918,7 @@ TableViewSectionsDelegate>
|
||||
}
|
||||
else if (row == NOTIFICATION_SETTINGS_MENTION_AND_KEYWORDS_SETTINGS_INDEX)
|
||||
{
|
||||
cell.textLabel.text = NSLocalizedStringFromTable(@"settings_meantions_and_keywords", @"Vector", nil);
|
||||
cell.textLabel.text = NSLocalizedStringFromTable(@"settings_mentions_and_keywords", @"Vector", nil);
|
||||
}
|
||||
else if (row == NOTIFICATION_SETTINGS_OTHER_SETTINGS_INDEX)
|
||||
{
|
||||
@@ -2744,7 +2744,17 @@ TableViewSectionsDelegate>
|
||||
}
|
||||
else if (section == SECTION_TAG_NOTIFICATIONS)
|
||||
{
|
||||
[self showNotificationSettings];
|
||||
switch (row) {
|
||||
case NOTIFICATION_SETTINGS_DEFAULT_SETTINGS_INDEX:
|
||||
[self showNotificationSettings:NotificationSettingsScreenDefaultNotificaitons];
|
||||
break;
|
||||
case NOTIFICATION_SETTINGS_MENTION_AND_KEYWORDS_SETTINGS_INDEX:
|
||||
[self showNotificationSettings:NotificationSettingsScreenMentionsAndKeywords];
|
||||
break;
|
||||
case NOTIFICATION_SETTINGS_OTHER_SETTINGS_INDEX:
|
||||
[self showNotificationSettings:NotificationSettingsScreenOther];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
@@ -4082,28 +4092,32 @@ TableViewSectionsDelegate>
|
||||
|
||||
#pragma mark - NotificationSettingsCoordinatorBridgePresenter
|
||||
|
||||
- (void)showNotificationSettings
|
||||
- (void)showNotificationSettings: (NotificationSettingsScreen) screen
|
||||
{
|
||||
|
||||
NotificationSettingsCoordinatorBridgePresenter *notificationSettingsBridgePresenter = [[NotificationSettingsCoordinatorBridgePresenter alloc] initWithSession:self.mainSession];
|
||||
notificationSettingsBridgePresenter.delegate = self;
|
||||
|
||||
MXWeakify(self);
|
||||
|
||||
[notificationSettingsBridgePresenter pushFrom:self.navigationController animated:YES popCompletion:^{
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
if (@available(iOS 14.0, *)) {
|
||||
NotificationSettingsCoordinatorBridgePresenter *notificationSettingsBridgePresenter = [[NotificationSettingsCoordinatorBridgePresenter alloc] initWithSession:self.mainSession];
|
||||
notificationSettingsBridgePresenter.delegate = self;
|
||||
|
||||
self.notificationSettingsBridgePresenter = nil;
|
||||
}];
|
||||
|
||||
|
||||
self.notificationSettingsBridgePresenter = notificationSettingsBridgePresenter;
|
||||
MXWeakify(self);
|
||||
|
||||
[notificationSettingsBridgePresenter pushFrom:self.navigationController animated:YES screen:screen popCompletion:^{
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
|
||||
self.notificationSettingsBridgePresenter = nil;
|
||||
}];
|
||||
|
||||
|
||||
self.notificationSettingsBridgePresenter = notificationSettingsBridgePresenter;
|
||||
} else {
|
||||
// Fallback on earlier versions
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - NotificationSettingsCoordinatorBridgePresenterDelegate
|
||||
|
||||
- (void)notificationSettingsCoordinatorBridgePresenterDelegateDidComplete:(NotificationSettingsCoordinatorBridgePresenter *)coordinatorBridgePresenter
|
||||
{
|
||||
API_AVAILABLE(ios(14.0)){
|
||||
[self.notificationSettingsBridgePresenter dismissWithAnimated:YES completion:nil];
|
||||
self.notificationSettingsBridgePresenter = nil;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user