mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Improved locking
This commit is contained in:
35
submodules/AppLock/Sources/LockedWindowCoveringView.swift
Normal file
35
submodules/AppLock/Sources/LockedWindowCoveringView.swift
Normal file
@@ -0,0 +1,35 @@
|
||||
import Foundation
|
||||
import Display
|
||||
import TelegramPresentationData
|
||||
import AsyncDisplayKit
|
||||
|
||||
final class LockedWindowCoveringView: WindowCoveringView {
|
||||
private let contentView: UIImageView
|
||||
|
||||
init(theme: PresentationTheme) {
|
||||
self.contentView = UIImageView()
|
||||
|
||||
super.init(frame: CGRect())
|
||||
|
||||
self.backgroundColor = theme.chatList.backgroundColor
|
||||
self.addSubview(self.contentView)
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
func updateTheme(_ theme: PresentationTheme) {
|
||||
self.backgroundColor = theme.chatList.backgroundColor
|
||||
}
|
||||
|
||||
func updateSnapshot(_ image: UIImage?) {
|
||||
if image != nil {
|
||||
self.contentView.image = image
|
||||
}
|
||||
}
|
||||
|
||||
override func updateLayout(_ size: CGSize) {
|
||||
self.contentView.frame = CGRect(origin: CGPoint(), size: size)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user