mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 17:12:45 +02:00
b298dedc22
Merge commit 'f823ab9aae70e8d15ed7cc079210dd9bbbb6c8e1' into feature/foss_update_1_11_19 * commit 'f823ab9aae70e8d15ed7cc079210dd9bbbb6c8e1': finish version++ version++ comments update submodule remove obsolete tests removed unused code update submodule fix Libolm removal update license macro update license Prepare for new sprint # Conflicts: # Config/AppVersion.xcconfig # IDETemplateMacros.plist # LICENSE # README.md # Riot/Categories/MXSession+Riot.m # Riot/Managers/EncryptionKeyManager/EncryptionKeyManager.swift # Riot/Managers/KeyValueStorage/Extensions/Keychain.swift # Riot/Managers/KeyValueStorage/KeyValueStore.swift # Riot/Managers/KeyValueStorage/KeychainStore.swift # Riot/Managers/KeyValueStorage/MemoryStore.swift # Riot/Managers/PushNotification/PushNotificationService.m # Riot/Managers/Settings/RiotSettings.swift # Riot/Managers/Settings/Shared/RiotSharedSettings.swift # Riot/Modules/Analytics/AnalyticsUIElement.swift # Riot/Modules/Application/AppCoordinator.swift # Riot/Modules/Application/LegacyAppDelegate.h # Riot/Modules/Application/LegacyAppDelegate.m # Riot/Modules/Authentication/Legacy/AuthenticationViewController.h # Riot/Modules/Authentication/Legacy/AuthenticationViewController.m # Riot/Modules/Authentication/Legacy/Views/AuthInputsView.h # Riot/Modules/Authentication/Legacy/Views/AuthInputsView.m # Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m # Riot/Modules/Common/Recents/RecentsViewController.m # Riot/Modules/Common/WebViewController/WebViewViewController.m # Riot/Modules/Contacts/Details/ContactDetailsViewController.m # Riot/Modules/Contacts/Views/ContactTableViewCell.m # Riot/Modules/Favorites/FavouritesViewController.h # Riot/Modules/Favorites/FavouritesViewController.m # Riot/Modules/GlobalSearch/UnifiedSearchViewController.m # Riot/Modules/People/PeopleViewController.h # Riot/Modules/People/PeopleViewController.m # Riot/Modules/Room/ContextualMenu/ReactionsMenu/ReactionsMenuViewModel.swift # Riot/Modules/Room/DataSources/RoomDataSource.m # Riot/Modules/Room/Files/RoomFilesViewController.m # Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m # Riot/Modules/Room/Members/RoomParticipantsViewController.m # Riot/Modules/Room/RoomViewController.m # Riot/Modules/Room/Settings/RoomSettingsViewController.m # Riot/Modules/Room/TimelineCells/RoomCreationIntro/RoomCreationIntroCell.swift # Riot/Modules/Room/TimelineCells/RoomCreationIntro/RoomCreationIntroCellContentView.swift # Riot/Modules/Room/TimelineCells/RoomCreationIntro/RoomCreationIntroViewData.swift # Riot/Modules/Room/TimelineCells/RoomTimelineCellIdentifier.h # Riot/Modules/Rooms/RoomsViewController.h # Riot/Modules/Rooms/ShowDirectory/Cells/Network/DirectoryNetworkTableHeaderFooterView.swift # Riot/Modules/Rooms/ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.swift # Riot/Modules/Rooms/ShowDirectory/PublicRoomsDirectoryViewModel.swift # Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyCoordinator.swift # Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyViewController.swift # Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseCoordinator.swift # Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseViewController.swift # Riot/Modules/Secrets/Recover/SecretsRecoveryCoordinator.swift # Riot/Modules/SecureBackup/Setup/Intro/SecureBackupSetupIntroViewController.swift # Riot/Modules/SecureBackup/Setup/Intro/SecureBackupSetupIntroViewModel.swift # Riot/Modules/SecureBackup/Setup/Intro/SecureBackupSetupIntroViewModelType.swift # Riot/Modules/SetPinCode/PinCodePreferences.swift # Riot/Modules/SetPinCode/SetupBiometrics/BiometricsAuthenticationPresenter.swift # Riot/Modules/Settings/Security/ManageSession/ManageSessionViewController.m # Riot/Modules/Settings/Security/SecurityViewController.m # Riot/Modules/Settings/SettingsViewController.m # Riot/Modules/SplitView/SplitViewCoordinator.swift # Riot/Modules/SplitView/SplitViewCoordinatorType.swift # Riot/Modules/StartChat/StartChatViewController.m # Riot/Modules/TabBar/MasterTabBarController.h # Riot/Modules/TabBar/MasterTabBarController.m # Riot/Utils/EventFormatter.m # Riot/Utils/HTMLFormatter.swift # Riot/Utils/Tools.m # RiotNSE/NotificationService.swift
191 lines
7.0 KiB
Swift
191 lines
7.0 KiB
Swift
/*
|
|
Copyright 2018-2024 New Vector Ltd.
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
Please see LICENSE in the repository root for full details.
|
|
*/
|
|
|
|
import Foundation
|
|
import UIKit
|
|
import DesignKit
|
|
|
|
/// Color constants for the default theme
|
|
@objcMembers
|
|
class DefaultTheme: NSObject, Theme {
|
|
|
|
var identifier: String = ThemeIdentifier.light.rawValue
|
|
|
|
var backgroundColor: UIColor = UIColor(rgb: 0xFFFFFF)
|
|
|
|
var baseColor: UIColor {
|
|
BuildSettings.newAppLayoutEnabled ? UIColor(rgb: 0xFFFFFF) : UIColor(rgb: 0xF5F7FA)
|
|
}
|
|
var baseIconPrimaryColor: UIColor = UIColor(rgb: 0xFFFFFF)
|
|
var baseTextPrimaryColor: UIColor = UIColor(rgb: 0xFFFFFF)
|
|
var baseTextSecondaryColor: UIColor = UIColor(rgb: 0x8F97A3)
|
|
|
|
var searchBackgroundColor: UIColor = UIColor(rgb: 0xFFFFFF)
|
|
var searchPlaceholderColor: UIColor = UIColor(rgb: 0x8F97A3)
|
|
var searchResultHighlightColor: UIColor = UIColor(rgb: 0xFCC639).withAlphaComponent(0.2)
|
|
|
|
var headerBackgroundColor: UIColor {
|
|
BuildSettings.newAppLayoutEnabled ? UIColor(rgb: 0xFFFFFF) : UIColor(rgb: 0xF5F7FA)
|
|
}
|
|
var headerBorderColor: UIColor = UIColor(rgb: 0xE9EDF1)
|
|
var headerTextPrimaryColor: UIColor = UIColor(rgb: 0x17191C)
|
|
var headerTextSecondaryColor: UIColor = UIColor(rgb: 0x737D8C)
|
|
|
|
var textPrimaryColor: UIColor = UIColor(rgb: 0x17191C)
|
|
var textSecondaryColor: UIColor = UIColor(rgb: 0x737D8C)
|
|
var textTertiaryColor: UIColor = UIColor(rgb: 0x8D99A5)
|
|
var textQuinaryColor: UIColor = UIColor(rgb: 0xE3E8F0)
|
|
|
|
var tintColor: UIColor = UIColor(rgb: 0x108194)
|
|
var tintBackgroundColor: UIColor = UIColor(rgb: 0xe9fff9)
|
|
var tabBarUnselectedItemTintColor: UIColor = UIColor(rgb: 0xC1C6CD)
|
|
var unreadRoomIndentColor: UIColor = UIColor(rgb: 0x2E3648)
|
|
var lineBreakColor: UIColor = UIColor(rgb: 0xDDE4EE)
|
|
|
|
var noticeColor: UIColor = UIColor(rgb: 0xFF4B55)
|
|
var noticeSecondaryColor: UIColor = UIColor(rgb: 0x61708B)
|
|
|
|
var warningColor: UIColor = UIColor(rgb: 0xFF4B55)
|
|
|
|
var roomInputTextBorder: UIColor = UIColor(rgb: 0xE3E8F0)
|
|
|
|
var avatarColors: [UIColor] = [
|
|
UIColor(rgb: 0x03B381),
|
|
UIColor(rgb: 0x368BD6),
|
|
UIColor(rgb: 0xAC3BA8)]
|
|
|
|
var userNameColors: [UIColor] = [
|
|
UIColor(rgb: 0x368BD6),
|
|
UIColor(rgb: 0xAC3BA8),
|
|
UIColor(rgb: 0x03B381),
|
|
UIColor(rgb: 0xE64F7A),
|
|
UIColor(rgb: 0xFF812D),
|
|
UIColor(rgb: 0x2DC2C5),
|
|
UIColor(rgb: 0x5C56F5),
|
|
UIColor(rgb: 0x74D12C)
|
|
]
|
|
|
|
var statusBarStyle: UIStatusBarStyle {
|
|
if #available(iOS 13.0, *) {
|
|
return .darkContent
|
|
} else {
|
|
return .default
|
|
}
|
|
}
|
|
var scrollBarStyle: UIScrollView.IndicatorStyle = .default
|
|
var keyboardAppearance: UIKeyboardAppearance = .light
|
|
|
|
var userInterfaceStyle: UIUserInterfaceStyle {
|
|
return .light
|
|
}
|
|
|
|
var placeholderTextColor: UIColor = UIColor(rgb: 0x8F97A3) // Use secondary text color
|
|
|
|
var selectedBackgroundColor: UIColor = UIColor(rgb: 0xF5F7FA)
|
|
|
|
var callScreenButtonTintColor: UIColor = UIColor(rgb: 0xFFFFFF)
|
|
|
|
var overlayBackgroundColor: UIColor = UIColor(white: 0.7, alpha: 0.5)
|
|
var matrixSearchBackgroundImageTintColor: UIColor = UIColor(rgb: 0xE7E7E7)
|
|
|
|
var secondaryCircleButtonBackgroundColor: UIColor = UIColor(rgb: 0xE3E8F0)
|
|
|
|
var shadowColor: UIColor = UIColor(rgb: 0x000000)
|
|
|
|
var roomCellIncomingBubbleBackgroundColor: UIColor = UIColor(rgb: 0xE8EDF4)
|
|
|
|
var roomCellOutgoingBubbleBackgroundColor: UIColor = UIColor(rgb: 0xE7F8F3)
|
|
|
|
var roomCellLocalisationIconStartedColor: UIColor = UIColor(rgb: 0x5C56F5)
|
|
|
|
var roomCellLocalisationErrorColor: UIColor = UIColor(rgb: 0xFF5B55)
|
|
|
|
func applyStyle(onTabBar tabBar: UITabBar) {
|
|
tabBar.unselectedItemTintColor = self.tabBarUnselectedItemTintColor
|
|
tabBar.tintColor = self.tintColor
|
|
tabBar.barTintColor = self.baseColor
|
|
|
|
// Support standard scrollEdgeAppearance iOS 15 without visual issues.
|
|
if #available(iOS 15.0, *) {
|
|
tabBar.isTranslucent = true
|
|
} else {
|
|
tabBar.isTranslucent = false
|
|
}
|
|
}
|
|
|
|
// Protocols don't support default parameter values and a protocol extension doesn't work for @objc
|
|
func applyStyle(onNavigationBar navigationBar: UINavigationBar) {
|
|
applyStyle(onNavigationBar: navigationBar, withModernScrollEdgeAppearance: false)
|
|
}
|
|
|
|
func applyStyle(onNavigationBar navigationBar: UINavigationBar,
|
|
withModernScrollEdgeAppearance modernScrollEdgeAppearance: Bool) {
|
|
navigationBar.tintColor = tintColor
|
|
|
|
// On iOS 15 use UINavigationBarAppearance to fix visual issues with the scrollEdgeAppearance style.
|
|
if #available(iOS 13.0, *) {
|
|
let appearance = UINavigationBarAppearance()
|
|
|
|
appearance.configureWithOpaqueBackground()
|
|
appearance.backgroundColor = baseColor
|
|
|
|
if !modernScrollEdgeAppearance {
|
|
appearance.shadowColor = nil
|
|
}
|
|
appearance.titleTextAttributes = [
|
|
.foregroundColor: textPrimaryColor
|
|
]
|
|
appearance.largeTitleTextAttributes = [
|
|
.foregroundColor: textPrimaryColor
|
|
]
|
|
|
|
navigationBar.standardAppearance = appearance
|
|
navigationBar.scrollEdgeAppearance = modernScrollEdgeAppearance ? nil : appearance
|
|
} else {
|
|
navigationBar.titleTextAttributes = [
|
|
NSAttributedString.Key.foregroundColor: textPrimaryColor
|
|
]
|
|
navigationBar.barTintColor = baseColor
|
|
navigationBar.shadowImage = UIImage() // Remove bottom shadow
|
|
|
|
// The navigation bar needs to be opaque so that its background color is the expected one
|
|
navigationBar.isTranslucent = false
|
|
}
|
|
}
|
|
|
|
func applyStyle(onSearchBar searchBar: UISearchBar) {
|
|
searchBar.searchBarStyle = .default
|
|
searchBar.barTintColor = self.baseColor
|
|
searchBar.isTranslucent = false
|
|
searchBar.backgroundImage = UIImage() // Remove top and bottom shadow
|
|
searchBar.tintColor = self.tintColor
|
|
|
|
guard !BuildSettings.newAppLayoutEnabled else {
|
|
return
|
|
}
|
|
|
|
searchBar.searchTextField.backgroundColor = self.searchBackgroundColor
|
|
searchBar.searchTextField.textColor = self.searchPlaceholderColor
|
|
}
|
|
|
|
func applyStyle(onTextField texField: UITextField) {
|
|
texField.textColor = self.textPrimaryColor
|
|
texField.tintColor = self.tintColor
|
|
}
|
|
|
|
func applyStyle(onButton button: UIButton) {
|
|
// NOTE: Tint color does nothing by default on button type `UIButtonType.custom`
|
|
button.tintColor = self.tintColor
|
|
button.setTitleColor(self.tintColor, for: .normal)
|
|
}
|
|
|
|
/// MARK: - Theme v2
|
|
var colors: ColorsUIKit = LightColors.uiKit
|
|
|
|
var fonts: FontsUIKit = FontsUIKit(values: ElementFonts())
|
|
}
|