Respond to CR.

This commit is contained in:
Matthew Chen 2018-08-08 15:49:22 -04:00
parent 816f02fbab
commit 6dfe36f9b5
11 changed files with 32 additions and 16 deletions

View File

@ -194,7 +194,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
bottomBanner.autoPinEdge(toSuperviewEdge: .top)
bottomBanner.autoPinWidthToSuperview()
self.autoPinView(toBottomOfViewControllerOrKeyboard: bottomBanner)
self.autoPinView(toBottomOfViewControllerOrKeyboard: bottomBanner, avoidNotch: true)
// The Giphy API requires us to "show their trademark prominently" in our GIF experience.
let logoImage = UIImage(named: "giphy_logo")

View File

@ -239,7 +239,7 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
#pragma mark - Theme
- (void)themeDidChange:(id)notification
- (void)themeDidChange:(NSNotification *)notification
{
OWSAssertIsOnMainThread();

View File

@ -412,9 +412,7 @@ class MenuActionView: UIButton {
super.init(frame: CGRect.zero)
isUserInteractionEnabled = true
backgroundColor = (Theme.isDarkThemeEnabled
? UIColor.ows_dark60
: UIColor.white)
backgroundColor = defaultBackgroundColor
let imageView = UIImageView(image: action.image)
let imageWidth: CGFloat = 24
@ -455,9 +453,21 @@ class MenuActionView: UIButton {
self.isUserInteractionEnabled = false
}
private var defaultBackgroundColor: UIColor {
return (Theme.isDarkThemeEnabled
? UIColor.ows_dark60
: UIColor.white)
}
private var highlightedBackgroundColor: UIColor {
return (Theme.isDarkThemeEnabled
? UIColor.ows_dark70
: UIColor.ows_light10)
}
override var isHighlighted: Bool {
didSet {
self.backgroundColor = isHighlighted ? Theme.backgroundColor.withAlphaComponent(0.9) : Theme.backgroundColor
self.backgroundColor = isHighlighted ? highlightedBackgroundColor : defaultBackgroundColor
}
}

View File

@ -121,7 +121,7 @@ NS_ASSUME_NONNULL_BEGIN
self.tableViewController.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableViewController.tableView.estimatedRowHeight = 60;
[self autoPinViewToBottomOfViewControllerOrKeyboard:self.tableViewController.view];
[self autoPinViewToBottomOfViewControllerOrKeyboard:self.tableViewController.view avoidNotch:NO];
_tableViewController.tableView.tableHeaderView = searchBar;
_noSignalContactsView = [self createNoSignalContactsView];
@ -1000,7 +1000,7 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Theme
- (void)themeDidChange:(id)notification
- (void)themeDidChange:(NSNotification *)notification
{
OWSAssertIsOnMainThread();

View File

@ -126,7 +126,7 @@ const NSUInteger kNewGroupViewControllerAvatarWidth = 68;
[self.view addSubview:self.tableViewController.view];
[_tableViewController.view autoPinWidthToSuperview];
[_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:firstSection];
[self autoPinViewToBottomOfViewControllerOrKeyboard:self.tableViewController.view];
[self autoPinViewToBottomOfViewControllerOrKeyboard:self.tableViewController.view avoidNotch:NO];
self.tableViewController.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableViewController.tableView.estimatedRowHeight = 60;

View File

@ -122,7 +122,7 @@ NS_ASSUME_NONNULL_BEGIN
[self.view addSubview:self.tableViewController.view];
[_tableViewController.view autoPinWidthToSuperview];
[_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:firstSection];
[self autoPinViewToBottomOfViewControllerOrKeyboard:self.tableViewController.view];
[self autoPinViewToBottomOfViewControllerOrKeyboard:self.tableViewController.view avoidNotch:NO];
self.tableViewController.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableViewController.tableView.estimatedRowHeight = 60;

View File

@ -71,7 +71,9 @@ public class ModalActivityIndicatorViewController: OWSViewController {
public override func loadView() {
super.loadView()
self.view.backgroundColor = UIColor(white: 0, alpha: 0.25)
self.view.backgroundColor = (Theme.isDarkThemeEnabled
? UIColor(white: 0.35, alpha: 0.35)
: UIColor(white: 0, alpha: 0.25))
self.view.isOpaque = false
let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .whiteLarge)

View File

@ -55,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)themeDidChange:(id)notification
- (void)themeDidChange:(NSNotification *)notification
{
OWSAssertIsOnMainThread();

View File

@ -706,7 +706,7 @@ NSString *const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier";
#pragma mark - Theme
- (void)themeDidChange:(id)notification
- (void)themeDidChange:(NSNotification *)notification
{
OWSAssertIsOnMainThread();

View File

@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
// We often want to pin one view to the bottom of a view controller
// BUT adjust its location upward if the keyboard appears.
- (void)autoPinViewToBottomOfViewControllerOrKeyboard:(UIView *)view;
- (void)autoPinViewToBottomOfViewControllerOrKeyboard:(UIView *)view avoidNotch:(BOOL)avoidNotch;
@end

View File

@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN
}
}
- (void)autoPinViewToBottomOfViewControllerOrKeyboard:(UIView *)view
- (void)autoPinViewToBottomOfViewControllerOrKeyboard:(UIView *)view avoidNotch:(BOOL)avoidNotch
{
OWSAssert(view);
OWSAssert(!self.bottomLayoutConstraint);
@ -93,7 +93,11 @@ NS_ASSUME_NONNULL_BEGIN
object:nil];
self.bottomLayoutView = view;
self.bottomLayoutConstraint = [view autoPinToBottomLayoutGuideOfViewController:self withInset:0.f];
if (avoidNotch) {
self.bottomLayoutConstraint = [view autoPinToBottomLayoutGuideOfViewController:self withInset:0.f];
} else {
self.bottomLayoutConstraint = [view autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.view];
}
}
- (void)observeActivation