Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix BG overlay for both search controllers.
- Loading branch information
|
|
@@ -85,6 +85,7 @@ class CliqzSearchViewController : UIViewController, KeyboardHelperDelegate, UIAl |
|
|
|
|
|
let searchView = Engine.sharedInstance.rootView |
|
|
fileprivate let backgroundImage = UIImageView() |
|
|
fileprivate let privateModeOverlay = UIView.overlay(frame: CGRect.zero) |
|
|
|
|
|
private static let KVOLoading = "loading" |
|
|
|
|
|
@@ -182,8 +183,11 @@ class CliqzSearchViewController : UIViewController, KeyboardHelperDelegate, UIAl |
|
|
if privateMode != self.privateMode { |
|
|
self.privateMode = privateMode |
|
|
self.updateExtensionPreferences() |
|
|
if privateMode { |
|
|
self.backgroundImage.addSubview(UIView.overlay(frame: self.view.bounds)) |
|
|
if privateMode && privateModeOverlay.superview == nil { |
|
|
backgroundImage.addSubview(privateModeOverlay) |
|
|
privateModeOverlay.snp.makeConstraints { (make) in |
|
|
make.edges.equalToSuperview() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
@@ -87,9 +87,6 @@ class FirefoxSearchViewController: SiteTableViewController, KeyboardHelperDelega |
|
|
|
|
|
@objc func orientationDidChange(_ notification: Notification) { |
|
|
backgroundImage.image = BackgroundImageManager.shared.getImage() |
|
|
if isPrivate { |
|
|
privateModeOverlay.frame = self.view.bounds |
|
|
} |
|
|
} |
|
|
|
|
|
override func viewDidLoad() { |
|
|
@@ -111,8 +108,10 @@ class FirefoxSearchViewController: SiteTableViewController, KeyboardHelperDelega |
|
|
backgroundImage.image = BackgroundImageManager.shared.getImage() |
|
|
|
|
|
if isPrivate { |
|
|
privateModeOverlay = UIView.overlay(frame: self.view.bounds) |
|
|
self.backgroundImage.addSubview(privateModeOverlay) |
|
|
privateModeOverlay.snp.makeConstraints { (make) in |
|
|
make.edges.equalToSuperview() |
|
|
} |
|
|
} |
|
|
|
|
|
searchEngineScrollView.layer.backgroundColor = SearchViewControllerUX.SearchEngineScrollViewBackgroundColor |
|
|
|