Parcourir la source

use same colors for all blurred views, use blur view in SettingsBackgroundSelectionController

cyberta il y a 3 ans
Parent
commit
eeccc24d7f

+ 1 - 0
DcCore/DcCore/Helper/DcColors.swift

@@ -14,6 +14,7 @@ public struct DcColors {
                                                                  dark: .black)
     public static let contactCellBackgroundColor = UIColor.themeColor(light: .white, dark: .black)
     public static let defaultBackgroundColor = UIColor.themeColor(light: .white, dark: .black)
+    public static let defaultTransparentBackgroundColor = DcColors.defaultBackgroundColor.withAlphaComponent(0.75)
     public static let defaultInverseColor = UIColor.themeColor(light: .black, dark: .white)
     public static let sharedChatCellBackgroundColor = UIColor.themeColor(light: white, dark: actionCellBackgroundDark)
     public static let chatBackgroundColor = UIColor.themeColor(light: .white, dark: .black)

+ 3 - 2
deltachat-ios/Chat/Views/ChatInputBar.swift

@@ -38,8 +38,9 @@ public class ChatInputBar: InputBarAccessoryView {
         setupScrollDownButton()
         super.setup()
         backgroundColor = .clear
-        backgroundView.backgroundColor = DcColors.defaultBackgroundColor
-        isTranslucent = true
+        backgroundView.backgroundColor = DcColors.defaultTransparentBackgroundColor
+        backgroundView.addSubview(blurView)
+        blurView.fillSuperview()
     }
     
     @objc func onScrollDownPressed() {

+ 1 - 1
deltachat-ios/Chat/Views/DraftArea.swift

@@ -71,7 +71,7 @@ public class DraftArea: UIView, InputItem {
     public func setupSubviews() {
         addSubview(blurView)
         addSubview(mainContentView)
-        backgroundColor = DcColors.defaultBackgroundColor.withAlphaComponent(0.75)
+        backgroundColor = DcColors.defaultTransparentBackgroundColor
         blurView.fillSuperview()
         mainContentView.fillSuperview()
     }

+ 13 - 1
deltachat-ios/Controller/SettingsBackgroundSelectionController.swift

@@ -40,13 +40,20 @@ class SettingsBackgroundSelectionController: UIViewController, MediaPickerDelega
         return btn
     }()
 
+    lazy var blurView: UIVisualEffectView = {
+        let blurEffect = UIBlurEffect(style: .light)
+        let view = UIVisualEffectView(effect: blurEffect)
+        view.translatesAutoresizingMaskIntoConstraints = false
+        return view
+    }()
+
     private lazy var container: UIStackView = {
         let container = UIStackView(arrangedSubviews: [selectDefaultButton, selectBackgroundButton])
         container.translatesAutoresizingMaskIntoConstraints = false
         container.distribution = .fillEqually
         container.axis = .horizontal
         container.alignment = .fill
-        container.backgroundColor = DcColors.systemMessageBackgroundColor
+        container.backgroundColor = DcColors.defaultTransparentBackgroundColor
         return container
     }()
 
@@ -87,12 +94,17 @@ class SettingsBackgroundSelectionController: UIViewController, MediaPickerDelega
 
     private func setupSubviews() {
         view.addSubview(backgroundContainer)
+        view.addSubview(blurView)
         view.addSubview(container)
 
         view.addConstraints([
             container.constraintAlignBottomTo(view),
             container.constraintAlignLeadingTo(view),
             container.constraintAlignTrailingTo(view),
+            blurView.constraintAlignTopTo(container),
+            blurView.constraintAlignLeadingTo(container),
+            blurView.constraintAlignTrailingTo(container),
+            blurView.constraintAlignBottomTo(container),
             backgroundContainer.constraintAlignBottomTo(view),
             backgroundContainer.constraintAlignLeadingTo(view),
             backgroundContainer.constraintAlignTrailingTo(view),