Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

[IB2-364] [iPhone X] [Tabs Overview] background image is not fullscreen

  • Loading branch information
Tim Palade authored and sharath-cliqz committed Sep 7, 2018
1 parent 2d94ec7 commit e2344c4504970868f601cd6acb6493d5e2e759c3
Showing with 32 additions and 6 deletions.
  1. +3 −1 Client/Frontend/Browser/TabTrayController.swift
  2. +29 −5 Cliqz/Tab Tray/TabTrayControllerExtension.swift
@@ -239,7 +239,9 @@ class TabTrayController: UIViewController {
var draggedCell: TabCell?
var dragOffset: CGPoint = .zero
// Cliqz: backgroundView as container for background image
var backgroundView: UIView!
var privateModeOverlay: UIView? = nil
let backgroundView = UIImageView()
//End Cliqz
/* Cliqz: use CliqzTrayToolbar
lazy var toolbar: TrayToolbar = {
let toolbar = TrayToolbar()
@@ -20,13 +20,37 @@ extension TabTrayController {
}
}

func setBackgroundImage() {
let backgroundView = UIImageView(image: UIImage.cliqzBackgroundImage())
if privateMode {
backgroundView.addSubview(UIView.overlay(frame: self.view.bounds))
func setUpOverlay() {
if privateMode && privateModeOverlay == nil{
privateModeOverlay = UIView.overlay(frame: CGRect.zero)
backgroundView.addSubview(privateModeOverlay!)
backgroundView.bringSubview(toFront: privateModeOverlay!)
privateModeOverlay?.snp.makeConstraints({ (make) in
make.edges.equalToSuperview()
})
}
else if !privateMode {
privateModeOverlay?.removeFromSuperview()
privateModeOverlay = nil
}
collectionView.backgroundView = backgroundView
}

func setBackgroundImage() {
collectionView.backgroundColor = UIColor.clear

if backgroundView.superview == nil {
self.view.addSubview(backgroundView)
self.view.sendSubview(toBack: backgroundView)
}

if backgroundView.constraints.isEmpty {
backgroundView.snp.makeConstraints { (make) in
make.edges.equalToSuperview()
}
}

self.backgroundView.image = UIImage.cliqzBackgroundImage()
setUpOverlay()
}

func updateBackgroundColor() {

0 comments on commit e2344c4

Please sign in to comment.