Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Revert "Fix #8009: Update toolbar constraints to utilize safe area pr… #8363

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 2 additions & 0 deletions Sources/Brave/Frontend/Browser/BrowserViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,8 @@ public class BrowserViewController: UIViewController {
footer.snp.remakeConstraints { make in
make.bottom.equalTo(toolbarLayoutGuide)
make.leading.trailing.equalTo(self.view)
let height = self.toolbar == nil ? 0 : UIConstants.bottomToolbarHeight
make.height.equalTo(height)
}

bottomBarKeyboardBackground.snp.remakeConstraints {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ class BottomToolbarView: UIView, ToolbarProtocol {
contentView.snp.makeConstraints { make in
make.leading.trailing.top.equalTo(self)
make.bottom.equalTo(self.safeArea.bottom)
make.height.equalTo(UIConstants.toolbarHeight)
}
super.updateConstraints()
}
Expand Down
8 changes: 7 additions & 1 deletion Sources/Brave/Frontend/UIConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ public struct UIConstants {
static let defaultPadding: CGFloat = 10
static let snackbarButtonHeight: CGFloat = 48
static var toolbarHeight: CGFloat = 44

static var bottomToolbarHeight: CGFloat {
get {
let bottomInset: CGFloat = UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0.0
return toolbarHeight + bottomInset
}
}

// Static fonts
static let defaultChromeSize: CGFloat = 16
static let defaultChromeSmallSize: CGFloat = 11
Expand Down