diff --git a/Signal/src/ViewControllers/ContactsPicker.swift b/Signal/src/ViewControllers/ContactsPicker.swift index 964bdfdc7..88073bb9b 100644 --- a/Signal/src/ViewControllers/ContactsPicker.swift +++ b/Signal/src/ViewControllers/ContactsPicker.swift @@ -117,8 +117,10 @@ public class ContactsPicker: OWSViewController, UITableViewDelegate, UITableView self.view.backgroundColor = Theme.backgroundColor self.tableView.backgroundColor = Theme.backgroundColor - self.searchBar.backgroundColor = Theme.backgroundColor + self.searchBar.backgroundColor = Theme.searchBarBackgroundColor self.searchBar.barStyle = Theme.barStyle + self.searchBar.searchBarStyle = Theme.searchBarStyle + self.searchBar.barTintColor = Theme.backgroundColor searchBar.placeholder = NSLocalizedString("INVITE_FRIENDS_PICKER_SEARCHBAR_PLACEHOLDER", comment: "Search") // Auto size cells for dynamic type diff --git a/Signal/src/ViewControllers/GifPicker/GifPickerViewController.swift b/Signal/src/ViewControllers/GifPicker/GifPickerViewController.swift index 10a896ab5..7631420a5 100644 --- a/Signal/src/ViewControllers/GifPicker/GifPickerViewController.swift +++ b/Signal/src/ViewControllers/GifPicker/GifPickerViewController.swift @@ -164,8 +164,10 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect searchBar.delegate = self searchBar.placeholder = NSLocalizedString("GIF_VIEW_SEARCH_PLACEHOLDER_TEXT", comment: "Placeholder text for the search field in GIF view") - searchBar.backgroundColor = Theme.backgroundColor + searchBar.backgroundColor = Theme.searchBarBackgroundColor searchBar.barStyle = Theme.barStyle + searchBar.searchBarStyle = Theme.searchBarStyle + searchBar.barTintColor = Theme.backgroundColor self.view.addSubview(searchBar) searchBar.autoPinWidthToSuperview() diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m index c65ed50c8..78f176eca 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -257,8 +257,10 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations self.view.backgroundColor = Theme.backgroundColor; self.tableView.backgroundColor = Theme.backgroundColor; - self.searchBar.backgroundColor = Theme.backgroundColor; + self.searchBar.backgroundColor = Theme.searchBarBackgroundColor; + self.searchBar.barTintColor = Theme.backgroundColor; self.searchBar.barStyle = Theme.barStyle; + self.searchBar.searchBarStyle = Theme.searchBarStyle; } #pragma mark - View Life Cycle @@ -401,7 +403,6 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations UISearchBar *searchBar = [UISearchBar new]; _searchBar = searchBar; - searchBar.searchBarStyle = UISearchBarStyleMinimal; searchBar.placeholder = NSLocalizedString(@"HOME_VIEW_CONVERSATION_SEARCHBAR_PLACEHOLDER", @"Placeholder text for search bar which filters conversations."); searchBar.delegate = self; diff --git a/Signal/src/ViewControllers/NewContactThreadViewController.m b/Signal/src/ViewControllers/NewContactThreadViewController.m index f8e3b0240..901b34340 100644 --- a/Signal/src/ViewControllers/NewContactThreadViewController.m +++ b/Signal/src/ViewControllers/NewContactThreadViewController.m @@ -101,8 +101,10 @@ NS_ASSUME_NONNULL_BEGIN searchBar.searchBarStyle = UISearchBarStyleMinimal; searchBar.delegate = self; searchBar.placeholder = NSLocalizedString(@"SEARCH_BYNAMEORNUMBER_PLACEHOLDER_TEXT", @""); - searchBar.backgroundColor = [Theme backgroundColor]; + searchBar.backgroundColor = Theme.searchBarBackgroundColor; searchBar.barStyle = Theme.barStyle; + searchBar.searchBarStyle = Theme.searchBarStyle; + searchBar.barTintColor = Theme.backgroundColor; [searchBar sizeToFit]; _tableViewController = [OWSTableViewController new]; diff --git a/SignalMessaging/ViewControllers/SelectThreadViewController.m b/SignalMessaging/ViewControllers/SelectThreadViewController.m index bf7662df0..21e8730a5 100644 --- a/SignalMessaging/ViewControllers/SelectThreadViewController.m +++ b/SignalMessaging/ViewControllers/SelectThreadViewController.m @@ -91,8 +91,10 @@ NS_ASSUME_NONNULL_BEGIN searchBar.searchBarStyle = UISearchBarStyleMinimal; searchBar.delegate = self; searchBar.placeholder = NSLocalizedString(@"SEARCH_BYNAMEORNUMBER_PLACEHOLDER_TEXT", @""); - searchBar.backgroundColor = [Theme backgroundColor]; + searchBar.backgroundColor = Theme.searchBarBackgroundColor; searchBar.barStyle = Theme.barStyle; + searchBar.searchBarStyle = Theme.searchBarStyle; + searchBar.barTintColor = Theme.backgroundColor; [searchBar sizeToFit]; UIView *header = [self.selectThreadViewDelegate createHeaderWithSearchBar:searchBar]; diff --git a/SignalMessaging/categories/Theme.h b/SignalMessaging/categories/Theme.h index 270d1ccc4..302fe1456 100644 --- a/SignalMessaging/categories/Theme.h +++ b/SignalMessaging/categories/Theme.h @@ -44,6 +44,8 @@ extern NSString *const ThemeDidChangeNotification; #pragma mark - @property (class, readonly, nonatomic) UIBarStyle barStyle; +@property (class, readonly, nonatomic) UISearchBarStyle searchBarStyle; +@property (class, readonly, nonatomic) UIColor *searchBarBackgroundColor; @end diff --git a/SignalMessaging/categories/Theme.m b/SignalMessaging/categories/Theme.m index 85ddc6760..c4e85e9e4 100644 --- a/SignalMessaging/categories/Theme.m +++ b/SignalMessaging/categories/Theme.m @@ -123,12 +123,26 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled"; + (UIBarStyle)barStyle { if (Theme.isDarkThemeEnabled) { - return UIBarStyleBlack; + return UIBarStyleDefault; } else { return UIBarStyleDefault; } } ++ (UISearchBarStyle)searchBarStyle +{ + if (Theme.isDarkThemeEnabled) { + return UISearchBarStyleProminent; + } else { + return UISearchBarStyleMinimal; + } +} + ++ (UIColor *)searchBarBackgroundColor +{ + return Theme.backgroundColor; +} + @end NS_ASSUME_NONNULL_END