Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing toolbar in AllChatsViewController. #6796

Merged
merged 1 commit into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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