Merge pull request #6796 from vector-im/doug/fix-empty-state-toolbar

Fix missing toolbar in AllChatsViewController.
This commit is contained in:
Doug 2022-10-04 16:29:20 +01:00 committed by GitHub
commit ec2a176788
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 1 deletions

View file

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

View file

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

View file

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

View file

@ -127,6 +127,7 @@ class AllChatsViewController: HomeViewController {
recentsTableView.contentInsetAdjustmentBehavior = .automatic
toolbarHeight = toolbar.frame.height
emptyViewBottomAnchor = toolbar.topAnchor
updateUI()