Merge pull request #2268 from vector-im/dark_theme_update

Reskin: Update Dark theme colors
This commit is contained in:
SBiOSoftWhare
2019-02-19 09:54:20 +01:00
committed by GitHub
6 changed files with 34 additions and 14 deletions
-2
View File
@@ -429,8 +429,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
[NSBundle mxk_setLanguage:language];
[NSBundle mxk_setFallbackLanguage:@"en"];
// Define the navigation bar text color
[[UINavigationBar appearance] setTintColor:ThemeService.shared.theme.tintColor];
// Customize the localized string table
[NSBundle mxk_customizeLocalizedStringTableName:@"Vector"];
+5
View File
@@ -80,6 +80,11 @@ import UIKit
// MARK: - Customisation methods
/// Apply the theme on a button.
///
/// - Parameter tabBar: The tabBar to customise.
func applyStyle(onTabBar tabBar: UITabBar)
/// Apply the theme on a navigation bar
///
+12 -2
View File
@@ -51,8 +51,8 @@ NSString *const kThemeServiceDidChangeThemeNotification = @"kThemeServiceDidChan
- (void)setTheme:(id<Theme> _Nonnull)theme
{
_theme = theme;
[UIScrollView appearance].indicatorStyle = self.theme.scrollBarStyle;
[self updateAppearance];
[[NSNotificationCenter defaultCenter] postNotificationName:kThemeServiceDidChangeThemeNotification object:nil];
}
@@ -112,5 +112,15 @@ NSString *const kThemeServiceDidChangeThemeNotification = @"kThemeServiceDidChan
}
}
- (void)updateAppearance
{
[UIScrollView appearance].indicatorStyle = self.theme.scrollBarStyle;
// Define the navigation bar text color
[[UINavigationBar appearance] setTintColor:self.theme.tintColor];
// Define the UISearchBar cancel button color
[[UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UISearchBar class]]] setTitleTextAttributes:@{ NSForegroundColorAttributeName : self.theme.searchPlaceholderColor } forState: UIControlStateNormal];
}
@end
+10 -6
View File
@@ -23,15 +23,15 @@ class DarkTheme: NSObject, Theme {
var backgroundColor: UIColor = UIColor(rgb: 0x181B21)
var baseColor: UIColor = UIColor(rgb: 0x1B1F25)
var baseColor: UIColor = UIColor(rgb: 0x15171B)
var baseTextPrimaryColor: UIColor = UIColor(rgb: 0xEDF3FF)
var baseTextSecondaryColor: UIColor = UIColor(rgb: 0xEDF3FF)
var searchBackgroundColor: UIColor = UIColor(rgb: 0x181B21)
var searchPlaceholderColor: UIColor = UIColor(rgb: 0x61708B)
var headerBackgroundColor: UIColor = UIColor(rgb: 0x22262E)
var headerBorderColor: UIColor = UIColor(rgb: 0x181B21)
var headerBackgroundColor: UIColor = UIColor(rgb: 0x15171B)
var headerBorderColor: UIColor = UIColor(rgb: 0x22262E)
var headerTextPrimaryColor: UIColor = UIColor(rgb: 0xA1B2D1)
var headerTextSecondaryColor: UIColor = UIColor(rgb: 0xC8C8CD)
@@ -60,6 +60,12 @@ class DarkTheme: NSObject, Theme {
var selectedBackgroundColor: UIColor? = UIColor.black
var overlayBackgroundColor: UIColor = UIColor(white: 0.7, alpha: 0.5)
var matrixSearchBackgroundImageTintColor: UIColor = UIColor(rgb: 0x7E7E7E)
func applyStyle(onTabBar tabBar: UITabBar) {
tabBar.tintColor = self.tintColor;
tabBar.barTintColor = self.headerBackgroundColor;
tabBar.isTranslucent = false;
}
func applyStyle(onNavigationBar navigationBar: UINavigationBar) {
navigationBar.tintColor = self.baseTextPrimaryColor;
@@ -75,9 +81,7 @@ class DarkTheme: NSObject, Theme {
func applyStyle(onSearchBar searchBar: UISearchBar) {
searchBar.barStyle = .black
searchBar.tintColor = self.searchPlaceholderColor;
searchBar.barTintColor = self.headerBackgroundColor;
searchBar.layer.borderWidth = 1;
searchBar.layer.borderColor = self.headerBorderColor.cgColor;
searchBar.barTintColor = self.headerBackgroundColor;
}
func applyStyle(onTextField texField: UITextField) {
@@ -60,6 +60,12 @@ class DefaultTheme: NSObject, Theme {
var selectedBackgroundColor: UIColor? = nil // Use the default selection color
var overlayBackgroundColor: UIColor = UIColor(white: 0.7, alpha: 0.5)
var matrixSearchBackgroundImageTintColor: UIColor = UIColor(rgb: 0xE7E7E7)
func applyStyle(onTabBar tabBar: UITabBar) {
tabBar.tintColor = self.tintColor;
tabBar.barTintColor = self.headerBackgroundColor;
tabBar.isTranslucent = false;
}
func applyStyle(onNavigationBar navigationBar: UINavigationBar) {
navigationBar.tintColor = self.baseTextPrimaryColor;
@@ -76,8 +82,6 @@ class DefaultTheme: NSObject, Theme {
searchBar.barStyle = .default
searchBar.tintColor = self.searchPlaceholderColor;
searchBar.barTintColor = self.headerBackgroundColor;
searchBar.layer.borderWidth = 1;
searchBar.layer.borderColor = self.headerBorderColor.cgColor;
}
func applyStyle(onTextField texField: UITextField) {
+1 -2
View File
@@ -116,8 +116,7 @@
{
[ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar];
self.tabBar.tintColor = ThemeService.shared.theme.tintColor;
self.tabBar.barTintColor = ThemeService.shared.theme.headerBackgroundColor;
[ThemeService.shared.theme applyStyleOnTabBar:self.tabBar];
self.view.backgroundColor = ThemeService.shared.theme.backgroundColor;