Refine theme.

pull/1/head
Matthew Chen 7 years ago
parent 84fcf1ea3e
commit 4f8dbf39b5

@ -119,7 +119,7 @@ public class ContactsPicker: OWSViewController, UITableViewDelegate, UITableView
self.tableView.backgroundColor = Theme.backgroundColor
self.searchBar.backgroundColor = Theme.backgroundColor
self.searchBar.barStyle = Theme.barStyle()
self.searchBar.barStyle = Theme.barStyle
searchBar.placeholder = NSLocalizedString("INVITE_FRIENDS_PICKER_SEARCHBAR_PLACEHOLDER", comment: "Search")
// Auto size cells for dynamic type

@ -150,7 +150,10 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
private func createViews() {
view.backgroundColor = UIColor.white
let backgroundColor = (Theme.isDarkThemeEnabled()
? UIColor(white: 0.08, alpha: 1.0)
: Theme.backgroundColor)
self.view.backgroundColor = backgroundColor
// Block UIKit from adjust insets of collection view which screws up
// min/max scroll positions.
@ -161,7 +164,8 @@ 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 = UIColor.white
searchBar.backgroundColor = Theme.backgroundColor
searchBar.barStyle = Theme.barStyle
self.view.addSubview(searchBar)
searchBar.autoPinWidthToSuperview()
@ -169,7 +173,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
self.collectionView.delegate = self
self.collectionView.dataSource = self
self.collectionView.backgroundColor = UIColor.white
self.collectionView.backgroundColor = backgroundColor
self.collectionView.register(GifPickerCell.self, forCellWithReuseIdentifier: kCellReuseIdentifier)
// Inserted below searchbar because we later occlude the collectionview
// by inserting a masking layer between the search bar and collectionview
@ -228,7 +232,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
private func createErrorLabel(text: String) -> UILabel {
let label = UILabel()
label.text = text
label.textColor = UIColor.black
label.textColor = Theme.primaryColor
label.font = UIFont.ows_mediumFont(withSize: 20)
label.textAlignment = .center
label.numberOfLines = 0

@ -253,7 +253,10 @@ class ConversationSearchViewController: UITableViewController {
// a snippet for conversations that reflects the latest
// contents.
if let messageSnippet = searchResult.snippet {
overrideSnippet = NSAttributedString(string: messageSnippet)
overrideSnippet = NSAttributedString(string: messageSnippet,
attributes: [
NSAttributedStringKey.foregroundColor: Theme.primaryColor
])
} else {
owsFail("\(ConversationSearchViewController.logTag) message search result is missing message snippet")
}

@ -93,7 +93,7 @@ NS_ASSUME_NONNULL_BEGIN
object:nil];
self.bottomLayoutView = view;
self.bottomLayoutConstraint = [view autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.view];
self.bottomLayoutConstraint = [view autoPinToBottomLayoutGuideOfViewController:self withInset:0.f];
}
- (void)observeActivation

@ -40,7 +40,7 @@ extern NSString *const ThemeDidChangeNotification;
#pragma mark -
+ (UIBarStyle)barStyle;
@property (class, readonly, nonatomic) UIBarStyle barStyle;
@end

@ -25,6 +25,11 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
#ifndef THEME_ENABLED
return NO;
#else
if (!CurrentAppContext().isMainApp) {
// Ignore theme in app extensions.
return NO;
}
return [OWSPrimaryStorage.sharedManager.dbReadConnection boolForKey:ThemeKeyThemeEnabled
inCollection:ThemeCollection
defaultValue:NO];

Loading…
Cancel
Save