From 64d55495554f5005b9ef1a2a0da804579c2d7a41 Mon Sep 17 00:00:00 2001 From: michaelneas Date: Mon, 30 Nov 2020 11:14:15 -0500 Subject: [PATCH] adds configurable background color to albumviewcontroller and checks for safe area insets if there is no navigation controller --- .../Dropdown/DropdownPresentationController.swift | 6 +++++- Sources/Scene/Albums/AlbumsViewController.swift | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/Presentation/Dropdown/DropdownPresentationController.swift b/Sources/Presentation/Dropdown/DropdownPresentationController.swift index a45cbd6c..bf202c50 100644 --- a/Sources/Presentation/Dropdown/DropdownPresentationController.swift +++ b/Sources/Presentation/Dropdown/DropdownPresentationController.swift @@ -71,7 +71,11 @@ class DropdownPresentationController: UIPresentationController { // Match color with navigation bar presentedViewController.view.backgroundColor = navigationBar.barTintColor } else { - position = .zero + if #available(iOS 11.0, *) { + position = CGPoint(x: containerView.safeAreaInsets.left, y: containerView.safeAreaInsets.top) + } else { + position = .zero + } } return CGRect(origin: position, size: size) diff --git a/Sources/Scene/Albums/AlbumsViewController.swift b/Sources/Scene/Albums/AlbumsViewController.swift index 9d372cda..68bc4c93 100755 --- a/Sources/Scene/Albums/AlbumsViewController.swift +++ b/Sources/Scene/Albums/AlbumsViewController.swift @@ -57,7 +57,7 @@ class AlbumsViewController: UIViewController { tableView.register(AlbumCell.self, forCellReuseIdentifier: AlbumCell.identifier) tableView.dataSource = dataSource tableView.delegate = self - tableView.backgroundColor = .clear + tableView.backgroundColor = settings.theme.backgroundColor view.addSubview(tableView) let lineHeight: CGFloat = 0.5