pull/107/head
gmbnt 5 years ago
parent 2ac196ec86
commit e766a2cbf3

@ -241,8 +241,8 @@ private final class NewConversationButton : UIImageView {
layer.shadowPath = UIBezierPath(ovalIn: CGRect(origin: CGPoint(x: 0, y: 0), size: CGSize(width: size, height: size))).cgPath
layer.shadowColor = color.cgColor
layer.shadowOffset = CGSize(width: 0, height: 0.8)
layer.shadowOpacity = 1
layer.shadowRadius = 6
layer.shadowOpacity = isLightMode ? 0.6 : 1
layer.shadowRadius = isLightMode ? 4 : 6
}
}

@ -50,7 +50,7 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, UIScrol
private lazy var fadeView: UIView = {
let result = UIView()
let gradient = Gradients.transparentToBlack
let gradient = Gradients.homeVCFade
result.setGradient(gradient)
result.isUserInteractionEnabled = false
return result

@ -15,6 +15,11 @@ public var isDarkMode: Bool {
@objc public final class LKAppModeUtilities : NSObject {
@objc public static func isLightMode() -> Bool { return AppMode.current == .light }
@objc public static func isDarkMode() -> Bool { return AppMode.current == .dark }
@objc public static var isLightMode: Bool {
return AppMode.current == .light
}
@objc public static var isDarkMode: Bool {
return AppMode.current == .dark
}
}

@ -15,7 +15,7 @@ public final class Gradient : NSObject {
@objc public extension UIView {
@objc public func setGradient(_ gradient: Gradient) {
@objc func setGradient(_ gradient: Gradient) {
let layer = CAGradientLayer()
layer.frame = UIScreen.main.bounds
layer.colors = [ gradient.start.cgColor, gradient.end.cgColor ]
@ -33,5 +33,10 @@ final public class Gradients : NSObject {
}
}
@objc public static let transparentToBlack = Gradient(start: UIColor(red: 0, green: 0, blue: 0, alpha: 0), end: UIColor(red: 0, green: 0, blue: 0, alpha: 1))
@objc public static var homeVCFade: Gradient {
switch AppMode.current {
case .light: return Gradient(start: UIColor(hex: 0xFFFFFF).withAlphaComponent(0), end: UIColor(hex: 0xFFFFFF))
case .dark: return Gradient(start: UIColor(hex: 0x000000).withAlphaComponent(0), end: UIColor(hex: 0x000000))
}
}
}

Loading…
Cancel
Save