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

Bugfix FXIOS-10569 ⁃ [Menu] Fix the margin and Padding for the sections/islands in the menu. #23308

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
4 changes: 2 additions & 2 deletions BrowserKit/Sources/MenuKit/MenuMainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public final class MenuMainView: UIView,

tableView.topAnchor.constraint(equalTo: accountHeaderView.bottomAnchor),
tableView.bottomAnchor.constraint(equalTo: self.bottomAnchor),
tableView.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: -UX.horizontalTableViewMargin),
tableView.trailingAnchor.constraint(equalTo: self.trailingAnchor, constant: UX.horizontalTableViewMargin)
tableView.leadingAnchor.constraint(equalTo: self.leadingAnchor),
tableView.trailingAnchor.constraint(equalTo: self.trailingAnchor)
])
}

Expand Down
6 changes: 5 additions & 1 deletion BrowserKit/Sources/MenuKit/MenuTableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class MenuTableView: UIView,
ThemeApplicable {
private struct UX {
static let topPadding: CGFloat = 12
static let tableViewMargin: CGFloat = 16
static let distanceBetweenSections: CGFloat = 32
}

private var tableView: UITableView
Expand All @@ -26,6 +28,8 @@ class MenuTableView: UIView,

override init(frame: CGRect) {
tableView = UITableView(frame: .zero, style: .insetGrouped)
tableView.layoutMargins = UIEdgeInsets(top: 0, left: UX.tableViewMargin, bottom: 0, right: UX.tableViewMargin)
tableView.sectionFooterHeight = 0
menuData = []
super.init(frame: .zero)
setupView()
Expand Down Expand Up @@ -70,7 +74,7 @@ class MenuTableView: UIView,
_ tableView: UITableView,
heightForHeaderInSection section: Int
) -> CGFloat {
return section == 0 ? UX.topPadding : UITableView.automaticDimension
return section == 0 ? UX.topPadding : UX.distanceBetweenSections
}

func tableView(
Expand Down