Merge branch 'charlesmchen/keyboardLayout'

pull/1/head
Matthew Chen 8 years ago
commit 9ff1577407

@ -173,7 +173,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
self.view.addSubview(bottomBanner) self.view.addSubview(bottomBanner)
bottomBanner.autoPinWidthToSuperview() bottomBanner.autoPinWidthToSuperview()
bottomBanner.autoPinEdge(.top, to: .bottom, of: self.collectionView) bottomBanner.autoPinEdge(.top, to: .bottom, of: self.collectionView)
bottomBanner.autoPin(toBottomLayoutGuideOf: self, withInset: 0) self.autoPinView(toBottomGuideOrKeyboard:bottomBanner)
// The Giphy API requires us to "show their trademark prominently" in our GIF experience. // The Giphy API requires us to "show their trademark prominently" in our GIF experience.
let logoImage = UIImage(named: "giphy_logo") let logoImage = UIImage(named: "giphy_logo")
@ -187,14 +187,14 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
self.noResultsView = noResultsView self.noResultsView = noResultsView
self.view.addSubview(noResultsView) self.view.addSubview(noResultsView)
noResultsView.autoPinWidthToSuperview(withMargin: 20) noResultsView.autoPinWidthToSuperview(withMargin: 20)
noResultsView.autoVCenterInSuperview() noResultsView.autoAlignAxis(.horizontal, toSameAxisOf: self.collectionView)
let searchErrorView = createErrorLabel(text: NSLocalizedString("GIF_VIEW_SEARCH_ERROR", let searchErrorView = createErrorLabel(text: NSLocalizedString("GIF_VIEW_SEARCH_ERROR",
comment: "Indicates that an error occured while searching.")) comment: "Indicates that an error occured while searching."))
self.searchErrorView = searchErrorView self.searchErrorView = searchErrorView
self.view.addSubview(searchErrorView) self.view.addSubview(searchErrorView)
searchErrorView.autoPinWidthToSuperview(withMargin: 20) searchErrorView.autoPinWidthToSuperview(withMargin: 20)
searchErrorView.autoVCenterInSuperview() searchErrorView.autoAlignAxis(.horizontal, toSameAxisOf: self.collectionView)
searchErrorView.isUserInteractionEnabled = true searchErrorView.isUserInteractionEnabled = true
searchErrorView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(retryTapped))) searchErrorView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(retryTapped)))
@ -202,7 +202,8 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray) let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray)
self.activityIndicator = activityIndicator self.activityIndicator = activityIndicator
self.view.addSubview(activityIndicator) self.view.addSubview(activityIndicator)
activityIndicator.autoCenterInSuperview() activityIndicator.autoHCenterInSuperview()
activityIndicator.autoAlignAxis(.horizontal, toSameAxisOf: self.collectionView)
self.updateContents() self.updateContents()
} }

@ -122,7 +122,7 @@ NS_ASSUME_NONNULL_BEGIN
[_tableViewController.view autoPinWidthToSuperview]; [_tableViewController.view autoPinWidthToSuperview];
[_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:contactsPermissionReminderView]; [_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:contactsPermissionReminderView];
[_tableViewController.view autoPinToBottomLayoutGuideOfViewController:self withInset:0]; [self autoPinViewToBottomGuideOrKeyboard:self.tableViewController.view];
_tableViewController.tableView.tableHeaderView = searchBar; _tableViewController.tableView.tableHeaderView = searchBar;
_noSignalContactsView = [self createNoSignalContactsView]; _noSignalContactsView = [self createNoSignalContactsView];

@ -123,7 +123,7 @@ const NSUInteger kNewGroupViewControllerAvatarWidth = 68;
[self.view addSubview:self.tableViewController.view]; [self.view addSubview:self.tableViewController.view];
[_tableViewController.view autoPinWidthToSuperview]; [_tableViewController.view autoPinWidthToSuperview];
[_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:firstSection]; [_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:firstSection];
[_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeBottom]; [self autoPinViewToBottomGuideOrKeyboard:self.tableViewController.view];
[self updateTableContents]; [self updateTableContents];
} }

@ -94,7 +94,7 @@ NS_ASSUME_NONNULL_BEGIN
} else { } else {
_tableViewController.tableView.tableHeaderView = searchBar; _tableViewController.tableView.tableHeaderView = searchBar;
} }
[_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeBottom]; [self autoPinViewToBottomGuideOrKeyboard:self.tableViewController.view];
} }
#pragma mark - UISearchBarDelegate #pragma mark - UISearchBarDelegate

@ -120,7 +120,7 @@ NS_ASSUME_NONNULL_BEGIN
[self.view addSubview:self.tableViewController.view]; [self.view addSubview:self.tableViewController.view];
[_tableViewController.view autoPinWidthToSuperview]; [_tableViewController.view autoPinWidthToSuperview];
[_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:firstSection]; [_tableViewController.view autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:firstSection];
[_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeBottom]; [self autoPinViewToBottomGuideOrKeyboard:self.tableViewController.view];
[self updateTableContents]; [self updateTableContents];
} }

Loading…
Cancel
Save