mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
hide navbar blur layer in attachment approval, which has a clear navbar
This commit is contained in:
parent
9d279b4d85
commit
3d6b8e2bb5
|
@ -40,6 +40,7 @@ public class OWSNavigationBar: UINavigationBar {
|
|||
|
||||
@objc
|
||||
public static let backgroundBlurMutingFactor: CGFloat = 0.5
|
||||
var blurEffectView: UIView?
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
|
@ -53,6 +54,7 @@ public class OWSNavigationBar: UINavigationBar {
|
|||
let blurEffect = UIBlurEffect(style: .light)
|
||||
let blurEffectView = UIVisualEffectView(effect: blurEffect)
|
||||
blurEffectView.isUserInteractionEnabled = false
|
||||
self.blurEffectView = blurEffectView
|
||||
|
||||
// remove hairline below bar.
|
||||
self.shadowImage = UIImage()
|
||||
|
@ -71,6 +73,8 @@ public class OWSNavigationBar: UINavigationBar {
|
|||
NotificationCenter.default.addObserver(self, selector: #selector(didChangeStatusBarFrame), name: .UIApplicationDidChangeStatusBarFrame, object: nil)
|
||||
}
|
||||
|
||||
// MARK: Layout
|
||||
|
||||
@objc
|
||||
public func callDidChange() {
|
||||
Logger.debug("\(self.logTag) in \(#function)")
|
||||
|
@ -125,4 +129,15 @@ public class OWSNavigationBar: UINavigationBar {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK:
|
||||
|
||||
@objc
|
||||
public func makeClear() {
|
||||
self.backgroundColor = .clear
|
||||
self.setBackgroundImage(UIImage(), for: .default)
|
||||
self.shadowImage = UIImage()
|
||||
self.clipsToBounds = true
|
||||
self.blurEffectView?.isHidden = true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,11 +67,11 @@ public class AttachmentApprovalViewController: OWSViewController, CaptioningTool
|
|||
let vc = AttachmentApprovalViewController(attachment: attachment, delegate: delegate)
|
||||
let navController = OWSNavigationController(rootViewController: vc)
|
||||
|
||||
// Make navigationBar clear
|
||||
navController.navigationBar.backgroundColor = .clear
|
||||
navController.navigationBar.setBackgroundImage(UIImage(), for: .default)
|
||||
navController.navigationBar.shadowImage = UIImage()
|
||||
navController.navigationBar.clipsToBounds = true
|
||||
guard let navigationBar = navController.navigationBar as? OWSNavigationBar else {
|
||||
owsFail("\(self.logTag) in \(#function) navigationBar was nil or unexpected class")
|
||||
return navController
|
||||
}
|
||||
navigationBar.makeClear()
|
||||
|
||||
return navController
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue