mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Merge branch 'charlesmchen/themeSearchBars'
This commit is contained in:
commit
e2dfe00124
|
@ -117,8 +117,10 @@ public class ContactsPicker: OWSViewController, UITableViewDelegate, UITableView
|
||||||
self.view.backgroundColor = Theme.backgroundColor
|
self.view.backgroundColor = Theme.backgroundColor
|
||||||
self.tableView.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.barStyle = Theme.barStyle
|
||||||
|
self.searchBar.searchBarStyle = Theme.searchBarStyle
|
||||||
|
self.searchBar.barTintColor = Theme.backgroundColor
|
||||||
searchBar.placeholder = NSLocalizedString("INVITE_FRIENDS_PICKER_SEARCHBAR_PLACEHOLDER", comment: "Search")
|
searchBar.placeholder = NSLocalizedString("INVITE_FRIENDS_PICKER_SEARCHBAR_PLACEHOLDER", comment: "Search")
|
||||||
|
|
||||||
// Auto size cells for dynamic type
|
// Auto size cells for dynamic type
|
||||||
|
|
|
@ -164,8 +164,10 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
|
||||||
searchBar.delegate = self
|
searchBar.delegate = self
|
||||||
searchBar.placeholder = NSLocalizedString("GIF_VIEW_SEARCH_PLACEHOLDER_TEXT",
|
searchBar.placeholder = NSLocalizedString("GIF_VIEW_SEARCH_PLACEHOLDER_TEXT",
|
||||||
comment: "Placeholder text for the search field in GIF view")
|
comment: "Placeholder text for the search field in GIF view")
|
||||||
searchBar.backgroundColor = Theme.backgroundColor
|
searchBar.backgroundColor = Theme.searchBarBackgroundColor
|
||||||
searchBar.barStyle = Theme.barStyle
|
searchBar.barStyle = Theme.barStyle
|
||||||
|
searchBar.searchBarStyle = Theme.searchBarStyle
|
||||||
|
searchBar.barTintColor = Theme.backgroundColor
|
||||||
|
|
||||||
self.view.addSubview(searchBar)
|
self.view.addSubview(searchBar)
|
||||||
searchBar.autoPinWidthToSuperview()
|
searchBar.autoPinWidthToSuperview()
|
||||||
|
|
|
@ -257,8 +257,10 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
|
||||||
|
|
||||||
self.view.backgroundColor = Theme.backgroundColor;
|
self.view.backgroundColor = Theme.backgroundColor;
|
||||||
self.tableView.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.barStyle = Theme.barStyle;
|
||||||
|
self.searchBar.searchBarStyle = Theme.searchBarStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - View Life Cycle
|
#pragma mark - View Life Cycle
|
||||||
|
@ -401,7 +403,6 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
|
||||||
|
|
||||||
UISearchBar *searchBar = [UISearchBar new];
|
UISearchBar *searchBar = [UISearchBar new];
|
||||||
_searchBar = searchBar;
|
_searchBar = searchBar;
|
||||||
searchBar.searchBarStyle = UISearchBarStyleMinimal;
|
|
||||||
searchBar.placeholder = NSLocalizedString(@"HOME_VIEW_CONVERSATION_SEARCHBAR_PLACEHOLDER",
|
searchBar.placeholder = NSLocalizedString(@"HOME_VIEW_CONVERSATION_SEARCHBAR_PLACEHOLDER",
|
||||||
@"Placeholder text for search bar which filters conversations.");
|
@"Placeholder text for search bar which filters conversations.");
|
||||||
searchBar.delegate = self;
|
searchBar.delegate = self;
|
||||||
|
|
|
@ -101,8 +101,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
searchBar.searchBarStyle = UISearchBarStyleMinimal;
|
searchBar.searchBarStyle = UISearchBarStyleMinimal;
|
||||||
searchBar.delegate = self;
|
searchBar.delegate = self;
|
||||||
searchBar.placeholder = NSLocalizedString(@"SEARCH_BYNAMEORNUMBER_PLACEHOLDER_TEXT", @"");
|
searchBar.placeholder = NSLocalizedString(@"SEARCH_BYNAMEORNUMBER_PLACEHOLDER_TEXT", @"");
|
||||||
searchBar.backgroundColor = [Theme backgroundColor];
|
searchBar.backgroundColor = Theme.searchBarBackgroundColor;
|
||||||
searchBar.barStyle = Theme.barStyle;
|
searchBar.barStyle = Theme.barStyle;
|
||||||
|
searchBar.searchBarStyle = Theme.searchBarStyle;
|
||||||
|
searchBar.barTintColor = Theme.backgroundColor;
|
||||||
[searchBar sizeToFit];
|
[searchBar sizeToFit];
|
||||||
|
|
||||||
_tableViewController = [OWSTableViewController new];
|
_tableViewController = [OWSTableViewController new];
|
||||||
|
|
|
@ -91,8 +91,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
searchBar.searchBarStyle = UISearchBarStyleMinimal;
|
searchBar.searchBarStyle = UISearchBarStyleMinimal;
|
||||||
searchBar.delegate = self;
|
searchBar.delegate = self;
|
||||||
searchBar.placeholder = NSLocalizedString(@"SEARCH_BYNAMEORNUMBER_PLACEHOLDER_TEXT", @"");
|
searchBar.placeholder = NSLocalizedString(@"SEARCH_BYNAMEORNUMBER_PLACEHOLDER_TEXT", @"");
|
||||||
searchBar.backgroundColor = [Theme backgroundColor];
|
searchBar.backgroundColor = Theme.searchBarBackgroundColor;
|
||||||
searchBar.barStyle = Theme.barStyle;
|
searchBar.barStyle = Theme.barStyle;
|
||||||
|
searchBar.searchBarStyle = Theme.searchBarStyle;
|
||||||
|
searchBar.barTintColor = Theme.backgroundColor;
|
||||||
[searchBar sizeToFit];
|
[searchBar sizeToFit];
|
||||||
|
|
||||||
UIView *header = [self.selectThreadViewDelegate createHeaderWithSearchBar:searchBar];
|
UIView *header = [self.selectThreadViewDelegate createHeaderWithSearchBar:searchBar];
|
||||||
|
|
|
@ -44,6 +44,8 @@ extern NSString *const ThemeDidChangeNotification;
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
@property (class, readonly, nonatomic) UIBarStyle barStyle;
|
@property (class, readonly, nonatomic) UIBarStyle barStyle;
|
||||||
|
@property (class, readonly, nonatomic) UISearchBarStyle searchBarStyle;
|
||||||
|
@property (class, readonly, nonatomic) UIColor *searchBarBackgroundColor;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -123,12 +123,26 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
|
||||||
+ (UIBarStyle)barStyle
|
+ (UIBarStyle)barStyle
|
||||||
{
|
{
|
||||||
if (Theme.isDarkThemeEnabled) {
|
if (Theme.isDarkThemeEnabled) {
|
||||||
return UIBarStyleBlack;
|
return UIBarStyleDefault;
|
||||||
} else {
|
} else {
|
||||||
return UIBarStyleDefault;
|
return UIBarStyleDefault;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (UISearchBarStyle)searchBarStyle
|
||||||
|
{
|
||||||
|
if (Theme.isDarkThemeEnabled) {
|
||||||
|
return UISearchBarStyleProminent;
|
||||||
|
} else {
|
||||||
|
return UISearchBarStyleMinimal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (UIColor *)searchBarBackgroundColor
|
||||||
|
{
|
||||||
|
return Theme.backgroundColor;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
|
Loading…
Reference in a new issue