diff --git a/Riot/Managers/Theme/Theme.swift b/Riot/Managers/Theme/Theme.swift index 8c6f52a66..0ce22be40 100644 --- a/Riot/Managers/Theme/Theme.swift +++ b/Riot/Managers/Theme/Theme.swift @@ -96,6 +96,12 @@ import DesignKit /// Color to use in shadows. Should be contrast to `backgroundColor`. var shadowColor: UIColor { get } + + // Timeline cells + + var roomCellIncomingBubbleBackgroundColor: UIColor { get } + + var roomCellOutgoingBubbleBackgroundColor: UIColor { get } // MARK: - Customisation methods diff --git a/Riot/Managers/Theme/Themes/DarkTheme.swift b/Riot/Managers/Theme/Themes/DarkTheme.swift index b6aabc3ff..6178bd255 100644 --- a/Riot/Managers/Theme/Themes/DarkTheme.swift +++ b/Riot/Managers/Theme/Themes/DarkTheme.swift @@ -91,6 +91,12 @@ class DarkTheme: NSObject, Theme { var shadowColor: UIColor = UIColor(rgb: 0xFFFFFF) var messageTickColor: UIColor = .white + + var roomCellIncomingBubbleBackgroundColor: UIColor { + return self.colors.system + } + + var roomCellOutgoingBubbleBackgroundColor: UIColor = UIColor(rgb: 0x133A34) func applyStyle(onTabBar tabBar: UITabBar) { tabBar.unselectedItemTintColor = self.tabBarUnselectedItemTintColor diff --git a/Riot/Managers/Theme/Themes/DefaultTheme.swift b/Riot/Managers/Theme/Themes/DefaultTheme.swift index 545b801b9..8a77f5b23 100644 --- a/Riot/Managers/Theme/Themes/DefaultTheme.swift +++ b/Riot/Managers/Theme/Themes/DefaultTheme.swift @@ -100,6 +100,10 @@ class DefaultTheme: NSObject, Theme { var shadowColor: UIColor = UIColor(rgb: 0x000000) + var roomCellIncomingBubbleBackgroundColor: UIColor = UIColor(rgb: 0xE8EDF4) + + var roomCellOutgoingBubbleBackgroundColor: UIColor = UIColor(rgb: 0xE7F8F3) + func applyStyle(onTabBar tabBar: UITabBar) { tabBar.unselectedItemTintColor = self.tabBarUnselectedItemTintColor tabBar.tintColor = self.tintColor diff --git a/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/BubbleRoomCellLayoutUpdater.swift b/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/BubbleRoomCellLayoutUpdater.swift index 9e71cc97a..c13e5ee3b 100644 --- a/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/BubbleRoomCellLayoutUpdater.swift +++ b/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/BubbleRoomCellLayoutUpdater.swift @@ -24,11 +24,11 @@ class BubbleRoomCellLayoutUpdater: RoomCellLayoutUpdating { private var theme: Theme private var incomingColor: UIColor { - return self.theme.bubbleCellIncomingBackgroundColor + return self.theme.roomCellIncomingBubbleBackgroundColor } private var outgoingColor: UIColor { - return self.theme.bubbleCellOutgoingBackgroundColor + return self.theme.roomCellOutgoingBubbleBackgroundColor } // MARK: - Setup diff --git a/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/FileWithoutThumbnail/Incoming/FileWithoutThumbnailIncomingBubbleCell.swift b/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/FileWithoutThumbnail/Incoming/FileWithoutThumbnailIncomingBubbleCell.swift index 0658a343a..bdc06c1ec 100644 --- a/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/FileWithoutThumbnail/Incoming/FileWithoutThumbnailIncomingBubbleCell.swift +++ b/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/FileWithoutThumbnail/Incoming/FileWithoutThumbnailIncomingBubbleCell.swift @@ -34,6 +34,6 @@ class FileWithoutThumbnailIncomingBubbleCell: FileWithoutThumbnailBaseBubbleCell override func update(theme: Theme) { super.update(theme: theme) - self.fileAttachementView?.backgroundColor = theme.bubbleCellIncomingBackgroundColor + self.fileAttachementView?.backgroundColor = theme.roomCellIncomingBubbleBackgroundColor } } diff --git a/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/FileWithoutThumbnail/Outgoing/FileWithoutThumbnailOutoingWithoutSenderInfoBubbleCell.swift b/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/FileWithoutThumbnail/Outgoing/FileWithoutThumbnailOutoingWithoutSenderInfoBubbleCell.swift index d598f8e13..67cb6ac3a 100644 --- a/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/FileWithoutThumbnail/Outgoing/FileWithoutThumbnailOutoingWithoutSenderInfoBubbleCell.swift +++ b/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/FileWithoutThumbnail/Outgoing/FileWithoutThumbnailOutoingWithoutSenderInfoBubbleCell.swift @@ -35,6 +35,6 @@ class FileWithoutThumbnailOutoingWithoutSenderInfoBubbleCell: FileWithoutThumbna override func update(theme: Theme) { super.update(theme: theme) - self.fileAttachementView?.backgroundColor = theme.bubbleCellOutgoingBackgroundColor + self.fileAttachementView?.backgroundColor = theme.roomCellOutgoingBubbleBackgroundColor } } diff --git a/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/VoiceMessage/Incoming/VoiceMessageIncomingBubbleCell.swift b/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/VoiceMessage/Incoming/VoiceMessageIncomingBubbleCell.swift index 805c22642..708fa0ac0 100644 --- a/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/VoiceMessage/Incoming/VoiceMessageIncomingBubbleCell.swift +++ b/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/VoiceMessage/Incoming/VoiceMessageIncomingBubbleCell.swift @@ -38,6 +38,6 @@ class VoiceMessageIncomingBubbleCell: VoiceMessageBubbleCell { return } - playbackController.playbackView.backgroundViewColor = theme.bubbleCellIncomingBackgroundColor + playbackController.playbackView.backgroundViewColor = theme.roomCellIncomingBubbleBackgroundColor } } diff --git a/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/VoiceMessage/Outgoing/VoiceMessageOutgoingWithoutSenderInfoBubbleCell.swift b/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/VoiceMessage/Outgoing/VoiceMessageOutgoingWithoutSenderInfoBubbleCell.swift index b36bda517..c150c9b0e 100644 --- a/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/VoiceMessage/Outgoing/VoiceMessageOutgoingWithoutSenderInfoBubbleCell.swift +++ b/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/VoiceMessage/Outgoing/VoiceMessageOutgoingWithoutSenderInfoBubbleCell.swift @@ -41,6 +41,6 @@ class VoiceMessageOutgoingWithoutSenderInfoBubbleCell: VoiceMessageBubbleCell { return } - playbackController.playbackView.backgroundViewColor = theme.bubbleCellOutgoingBackgroundColor + playbackController.playbackView.backgroundViewColor = theme.roomCellOutgoingBubbleBackgroundColor } } diff --git a/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Theme+BubbleStyle.swift b/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Theme+BubbleStyle.swift deleted file mode 100644 index 103adf443..000000000 --- a/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Theme+BubbleStyle.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// Copyright 2021 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 - -extension Theme { - - var bubbleCellIncomingBackgroundColor: UIColor { - return self.colors.system - } - - var bubbleCellOutgoingBackgroundColor: UIColor { - return self.colors.accent.withAlphaComponent(0.10) - } -}