Skip to content

Commit

Permalink
Merge pull request #6796 from vector-im/doug/fix-empty-state-toolbar
Browse files Browse the repository at this point in the history
Fix missing toolbar in AllChatsViewController.
  • Loading branch information
pixlwave authored Oct 4, 2022
2 parents eda5861 + 8438c7f commit ec2a176
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions Riot/Modules/Common/Recents/RecentsViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
3 changes: 2 additions & 1 deletion Riot/Modules/Common/Recents/RecentsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -2226,7 +2226,8 @@ - (void)addEmptyView:(RootTabEmptyView*)emptyView
[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;

Expand Down
1 change: 1 addition & 0 deletions Riot/Modules/Home/AllChats/AllChatsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class AllChatsViewController: HomeViewController {
recentsTableView.contentInsetAdjustmentBehavior = .automatic

toolbarHeight = toolbar.frame.height
emptyViewBottomAnchor = toolbar.topAnchor

updateUI()

Expand Down

0 comments on commit ec2a176

Please sign in to comment.