diff --git a/CHANGES.md b/CHANGES.md index 427842bc0..db410ce33 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -18,6 +18,7 @@ - Fix render of links with both characters requiring percent encoding and markdown-like syntax ([#6748](https://github.com/vector-im/element-ios/issues/6748)) - Fix crash when scrolling chat list ([#6749](https://github.com/vector-im/element-ios/issues/6749)) - App Layout: Unable to send message after filtering for room ([#6755](https://github.com/vector-im/element-ios/issues/6755)) +- App Layout: Fix missing toolbar for users with no rooms. ([#6796](https://github.com/vector-im/element-ios/pull/6796)) - Fix code block background colour ([#6778](https://github.com/vector-im/element-ios/issues/6778)) 🧱 Build diff --git a/Riot/Modules/Common/Recents/RecentsViewController.h b/Riot/Modules/Common/Recents/RecentsViewController.h index 09a9ee572..9a9c60ece 100644 --- a/Riot/Modules/Common/Recents/RecentsViewController.h +++ b/Riot/Modules/Common/Recents/RecentsViewController.h @@ -93,6 +93,12 @@ FOUNDATION_EXPORT NSString *const RecentsViewControllerDataReadyNotification; */ @property (nonatomic, weak) RootTabEmptyView *emptyView; +/** + The bottom anchor used to layout `emptyView` in the absence of a FAB. + If this value is `nil` the empty view will be anchored to the bottom of its superview. + */ +@property (nonatomic, weak) NSLayoutYAxisAnchor *emptyViewBottomAnchor; + /** The screen timer used for analytics if they've been enabled. The default value is nil. */ diff --git a/Riot/Modules/Common/Recents/RecentsViewController.m b/Riot/Modules/Common/Recents/RecentsViewController.m index c06a6f18a..0a86bd3c0 100644 --- a/Riot/Modules/Common/Recents/RecentsViewController.m +++ b/Riot/Modules/Common/Recents/RecentsViewController.m @@ -2226,7 +2226,8 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro [self.view addSubview:emptyView]; } - emptyViewBottomConstraint = [emptyView.bottomAnchor constraintEqualToAnchor:emptyView.superview.bottomAnchor]; + NSLayoutYAxisAnchor *bottomAnchor = self.emptyViewBottomAnchor ?: emptyView.superview.bottomAnchor; + emptyViewBottomConstraint = [emptyView.bottomAnchor constraintEqualToAnchor:bottomAnchor constant:-1]; // 1pt spacing for UIToolbar's divider. emptyView.translatesAutoresizingMaskIntoConstraints = NO; diff --git a/Riot/Modules/Home/AllChats/AllChatsViewController.swift b/Riot/Modules/Home/AllChats/AllChatsViewController.swift index b2cbc8ce8..1b26bfe81 100644 --- a/Riot/Modules/Home/AllChats/AllChatsViewController.swift +++ b/Riot/Modules/Home/AllChats/AllChatsViewController.swift @@ -127,6 +127,7 @@ class AllChatsViewController: HomeViewController { recentsTableView.contentInsetAdjustmentBehavior = .automatic toolbarHeight = toolbar.frame.height + emptyViewBottomAnchor = toolbar.topAnchor updateUI()