Removed labs flag and enabled New App Layout

This commit is contained in:
Gil Eluard 2022-09-05 12:03:52 +02:00
parent 1a45793021
commit 5a79db57dc
17 changed files with 36 additions and 80 deletions

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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
}

View file

@ -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()
}
}

View file

@ -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;
}

View file

@ -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<RecentsListServiceProtocol>)service
totalCountsChanged:(BOOL)totalCountsChanged
{
if (!BuildSettings.isNewAppLayoutActivated)
if (!BuildSettings.newAppLayoutEnabled)
{
[[AppDelegate theDelegate].masterTabBarController refreshTabBarBadges];
}

View file

@ -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.

View file

@ -146,7 +146,7 @@
[self updateSearch];
if (BuildSettings.isNewAppLayoutActivated)
if (BuildSettings.newAppLayoutEnabled)
{
[self.searchBar vc_searchTextField].backgroundColor = nil;
[self vc_setLargeTitleDisplayMode: UINavigationItemLargeTitleDisplayModeAutomatic];

View file

@ -157,7 +157,7 @@ class AllChatsViewController: HomeViewController {
AppDelegate.theDelegate().checkAppVersion()
if BuildSettings.isNewAppLayoutActivated && !RiotSettings.shared.allChatsOnboardingHasBeenDisplayed {
if BuildSettings.newAppLayoutEnabled && !RiotSettings.shared.allChatsOnboardingHasBeenDisplayed {
self.showAllChatsOnboardingScreen()
}
}

View file

@ -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];

View file

@ -221,7 +221,7 @@
{
[super viewDidLoad];
if (BuildSettings.isNewAppLayoutActivated)
if (BuildSettings.newAppLayoutEnabled)
{
[self vc_setLargeTitleDisplayMode: UINavigationItemLargeTitleDisplayModeNever];
}

View file

@ -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

View file

@ -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)

View file

@ -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<NSString *> *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;

View file

@ -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
}

1
changelog.d/6673.change Normal file
View file

@ -0,0 +1 @@
Removed labs flag and enabled New App Layout