2018-11-29 13:09:12 +00:00
|
|
|
/*
|
|
|
|
Copyright 2018 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 UIKit
|
|
|
|
|
|
|
|
/// Provide color constant values defined by the designer
|
2019-02-12 17:54:39 +00:00
|
|
|
/// https://app.zeplin.io/project/5c122fa790c5b4241ffa6be7/screen/5c619592daff2f1241d82e75
|
2019-01-10 14:32:59 +00:00
|
|
|
@objc protocol Theme {
|
2020-06-05 07:56:06 +00:00
|
|
|
|
|
|
|
var identifier: String { get }
|
2018-11-29 13:09:12 +00:00
|
|
|
|
2019-01-10 14:23:22 +00:00
|
|
|
var backgroundColor: UIColor { get }
|
|
|
|
var baseColor: UIColor { get }
|
2018-11-29 13:09:12 +00:00
|
|
|
|
2020-07-02 17:03:15 +00:00
|
|
|
var baseIconPrimaryColor: UIColor { get }
|
2019-01-10 14:23:22 +00:00
|
|
|
var baseTextPrimaryColor: UIColor { get }
|
|
|
|
var baseTextSecondaryColor: UIColor { get }
|
2018-11-29 15:05:07 +00:00
|
|
|
|
2019-01-10 14:23:22 +00:00
|
|
|
var searchBackgroundColor: UIColor { get }
|
2019-02-12 18:06:22 +00:00
|
|
|
var searchPlaceholderColor: UIColor { get }
|
2018-11-29 13:09:12 +00:00
|
|
|
|
2019-01-10 14:23:22 +00:00
|
|
|
var headerBackgroundColor: UIColor { get }
|
|
|
|
var headerBorderColor: UIColor { get }
|
|
|
|
var headerTextPrimaryColor: UIColor { get }
|
|
|
|
var headerTextSecondaryColor: UIColor { get }
|
2018-11-29 13:09:12 +00:00
|
|
|
|
2019-01-10 14:23:22 +00:00
|
|
|
var textPrimaryColor: UIColor { get }
|
|
|
|
var textSecondaryColor: UIColor { get }
|
2018-11-29 13:09:12 +00:00
|
|
|
|
2019-01-10 14:23:22 +00:00
|
|
|
var tintColor: UIColor { get }
|
2019-05-15 21:35:09 +00:00
|
|
|
var tintBackgroundColor: UIColor { get }
|
2020-07-02 17:03:15 +00:00
|
|
|
|
|
|
|
var tabBarUnselectedItemTintColor: UIColor { get }
|
2018-11-29 13:09:12 +00:00
|
|
|
|
2019-01-10 14:23:22 +00:00
|
|
|
var unreadRoomIndentColor: UIColor { get }
|
|
|
|
|
2019-02-12 18:06:22 +00:00
|
|
|
var lineBreakColor: UIColor { get }
|
|
|
|
|
|
|
|
var noticeColor: UIColor { get }
|
|
|
|
var noticeSecondaryColor: UIColor { get }
|
2019-01-10 14:23:22 +00:00
|
|
|
|
2019-01-18 12:40:09 +00:00
|
|
|
/// Color for errors or warnings
|
|
|
|
var warningColor: UIColor { get }
|
|
|
|
|
2019-01-10 14:23:22 +00:00
|
|
|
var avatarColors: [UIColor] { get }
|
2019-03-07 16:33:52 +00:00
|
|
|
|
|
|
|
var userNameColors: [UIColor] { get }
|
2020-07-02 17:03:15 +00:00
|
|
|
|
|
|
|
var placeholderTextColor: UIColor { get }
|
|
|
|
|
|
|
|
var selectedBackgroundColor: UIColor { get }
|
2021-02-07 17:12:30 +00:00
|
|
|
|
|
|
|
// MARK: - Call Screen Specific Colors
|
|
|
|
|
|
|
|
var callScreenButtonTintColor: UIColor { get }
|
2019-01-10 16:42:43 +00:00
|
|
|
|
|
|
|
// MARK: - Appearance and style
|
|
|
|
|
|
|
|
|
2019-01-10 16:36:36 +00:00
|
|
|
/// Status bar style to use
|
2019-01-10 16:08:32 +00:00
|
|
|
var statusBarStyle: UIStatusBarStyle { get }
|
|
|
|
|
2019-02-20 15:45:32 +00:00
|
|
|
var scrollBarStyle: UIScrollView.IndicatorStyle { get }
|
2019-01-10 17:53:24 +00:00
|
|
|
|
2019-02-27 09:07:51 +00:00
|
|
|
var keyboardAppearance: UIKeyboardAppearance { get }
|
2020-09-22 11:17:20 +00:00
|
|
|
|
|
|
|
@available(iOS 12.0, *)
|
|
|
|
var userInterfaceStyle: UIUserInterfaceStyle { get }
|
2019-01-10 16:42:43 +00:00
|
|
|
|
2019-01-10 16:36:36 +00:00
|
|
|
|
2019-01-10 17:47:49 +00:00
|
|
|
// MARK: - Colors not defined in the design palette
|
2019-01-10 16:36:36 +00:00
|
|
|
|
2019-01-10 17:47:49 +00:00
|
|
|
/// fading behind dialog modals
|
|
|
|
var overlayBackgroundColor: UIColor { get }
|
|
|
|
|
2019-01-10 16:36:36 +00:00
|
|
|
/// Color to tint the search background image
|
|
|
|
var matrixSearchBackgroundImageTintColor: UIColor { get }
|
2020-11-25 13:11:52 +00:00
|
|
|
|
2019-01-10 16:36:36 +00:00
|
|
|
// MARK: - Customisation methods
|
|
|
|
|
2019-02-19 08:39:01 +00:00
|
|
|
|
|
|
|
/// Apply the theme on a button.
|
|
|
|
///
|
|
|
|
/// - Parameter tabBar: The tabBar to customise.
|
|
|
|
func applyStyle(onTabBar tabBar: UITabBar)
|
2019-01-10 16:36:36 +00:00
|
|
|
|
2019-01-10 15:35:34 +00:00
|
|
|
/// Apply the theme on a navigation bar
|
|
|
|
///
|
|
|
|
/// - Parameter navigationBar: the navigation bar to customise.
|
2020-09-01 12:11:37 +00:00
|
|
|
func applyStyle(onNavigationBar navigationBar: UINavigationBar)
|
2019-01-10 15:35:34 +00:00
|
|
|
|
|
|
|
/// Apply the theme on a search bar.
|
|
|
|
///
|
|
|
|
/// - Parameter searchBar: the search bar to customise.
|
2020-09-01 12:11:37 +00:00
|
|
|
func applyStyle(onSearchBar searchBar: UISearchBar)
|
2019-01-18 09:24:58 +00:00
|
|
|
|
|
|
|
/// Apply the theme on a text field.
|
|
|
|
///
|
|
|
|
/// - Parameter textField: the text field to customise.
|
|
|
|
func applyStyle(onTextField textField: UITextField)
|
|
|
|
|
|
|
|
/// Apply the theme on a button.
|
|
|
|
///
|
|
|
|
/// - Parameter button: The button to customise.
|
|
|
|
func applyStyle(onButton button: UIButton)
|
2018-11-29 13:09:12 +00:00
|
|
|
}
|