Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent 2919e8d780
commit 86d006ba14

@ -56,21 +56,25 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat
target: self, target: self,
action: #selector(didPressCancel)) action: #selector(didPressCancel))
titleLabel.text = photoCollection.localizedTitle() if #available(iOS 11, *) {
titleLabel.textColor = Theme.primaryColor titleLabel.text = photoCollection.localizedTitle()
titleLabel.font = UIFont.ows_dynamicTypeBody.ows_mediumWeight() titleLabel.textColor = Theme.primaryColor
titleLabel.font = UIFont.ows_dynamicTypeBody.ows_mediumWeight()
let titleIconView = UIImageView()
titleIconView.tintColor = Theme.primaryColor let titleIconView = UIImageView()
titleIconView.image = UIImage(named: "navbar_disclosure_down")?.withRenderingMode(.alwaysTemplate) titleIconView.tintColor = Theme.primaryColor
titleIconView.image = UIImage(named: "navbar_disclosure_down")?.withRenderingMode(.alwaysTemplate)
let titleView = UIStackView(arrangedSubviews: [titleLabel, titleIconView])
titleView.axis = .horizontal let titleView = UIStackView(arrangedSubviews: [titleLabel, titleIconView])
titleView.alignment = .center titleView.axis = .horizontal
titleView.spacing = 5 titleView.alignment = .center
titleView.isUserInteractionEnabled = true titleView.spacing = 5
titleView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(titleTapped))) titleView.isUserInteractionEnabled = true
navigationItem.titleView = titleView titleView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(titleTapped)))
navigationItem.titleView = titleView
} else {
navigationItem.title = photoCollection.localizedTitle()
}
let featureFlag_isMultiselectEnabled = true let featureFlag_isMultiselectEnabled = true
if featureFlag_isMultiselectEnabled { if featureFlag_isMultiselectEnabled {
@ -242,7 +246,11 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat
photoCollection = collection photoCollection = collection
photoCollectionContents = photoCollection.contents() photoCollectionContents = photoCollection.contents()
titleLabel.text = photoCollection.localizedTitle() if #available(iOS 11, *) {
titleLabel.text = photoCollection.localizedTitle()
} else {
navigationItem.title = photoCollection.localizedTitle()
}
collectionView?.reloadData() collectionView?.reloadData()
} }

@ -37,22 +37,26 @@ class PhotoCollectionPickerController: OWSTableViewController, PhotoLibraryDeleg
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
let titleLabel = UILabel() if #available(iOS 11, *) {
titleLabel.text = previousPhotoCollection.localizedTitle() let titleLabel = UILabel()
titleLabel.textColor = Theme.primaryColor titleLabel.text = previousPhotoCollection.localizedTitle()
titleLabel.font = UIFont.ows_dynamicTypeBody.ows_mediumWeight() titleLabel.textColor = Theme.primaryColor
titleLabel.font = UIFont.ows_dynamicTypeBody.ows_mediumWeight()
let titleIconView = UIImageView()
titleIconView.tintColor = Theme.primaryColor let titleIconView = UIImageView()
titleIconView.image = UIImage(named: "navbar_disclosure_up")?.withRenderingMode(.alwaysTemplate) titleIconView.tintColor = Theme.primaryColor
titleIconView.image = UIImage(named: "navbar_disclosure_up")?.withRenderingMode(.alwaysTemplate)
let titleView = UIStackView(arrangedSubviews: [titleLabel, titleIconView])
titleView.axis = .horizontal let titleView = UIStackView(arrangedSubviews: [titleLabel, titleIconView])
titleView.alignment = .center titleView.axis = .horizontal
titleView.spacing = 5 titleView.alignment = .center
titleView.isUserInteractionEnabled = true titleView.spacing = 5
titleView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(titleTapped))) titleView.isUserInteractionEnabled = true
navigationItem.titleView = titleView titleView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(titleTapped)))
navigationItem.titleView = titleView
} else {
navigationItem.title = previousPhotoCollection.localizedTitle()
}
library.add(delegate: self) library.add(delegate: self)

Loading…
Cancel
Save