diff --git a/Riot.xcodeproj/project.pbxproj b/Riot.xcodeproj/project.pbxproj index a67e4e94c..edeca615a 100644 --- a/Riot.xcodeproj/project.pbxproj +++ b/Riot.xcodeproj/project.pbxproj @@ -56,6 +56,7 @@ 3232ABBB2257BE6500AD6A5C /* DeviceVerificationVerifyViewState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABB32257BE6400AD6A5C /* DeviceVerificationVerifyViewState.swift */; }; 3232ABBC2257BE6500AD6A5C /* DeviceVerificationVerifyViewAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABB42257BE6400AD6A5C /* DeviceVerificationVerifyViewAction.swift */; }; 3232ABC022594C0900AD6A5C /* VerifyEmojiCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABBF22594C0900AD6A5C /* VerifyEmojiCollectionViewCell.swift */; }; + 3232ABC2225B996200AD6A5C /* Themable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABC1225B996100AD6A5C /* Themable.swift */; }; 3233F7461F3497E2006ACA81 /* JitsiMeet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3233F7441F3497DA006ACA81 /* JitsiMeet.framework */; }; 3233F7471F3497E2006ACA81 /* JitsiMeet.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3233F7441F3497DA006ACA81 /* JitsiMeet.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 3275FD8C21A5A2C500B9C13D /* TermsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3275FD8B21A5A2C500B9C13D /* TermsView.swift */; }; @@ -545,6 +546,7 @@ 3232ABB32257BE6400AD6A5C /* DeviceVerificationVerifyViewState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationVerifyViewState.swift; sourceTree = ""; }; 3232ABB42257BE6400AD6A5C /* DeviceVerificationVerifyViewAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationVerifyViewAction.swift; sourceTree = ""; }; 3232ABBF22594C0900AD6A5C /* VerifyEmojiCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VerifyEmojiCollectionViewCell.swift; sourceTree = ""; }; + 3232ABC1225B996100AD6A5C /* Themable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Themable.swift; sourceTree = ""; }; 3233F7441F3497DA006ACA81 /* JitsiMeet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JitsiMeet.framework; sourceTree = ""; }; 3267EFB320E379FD00FF1CAA /* CHANGES.rst */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGES.rst; sourceTree = ""; }; 3267EFB420E379FD00FF1CAA /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; fileEncoding = 4; path = Podfile; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; @@ -1215,6 +1217,7 @@ 32242F0D21E8FBA900725742 /* Theme.swift */, 32242F1121E8FBA900725742 /* ThemeService.h */, 32242F0E21E8FBA900725742 /* Themes */, + 3232ABC1225B996100AD6A5C /* Themable.swift */, ); path = Theme; sourceTree = ""; @@ -3767,6 +3770,7 @@ 3232ABA5225730E100AD6A5C /* DeviceVerificationStartViewModelType.swift in Sources */, B1B558DD20EF768F00210D55 /* RoomIncomingEncryptedTextMsgBubbleCell.m in Sources */, B1098BE521ECE1FC000DDA48 /* Storyboards.swift in Sources */, + 3232ABC2225B996200AD6A5C /* Themable.swift in Sources */, 3232ABA7225730E100AD6A5C /* DeviceVerificationStartCoordinator.swift in Sources */, B1D4752721EE4E630067973F /* KeyboardAvoider.swift in Sources */, B1D4752821EE4E630067973F /* KeyboardNotification.swift in Sources */, diff --git a/Riot/Managers/Theme/Themable.swift b/Riot/Managers/Theme/Themable.swift new file mode 100644 index 000000000..3764b24b7 --- /dev/null +++ b/Riot/Managers/Theme/Themable.swift @@ -0,0 +1,21 @@ +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +protocol Themable: class { + func update(theme: Theme) +} diff --git a/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.storyboard b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.storyboard index 5dda47179..7c1c8cb86 100644 --- a/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.storyboard +++ b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.storyboard @@ -186,6 +186,7 @@ + diff --git a/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.swift b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.swift index a0eb3ced9..897352c85 100644 --- a/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.swift +++ b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.swift @@ -34,6 +34,7 @@ final class DeviceVerificationVerifyViewController: UIViewController { @IBOutlet private weak var titleLabel: UILabel! @IBOutlet private weak var informationLabel: UILabel! + @IBOutlet weak var emojisCollectionView: UICollectionView! @IBOutlet weak var waitingPartnerLabel: UILabel! @IBOutlet weak var continueButtonBackgroundView: UIView! @IBOutlet private weak var continueButton: UIButton! @@ -116,6 +117,8 @@ final class DeviceVerificationVerifyViewController: UIViewController { self.continueButton.backgroundColor = theme.backgroundColor theme.applyStyle(onButton: self.continueButton) + + emojisCollectionView.reloadData() } private func registerThemeServiceDidChangeThemeNotification() { @@ -214,6 +217,8 @@ extension DeviceVerificationVerifyViewController: UICollectionViewDataSource { cell.emoji.text = emoji.emoji cell.name.text = emoji.name + + cell.update(theme: self.theme) return cell } diff --git a/Riot/Modules/DeviceVerification/Verify/Views/VerifyEmojiCollectionViewCell.swift b/Riot/Modules/DeviceVerification/Verify/Views/VerifyEmojiCollectionViewCell.swift index 02223bf4e..7d1780062 100644 --- a/Riot/Modules/DeviceVerification/Verify/Views/VerifyEmojiCollectionViewCell.swift +++ b/Riot/Modules/DeviceVerification/Verify/Views/VerifyEmojiCollectionViewCell.swift @@ -16,7 +16,11 @@ import UIKit -class VerifyEmojiCollectionViewCell: UICollectionViewCell { +class VerifyEmojiCollectionViewCell: UICollectionViewCell, Themable { @IBOutlet weak var emoji: UILabel! @IBOutlet weak var name: UILabel! + + func update(theme: Theme) { + name.textColor = theme.textPrimaryColor + } }