From 49db701e39b4b4535ec1c75217e88070aae1255f Mon Sep 17 00:00:00 2001 From: Bruno Muniz Azevedo Filho <bruno@elixxir.io> Date: Tue, 19 Jul 2022 13:07:56 -0300 Subject: [PATCH] Fixed some UI for dark mode --- Package.swift | 1 + .../SearchFeature/Controllers/SearchLeftController.swift | 3 ++- Sources/SearchFeature/Views/SearchLeftEmptyView.swift | 1 + .../SearchFeature/Views/SearchLeftPlaceholderView.swift | 9 +++++---- Sources/SearchFeature/Views/SearchLeftView.swift | 7 +++++-- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Package.swift b/Package.swift index 9317c5be..0cbf7ccf 100644 --- a/Package.swift +++ b/Package.swift @@ -220,6 +220,7 @@ let package = Package( name: "SFTPFeature", dependencies: [ "HUD", + "Models", "Shared", "Keychain", "InputField", diff --git a/Sources/SearchFeature/Controllers/SearchLeftController.swift b/Sources/SearchFeature/Controllers/SearchLeftController.swift index b172eb74..21a4d1fe 100644 --- a/Sources/SearchFeature/Controllers/SearchLeftController.swift +++ b/Sources/SearchFeature/Controllers/SearchLeftController.swift @@ -115,7 +115,8 @@ final class SearchLeftController: UIViewController { .receive(on: DispatchQueue.main) .sink { [unowned self] isEditing in UIView.animate(withDuration: 0.25) { - self.screenView.placeholderView.alpha = isEditing ? 0.1 : 1.0 + self.screenView.placeholderView.titleLabel.alpha = isEditing ? 0.1 : 1.0 + self.screenView.placeholderView.subtitleWithInfo.alpha = isEditing ? 0.1 : 1.0 } }.store(in: &cancellables) diff --git a/Sources/SearchFeature/Views/SearchLeftEmptyView.swift b/Sources/SearchFeature/Views/SearchLeftEmptyView.swift index f52174b7..84c64c87 100644 --- a/Sources/SearchFeature/Views/SearchLeftEmptyView.swift +++ b/Sources/SearchFeature/Views/SearchLeftEmptyView.swift @@ -6,6 +6,7 @@ final class SearchLeftEmptyView: UIView { init() { super.init(frame: .zero) + backgroundColor = Asset.neutralWhite.color titleLabel.numberOfLines = 0 titleLabel.textAlignment = .center diff --git a/Sources/SearchFeature/Views/SearchLeftPlaceholderView.swift b/Sources/SearchFeature/Views/SearchLeftPlaceholderView.swift index b0fe2d60..7742ff1d 100644 --- a/Sources/SearchFeature/Views/SearchLeftPlaceholderView.swift +++ b/Sources/SearchFeature/Views/SearchLeftPlaceholderView.swift @@ -14,6 +14,7 @@ final class SearchLeftPlaceholderView: UIView { init() { super.init(frame: .zero) + backgroundColor = Asset.neutralWhite.color let attrString = NSMutableAttributedString( string: Localized.Ud.Search.Placeholder.title, @@ -59,14 +60,14 @@ final class SearchLeftPlaceholderView: UIView { private func setupConstraints() { titleLabel.snp.makeConstraints { $0.top.equalToSuperview().offset(50) - $0.left.equalToSuperview() - $0.right.equalToSuperview() + $0.left.equalToSuperview().offset(32.5) + $0.right.equalToSuperview().offset(-32.5) } subtitleWithInfo.snp.makeConstraints { $0.top.equalTo(titleLabel.snp.bottom).offset(30) - $0.left.equalToSuperview() - $0.right.equalToSuperview() + $0.left.equalToSuperview().offset(32.5) + $0.right.equalToSuperview().offset(-32.5) $0.bottom.equalToSuperview() } } diff --git a/Sources/SearchFeature/Views/SearchLeftView.swift b/Sources/SearchFeature/Views/SearchLeftView.swift index d0025965..e5bbb5eb 100644 --- a/Sources/SearchFeature/Views/SearchLeftView.swift +++ b/Sources/SearchFeature/Views/SearchLeftView.swift @@ -9,7 +9,10 @@ final class SearchLeftView: UIView { init() { super.init(frame: .zero) + emptyView.isHidden = true + backgroundColor = Asset.neutralWhite.color + tableView.backgroundColor = Asset.neutralWhite.color addSubview(tableView) addSubview(inputField) @@ -52,8 +55,8 @@ final class SearchLeftView: UIView { placeholderView.snp.makeConstraints { $0.top.equalTo(inputField.snp.bottom) - $0.left.equalToSuperview().offset(32.5) - $0.right.equalToSuperview().offset(-32.5) + $0.left.equalToSuperview() + $0.right.equalToSuperview() $0.bottom.equalToSuperview() } } -- GitLab