Skip to content

Commit

Permalink
Merge pull request #21154 from wordpress-mobile/task/20783-prepublish…
Browse files Browse the repository at this point in the history
…ing-tableview-margin
  • Loading branch information
dvdchr authored Jul 21, 2023
2 parents 8f32635 + 0b9a1cd commit b22dc61
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class PrepublishingNavigationController: LightNavigationController {
init(rootViewController: UIViewController, shouldDisplayPortrait: Bool) {
self.shouldDisplayPortrait = shouldDisplayPortrait
super.init(rootViewController: rootViewController)

configureNavigationBar()
}

required init?(coder: NSCoder) {
Expand All @@ -56,6 +58,20 @@ class PrepublishingNavigationController: LightNavigationController {
}
}

/// Updates the navigation bar color so it matches the view's background.
///
/// Originally, in dark mode the navigation bar color is grayish, but there's a few points gap on top of the
/// navigation bar to accommodate the `GripButton` from `BottomSheetViewController`. The bottom sheet itself
/// assigns the background color according to its child controller's view background color.
private func configureNavigationBar() {
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = .basicBackground

navigationBar.scrollEdgeAppearance = appearance
navigationBar.compactAppearance = appearance
}

private enum Constants {
static let iPadPreferredContentSize = CGSize(width: 300.0, height: 300.0)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ class PrepublishingViewController: UITableViewController {
self?.hasSelectedText = true
}
})

// when displayed in a popover, update content size so the window is resized to fit the current content.
navigationController?.preferredContentSize = tableView.contentSize
}

override func viewWillDisappear(_ animated: Bool) {
Expand Down

0 comments on commit b22dc61

Please sign in to comment.