diff --git a/Signal/src/Loki/Components/NewConversationButtonSet.swift b/Signal/src/Loki/Components/NewConversationButtonSet.swift index c8611434d..98367c752 100644 --- a/Signal/src/Loki/Components/NewConversationButtonSet.swift +++ b/Signal/src/Loki/Components/NewConversationButtonSet.swift @@ -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 } } diff --git a/Signal/src/Loki/View Controllers/HomeVC.swift b/Signal/src/Loki/View Controllers/HomeVC.swift index cf8df611b..0fa506bb3 100644 --- a/Signal/src/Loki/View Controllers/HomeVC.swift +++ b/Signal/src/Loki/View Controllers/HomeVC.swift @@ -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 diff --git a/SignalMessaging/Loki/Redesign/Style Guide/AppMode.swift b/SignalMessaging/Loki/Redesign/Style Guide/AppMode.swift index e0b809a19..166d0610a 100644 --- a/SignalMessaging/Loki/Redesign/Style Guide/AppMode.swift +++ b/SignalMessaging/Loki/Redesign/Style Guide/AppMode.swift @@ -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 + } } diff --git a/SignalMessaging/Loki/Redesign/Style Guide/Gradients.swift b/SignalMessaging/Loki/Redesign/Style Guide/Gradients.swift index cc19f24b5..e95c8a17a 100644 --- a/SignalMessaging/Loki/Redesign/Style Guide/Gradients.swift +++ b/SignalMessaging/Loki/Redesign/Style Guide/Gradients.swift @@ -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)) + } + } }