diff --git a/Config/BuildSettings.swift b/Config/BuildSettings.swift index cc648923b..571809009 100644 --- a/Config/BuildSettings.swift +++ b/Config/BuildSettings.swift @@ -419,11 +419,8 @@ final class BuildSettings: NSObject { static let syncLocalContacts: Bool = false // MARK: - New App Layout - static let newAppLayoutEnabled = false + static let newAppLayoutEnabled = true - static var isSideMenuActivated: Bool = enableSideMenu - static var isNewAppLayoutActivated: Bool = newAppLayoutEnabled - // MARK: - Device manager static let deviceManagerEnabled = false diff --git a/Riot/Managers/Settings/RiotSettings.swift b/Riot/Managers/Settings/RiotSettings.swift index 240c04a3c..7d0adfbe2 100644 --- a/Riot/Managers/Settings/RiotSettings.swift +++ b/Riot/Managers/Settings/RiotSettings.swift @@ -46,8 +46,6 @@ final class RiotSettings: NSObject { private override init() { super.init() - BuildSettings.isSideMenuActivated = BuildSettings.enableSideMenu && !newAppLayoutBetaEnabled - BuildSettings.isNewAppLayoutActivated = BuildSettings.newAppLayoutEnabled || newAppLayoutBetaEnabled } /// Indicate if UserDefaults suite has been migrated once. @@ -384,16 +382,6 @@ final class RiotSettings: NSObject { @UserDefault(key: "allChatsOnboardingHasBeenDisplayed", defaultValue: false, storage: defaults) var allChatsOnboardingHasBeenDisplayed - // MARK: - New App Layout - @UserDefault(key: "newAppLayoutBetaEnabled", defaultValue: false, storage: defaults) - var newAppLayoutBetaEnabled { - didSet { - BuildSettings.isSideMenuActivated = BuildSettings.enableSideMenu && !newAppLayoutBetaEnabled - BuildSettings.isNewAppLayoutActivated = BuildSettings.newAppLayoutEnabled || newAppLayoutBetaEnabled - NotificationCenter.default.post(name: RiotSettings.newAppLayoutBetaToggleDidChange, object: self) - } - } - } // MARK: - RiotSettings notification constants diff --git a/Riot/Managers/Theme/Themes/DarkTheme.swift b/Riot/Managers/Theme/Themes/DarkTheme.swift index dc4e89f1b..9dbba85c7 100644 --- a/Riot/Managers/Theme/Themes/DarkTheme.swift +++ b/Riot/Managers/Theme/Themes/DarkTheme.swift @@ -27,7 +27,7 @@ class DarkTheme: NSObject, Theme { var backgroundColor: UIColor = UIColor(rgb: 0x15191E) var baseColor: UIColor { - BuildSettings.isNewAppLayoutActivated ? UIColor(rgb: 0x15191E) : UIColor(rgb: 0x21262C) + BuildSettings.newAppLayoutEnabled ? UIColor(rgb: 0x15191E) : UIColor(rgb: 0x21262C) } var baseIconPrimaryColor: UIColor = UIColor(rgb: 0xEDF3FF) var baseTextPrimaryColor: UIColor = UIColor(rgb: 0xFFFFFF) @@ -38,7 +38,7 @@ class DarkTheme: NSObject, Theme { var searchResultHighlightColor: UIColor = UIColor(rgb: 0xFCC639).withAlphaComponent(0.3) var headerBackgroundColor: UIColor { - BuildSettings.isNewAppLayoutActivated ? UIColor(rgb: 0x15191E) : UIColor(rgb: 0x21262C) + BuildSettings.newAppLayoutEnabled ? UIColor(rgb: 0x15191E) : UIColor(rgb: 0x21262C) } var headerBorderColor: UIColor = UIColor(rgb: 0x15191E) var headerTextPrimaryColor: UIColor = UIColor(rgb: 0xFFFFFF) diff --git a/Riot/Managers/Theme/Themes/DefaultTheme.swift b/Riot/Managers/Theme/Themes/DefaultTheme.swift index d58a1a6d0..d5d309bf3 100644 --- a/Riot/Managers/Theme/Themes/DefaultTheme.swift +++ b/Riot/Managers/Theme/Themes/DefaultTheme.swift @@ -27,7 +27,7 @@ class DefaultTheme: NSObject, Theme { var backgroundColor: UIColor = UIColor(rgb: 0xFFFFFF) var baseColor: UIColor { - BuildSettings.isNewAppLayoutActivated ? UIColor(rgb: 0xFFFFFF) : UIColor(rgb: 0xF5F7FA) + BuildSettings.newAppLayoutEnabled ? UIColor(rgb: 0xFFFFFF) : UIColor(rgb: 0xF5F7FA) } var baseIconPrimaryColor: UIColor = UIColor(rgb: 0xFFFFFF) var baseTextPrimaryColor: UIColor = UIColor(rgb: 0xFFFFFF) @@ -38,7 +38,7 @@ class DefaultTheme: NSObject, Theme { var searchResultHighlightColor: UIColor = UIColor(rgb: 0xFCC639).withAlphaComponent(0.2) var headerBackgroundColor: UIColor { - BuildSettings.isNewAppLayoutActivated ? UIColor(rgb: 0xFFFFFF) : UIColor(rgb: 0xF5F7FA) + BuildSettings.newAppLayoutEnabled ? UIColor(rgb: 0xFFFFFF) : UIColor(rgb: 0xF5F7FA) } var headerBorderColor: UIColor = UIColor(rgb: 0xE9EDF1) var headerTextPrimaryColor: UIColor = UIColor(rgb: 0x17191C) @@ -173,7 +173,7 @@ class DefaultTheme: NSObject, Theme { searchBar.backgroundImage = UIImage() // Remove top and bottom shadow searchBar.tintColor = self.tintColor - guard !BuildSettings.isNewAppLayoutActivated else { + guard !BuildSettings.newAppLayoutEnabled else { return } diff --git a/Riot/Modules/Application/AppCoordinator.swift b/Riot/Modules/Application/AppCoordinator.swift index 3553148f3..88f2e5099 100755 --- a/Riot/Modules/Application/AppCoordinator.swift +++ b/Riot/Modules/Application/AppCoordinator.swift @@ -91,7 +91,7 @@ final class AppCoordinator: NSObject, AppCoordinatorType { // Setup user location services _ = UserLocationServiceProvider.shared - if BuildSettings.isSideMenuActivated { + if BuildSettings.enableSideMenu { self.addSideMenu() } @@ -163,7 +163,7 @@ final class AppCoordinator: NSObject, AppCoordinatorType { } @objc private func newAppLayoutToggleDidChange(notification: Notification) { - if BuildSettings.isSideMenuActivated { + if BuildSettings.enableSideMenu { self.addSideMenu() } } diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index f574fc6e4..c7d578c08 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -4263,7 +4263,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni } // Need to set `showAllRoomsInHomeSpace` to `true` for the new App Layout - if (BuildSettings.isNewAppLayoutActivated) + if (BuildSettings.newAppLayoutEnabled) { RiotSettings.shared.showAllRoomsInHomeSpace = YES; } diff --git a/Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m b/Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m index c98dd254e..8e2284226 100644 --- a/Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m +++ b/Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m @@ -84,7 +84,7 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou _crossSigningBannerDisplay = CrossSigningBannerDisplayNone; _secureBackupBannerDisplay = SecureBackupBannerDisplayNone; - _areSectionsShrinkable = !BuildSettings.isNewAppLayoutActivated; + _areSectionsShrinkable = !BuildSettings.newAppLayoutEnabled; shrinkedSectionsBitMask = 0; roomTagsListenerByUserId = [[NSMutableDictionary alloc] init]; @@ -758,7 +758,7 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou } - if (count && !(sectionType == RecentsDataSourceSectionTypeInvites) && !BuildSettings.isNewAppLayoutActivated) + if (count && !(sectionType == RecentsDataSourceSectionTypeInvites) && !BuildSettings.newAppLayoutEnabled) { NSString *roomCount = [NSString stringWithFormat:@" %tu", count]; @@ -987,7 +987,7 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou sectionHeader.bottomView = nil; } - if (!BuildSettings.isNewAppLayoutActivated || !sectionHeader.bottomView) + if (!BuildSettings.newAppLayoutEnabled || !sectionHeader.bottomView) { // Add label frame.size.height = RECENTSDATASOURCE_DEFAULT_SECTION_HEADER_HEIGHT - 10; @@ -1714,7 +1714,7 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou - (void)recentsListServiceDidChangeData:(id)service totalCountsChanged:(BOOL)totalCountsChanged { - if (!BuildSettings.isNewAppLayoutActivated) + if (!BuildSettings.newAppLayoutEnabled) { [[AppDelegate theDelegate].masterTabBarController refreshTabBarBadges]; } diff --git a/Riot/Modules/Common/Recents/RecentsViewController.m b/Riot/Modules/Common/Recents/RecentsViewController.m index 92ddc408d..c06a6f18a 100644 --- a/Riot/Modules/Common/Recents/RecentsViewController.m +++ b/Riot/Modules/Common/Recents/RecentsViewController.m @@ -382,7 +382,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro isRefreshNeeded = NO; // Refresh the tabBar icon badges - if (!BuildSettings.isNewAppLayoutActivated) + if (!BuildSettings.newAppLayoutEnabled) { // Refresh the tabBar icon badges [[AppDelegate theDelegate].masterTabBarController refreshTabBarBadges]; @@ -1105,7 +1105,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro [self refreshRecentsTable]; } - if (!BuildSettings.isNewAppLayoutActivated) + if (!BuildSettings.newAppLayoutEnabled) { // Since we've enabled room list pagination, `refreshRecentsTable` not called in this case. // Refresh tab bar badges separately. diff --git a/Riot/Modules/GlobalSearch/UnifiedSearchViewController.m b/Riot/Modules/GlobalSearch/UnifiedSearchViewController.m index fb27ec4b4..8703623bb 100644 --- a/Riot/Modules/GlobalSearch/UnifiedSearchViewController.m +++ b/Riot/Modules/GlobalSearch/UnifiedSearchViewController.m @@ -146,7 +146,7 @@ [self updateSearch]; - if (BuildSettings.isNewAppLayoutActivated) + if (BuildSettings.newAppLayoutEnabled) { [self.searchBar vc_searchTextField].backgroundColor = nil; [self vc_setLargeTitleDisplayMode: UINavigationItemLargeTitleDisplayModeAutomatic]; diff --git a/Riot/Modules/Home/AllChats/AllChatsViewController.swift b/Riot/Modules/Home/AllChats/AllChatsViewController.swift index d1df10be0..0c69c2647 100644 --- a/Riot/Modules/Home/AllChats/AllChatsViewController.swift +++ b/Riot/Modules/Home/AllChats/AllChatsViewController.swift @@ -157,7 +157,7 @@ class AllChatsViewController: HomeViewController { AppDelegate.theDelegate().checkAppVersion() - if BuildSettings.isNewAppLayoutActivated && !RiotSettings.shared.allChatsOnboardingHasBeenDisplayed { + if BuildSettings.newAppLayoutEnabled && !RiotSettings.shared.allChatsOnboardingHasBeenDisplayed { self.showAllChatsOnboardingScreen() } } diff --git a/Riot/Modules/Home/HomeViewController.m b/Riot/Modules/Home/HomeViewController.m index 684a40ec3..72909b199 100644 --- a/Riot/Modules/Home/HomeViewController.m +++ b/Riot/Modules/Home/HomeViewController.m @@ -78,7 +78,7 @@ { [super viewDidLoad]; - if (!BuildSettings.isNewAppLayoutActivated) + if (!BuildSettings.newAppLayoutEnabled) { [self.tabBarController vc_setLargeTitleDisplayMode:UINavigationItemLargeTitleDisplayModeNever]; } @@ -107,7 +107,7 @@ { [super viewWillAppear:animated]; - if (!BuildSettings.isNewAppLayoutActivated) + if (!BuildSettings.newAppLayoutEnabled) { [ThemeService.shared.theme applyStyleOnNavigationBar:[AppDelegate theDelegate].masterTabBarController.navigationController.navigationBar]; diff --git a/Riot/Modules/Room/MXKRoomViewController.m b/Riot/Modules/Room/MXKRoomViewController.m index 65dc73a3e..b33c2f62f 100644 --- a/Riot/Modules/Room/MXKRoomViewController.m +++ b/Riot/Modules/Room/MXKRoomViewController.m @@ -221,7 +221,7 @@ { [super viewDidLoad]; - if (BuildSettings.isNewAppLayoutActivated) + if (BuildSettings.newAppLayoutEnabled) { [self vc_setLargeTitleDisplayMode: UINavigationItemLargeTitleDisplayModeNever]; } diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m index 2da06cdf9..6b9a19f97 100644 --- a/Riot/Modules/Settings/SettingsViewController.m +++ b/Riot/Modules/Settings/SettingsViewController.m @@ -172,8 +172,7 @@ typedef NS_ENUM(NSUInteger, LABS_ENABLE) LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX = 0, LABS_ENABLE_THREADS_INDEX, LABS_ENABLE_AUTO_REPORT_DECRYPTION_ERRORS, - LABS_ENABLE_LIVE_LOCATION_SHARING, - LABS_ENABLE_NEW_APP_LAYOUT + LABS_ENABLE_LIVE_LOCATION_SHARING }; typedef NS_ENUM(NSUInteger, SECURITY) @@ -596,7 +595,6 @@ ChangePasswordCoordinatorBridgePresenterDelegate> { [sectionLabs addRowWithTag:LABS_ENABLE_LIVE_LOCATION_SHARING]; } - [sectionLabs addRowWithTag:LABS_ENABLE_NEW_APP_LAYOUT]; sectionLabs.headerTitle = [VectorL10n settingsLabs]; if (sectionLabs.hasAnyRows) { @@ -1499,21 +1497,6 @@ ChangePasswordCoordinatorBridgePresenterDelegate> return labelAndSwitchCell; } -- (UITableViewCell *)buildNewAppLayoutCellForTableView:(UITableView*)tableView - atIndexPath:(NSIndexPath*)indexPath -{ - MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath]; - - labelAndSwitchCell.mxkLabel.text = [VectorL10n settingsLabsEnableNewAppLayout]; - - labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.newAppLayoutBetaEnabled; - labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; - labelAndSwitchCell.mxkSwitch.enabled = YES; - [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableNewAppLayout:) forControlEvents:UIControlEventTouchUpInside]; - - return labelAndSwitchCell; -} - #pragma mark - 3Pid Add - (void)showAuthenticationIfNeededForAdding:(MX3PIDMedium)medium withSession:(MXSession*)session completion:(void (^)(NSDictionary* authParams))completion @@ -2549,10 +2532,6 @@ ChangePasswordCoordinatorBridgePresenterDelegate> { cell = [self buildLiveLocationSharingCellForTableView:tableView atIndexPath:indexPath]; } - else if (row == LABS_ENABLE_NEW_APP_LAYOUT) - { - cell = [self buildNewAppLayoutCellForTableView:tableView atIndexPath:indexPath]; - } } else if (section == SECTION_TAG_SECURITY) { @@ -3992,15 +3971,6 @@ ChangePasswordCoordinatorBridgePresenterDelegate> RiotSettings.shared.enableLiveLocationSharing = sender.isOn; } -- (void)toggleEnableNewAppLayout:(UISwitch *)sender -{ - if (sender.isOn) - { - RiotSettings.shared.showAllRoomsInHomeSpace = YES; - } - RiotSettings.shared.newAppLayoutBetaEnabled = sender.isOn; -} - #pragma mark - TextField listener - (IBAction)textFieldDidChange:(id)sender diff --git a/Riot/Modules/SplitView/SplitViewCoordinator.swift b/Riot/Modules/SplitView/SplitViewCoordinator.swift index 5365db16b..caac41ea9 100644 --- a/Riot/Modules/SplitView/SplitViewCoordinator.swift +++ b/Riot/Modules/SplitView/SplitViewCoordinator.swift @@ -93,7 +93,7 @@ final class SplitViewCoordinator: NSObject, SplitViewCoordinatorType { self.splitViewController.delegate = self // Create primary controller - let masterCoordinator: SplitViewMasterCoordinatorProtocol = BuildSettings.isNewAppLayoutActivated ? self.createAllChatsCoordinator() : self.createTabBarCoordinator() + let masterCoordinator: SplitViewMasterCoordinatorProtocol = BuildSettings.newAppLayoutEnabled ? self.createAllChatsCoordinator() : self.createTabBarCoordinator() masterCoordinator.splitViewMasterPresentableDelegate = self masterCoordinator.start(with: spaceId) diff --git a/Riot/Modules/TabBar/MasterTabBarController.m b/Riot/Modules/TabBar/MasterTabBarController.m index fe0311a9e..ff221ce67 100644 --- a/Riot/Modules/TabBar/MasterTabBarController.m +++ b/Riot/Modules/TabBar/MasterTabBarController.m @@ -157,7 +157,7 @@ [self userInterfaceThemeDidChange]; } - self.tabBar.hidden = BuildSettings.isNewAppLayoutActivated; + self.tabBar.hidden = BuildSettings.newAppLayoutEnabled; } - (void)viewDidAppear:(BOOL)animated @@ -215,7 +215,7 @@ [[AppDelegate theDelegate] checkAppVersion]; - if (BuildSettings.isNewAppLayoutActivated && !RiotSettings.shared.allChatsOnboardingHasBeenDisplayed) + if (BuildSettings.newAppLayoutEnabled && !RiotSettings.shared.allChatsOnboardingHasBeenDisplayed) { [self showAllChatsOnboardingScreen]; } @@ -634,7 +634,7 @@ { if (roomParentId) { NSString *parentName = [mxSession roomSummaryWithRoomId:roomParentId].displayname; - if (!BuildSettings.isNewAppLayoutActivated) + if (!BuildSettings.newAppLayoutEnabled) { NSMutableArray *breadcrumbs = [[NSMutableArray alloc] initWithObjects:parentName, nil]; @@ -650,7 +650,7 @@ } else { - if (!BuildSettings.isNewAppLayoutActivated) + if (!BuildSettings.newAppLayoutEnabled) { titleView.breadcrumbView.breadcrumbs = @[]; } @@ -662,7 +662,7 @@ - (void)updateSideMenuNotifcationIcon { - if (BuildSettings.isNewAppLayoutActivated) { return; } + if (BuildSettings.newAppLayoutEnabled) { return; } BOOL displayNotification = NO; @@ -694,7 +694,7 @@ -(void)setupTitleView { - if (!BuildSettings.isNewAppLayoutActivated) + if (!BuildSettings.newAppLayoutEnabled) { titleView = [MainTitleView new]; self.navigationItem.titleView = titleView; diff --git a/Riot/Modules/TabBar/TabBarCoordinator.swift b/Riot/Modules/TabBar/TabBarCoordinator.swift index 33843d438..8324b65f1 100644 --- a/Riot/Modules/TabBar/TabBarCoordinator.swift +++ b/Riot/Modules/TabBar/TabBarCoordinator.swift @@ -116,7 +116,7 @@ final class TabBarCoordinator: NSObject, SplitViewMasterCoordinatorProtocol { self.addMatrixSessionToMasterTabBarController(userSession.matrixSession) } - if BuildSettings.isSideMenuActivated { + if BuildSettings.enableSideMenu { self.setupSideMenuGestures() } @@ -370,7 +370,7 @@ final class TabBarCoordinator: NSObject, SplitViewMasterCoordinatorProtocol { let homeViewController = self.createHomeViewController() viewControllers.append(homeViewController) - if !BuildSettings.isNewAppLayoutActivated { + if !BuildSettings.newAppLayoutEnabled { if RiotSettings.shared.homeScreenShowFavouritesTab { let favouritesViewController = self.createFavouritesViewController() viewControllers.append(favouritesViewController) @@ -706,12 +706,12 @@ final class TabBarCoordinator: NSObject, SplitViewMasterCoordinatorProtocol { private weak var rightMenuButton: UIButton? private func createLeftButtonItem(for viewController: UIViewController) { - guard !BuildSettings.isNewAppLayoutActivated else { + guard !BuildSettings.newAppLayoutEnabled else { createAvatarButtonItem(for: viewController) return } - guard BuildSettings.isSideMenuActivated else { + guard BuildSettings.enableSideMenu else { let settingsBarButtonItem: MXKBarButtonItem = MXKBarButtonItem(image: Asset.Images.settingsIcon.image, style: .plain) { [weak self] in self?.showSettings() } @@ -730,7 +730,7 @@ final class TabBarCoordinator: NSObject, SplitViewMasterCoordinatorProtocol { } private func createRightButtonItem(for viewController: UIViewController) { - guard !BuildSettings.isNewAppLayoutActivated else { + guard !BuildSettings.newAppLayoutEnabled else { return } @@ -894,7 +894,7 @@ final class TabBarCoordinator: NSObject, SplitViewMasterCoordinatorProtocol { private var windowOverlay: WindowOverlayPresenter? func showCoachMessageIfNeeded(with session: MXSession) { - guard !BuildSettings.isNewAppLayoutActivated else { + guard !BuildSettings.newAppLayoutEnabled else { // Showing coach message makes no sense with the new App Layout return } @@ -941,7 +941,7 @@ extension TabBarCoordinator: MasterTabBarControllerDelegate { } func masterTabBarController(_ masterTabBarController: MasterTabBarController!, needsSideMenuIconWithNotification displayNotification: Bool) { - guard BuildSettings.isSideMenuActivated else { + guard BuildSettings.enableSideMenu else { return } diff --git a/changelog.d/6673.change b/changelog.d/6673.change new file mode 100644 index 000000000..67765fff5 --- /dev/null +++ b/changelog.d/6673.change @@ -0,0 +1 @@ +Removed labs flag and enabled New App Layout