Clean up ahead of PR.

// FREEBIE
pull/1/head
Matthew Chen 7 years ago
parent e4556967b6
commit 801734a938

@ -4081,14 +4081,14 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
#ifdef DEBUG
UIAlertAction *gifAction =
// TODO:
// TODO: What should the final copy be?
[UIAlertAction actionWithTitle:NSLocalizedString(@"SELECT_GIF_BUTTON",
@"Label for 'select gif to attach' action sheet button")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *_Nonnull action) {
[self showGifPicker];
}];
// TODO:
// TODO: What should the final icon be?
UIImage *gifImage = [UIImage imageNamed:@"actionsheet_gif_black"];
OWSAssert(gifImage);
[gifAction setValue:gifImage forKey:@"image"];

@ -58,7 +58,10 @@ class GifPickerLayout: UICollectionViewLayout {
let hMargin = UInt(5)
let vSpacing = UInt(3)
let hSpacing = UInt(3)
// TODO:
// TODO: We probably want to use 2 or 3 columns.
// It might depend on the device.
// 2 columns will show fewer GIFs at a time,
// but use less network & be a more responsive experience.
let columnCount = UInt(3)
let totalViewWidth = UInt(collectionView.width())

@ -254,12 +254,15 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
// MARK: - UISearchBarDelegate
public func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
// TODO: We could do progressive search as the user types.
// Don't do progressive search for GIFs; the network burden would be excessive.
}
public func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
guard let text = searchBar.text else {
// TODO: Alert?
OWSAlerts.showAlert(withTitle: NSLocalizedString("ALERT_ERROR_TITLE",
comment: ""),
message: NSLocalizedString("GIF_PICKER_VIEW_MISSING_QUERY",
comment: "Alert message shown when user tries to search for GIFs without entering any search terms."))
return
}
search(query:text)

@ -181,9 +181,9 @@ extension URLSessionTask {
private let kGiphyBaseURL = "https://api.giphy.com/"
private func giphyDownloadSession() -> URLSession? {
// TODO: Is this right?
// TODO: We need to verify that this session configuration properly
// proxies all requests.
let configuration = URLSessionConfiguration.ephemeral
// TODO: Is this right?
configuration.connectionProxyDictionary = [
kCFProxyHostNameKey as String: "giphy-proxy-production.whispersystems.org",
kCFProxyPortNumberKey as String: "80",

@ -80,7 +80,7 @@ enum GiphyFormat {
self.originalRendition = originalRendition
}
// TODO:
// TODO: We may need to tweak these constants.
let kMaxDimension = UInt(618)
let kMinDimension = UInt(101)
let kMaxFileSize = UInt(3 * 1024 * 1024)
@ -217,7 +217,8 @@ enum GiphyFormat {
Logger.error("\(GifManager.TAG) Invalid base URL.")
return nil
}
// TODO: Is this right?
// TODO: We need to verify that this session configuration properly
// proxies all requests.
let sessionConf = URLSessionConfiguration.ephemeral
sessionConf.connectionProxyDictionary = [
kCFProxyHostNameKey as String: "giphy-proxy-production.whispersystems.org",
@ -252,7 +253,6 @@ enum GiphyFormat {
// TODO: Should Signal iOS use a separate API key?
let kGiphyApiKey = "3o6ZsYH6U6Eri53TXy"
let kGiphyPageSize = 200
// TODO:
let kGiphyPageOffset = 0
guard let queryEncoded = query.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) else {
Logger.error("\(GifManager.TAG) Could not URL encode query: \(query).")

@ -601,6 +601,9 @@
/* A label for generic attachments. */
"GENERIC_ATTACHMENT_LABEL" = "Attachment";
/* Please enter your search. */
"GIF_PICKER_VIEW_MISSING_QUERY" = "Please enter your search.";
/* Title for the 'gif picker' dialog. */
"GIF_PICKER_VIEW_TITLE" = "Gif Search";

Loading…
Cancel
Save