From 92de74552847d295f6e9787b8aba21b7a518287b Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Sun, 19 Aug 2018 00:59:20 +0200 Subject: [PATCH 1/2] theme gallery section headers // FREEBIE --- Signal/src/ViewControllers/MediaGalleryViewController.swift | 2 +- Signal/src/ViewControllers/MediaTileViewController.swift | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Signal/src/ViewControllers/MediaGalleryViewController.swift b/Signal/src/ViewControllers/MediaGalleryViewController.swift index 6a63a548e..e33d8fdeb 100644 --- a/Signal/src/ViewControllers/MediaGalleryViewController.swift +++ b/Signal/src/ViewControllers/MediaGalleryViewController.swift @@ -35,7 +35,7 @@ public struct MediaGalleryItem: Equatable, Hashable { var thumbnailImage: UIImage { guard let image = attachmentStream.thumbnailImage() else { - owsFail("\(logTag) in \(#function) unexpectedly unable to build attachment thumbnail") +// owsFail("\(logTag) in \(#function) unexpectedly unable to build attachment thumbnail") return UIImage() } diff --git a/Signal/src/ViewControllers/MediaTileViewController.swift b/Signal/src/ViewControllers/MediaTileViewController.swift index 0a6366e53..a76c91c01 100644 --- a/Signal/src/ViewControllers/MediaTileViewController.swift +++ b/Signal/src/ViewControllers/MediaTileViewController.swift @@ -770,14 +770,17 @@ private class MediaGallerySectionHeader: UICollectionReusableView { override init(frame: CGRect) { label = UILabel() + label.textColor = Theme.primaryColor - let blurEffect = UIBlurEffect(style: .extraLight) + let blurEffect = Theme.barBlurEffect let blurEffectView = UIVisualEffectView(effect: blurEffect) blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight] super.init(frame: frame) + self.backgroundColor = Theme.navbarBackgroundColor.withAlphaComponent(OWSNavigationBar.backgroundBlurMutingFactor) + self.addSubview(blurEffectView) self.addSubview(label) @@ -814,6 +817,7 @@ private class MediaGalleryStaticHeader: UICollectionViewCell { addSubview(label) + label.textColor = Theme.primaryColor label.textAlignment = .center label.numberOfLines = 0 label.autoPinEdgesToSuperviewMargins() From 8cd290ba2be9e9f7aee6ac7e2e089bf09a4b17f1 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Sun, 19 Aug 2018 01:15:09 +0200 Subject: [PATCH 2/2] fix section headers not appearing on iOS11/iPhoneX // FREEBIE --- Signal/src/ViewControllers/MediaGalleryViewController.swift | 2 +- Signal/src/ViewControllers/MediaTileViewController.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Signal/src/ViewControllers/MediaGalleryViewController.swift b/Signal/src/ViewControllers/MediaGalleryViewController.swift index e33d8fdeb..6a63a548e 100644 --- a/Signal/src/ViewControllers/MediaGalleryViewController.swift +++ b/Signal/src/ViewControllers/MediaGalleryViewController.swift @@ -35,7 +35,7 @@ public struct MediaGalleryItem: Equatable, Hashable { var thumbnailImage: UIImage { guard let image = attachmentStream.thumbnailImage() else { -// owsFail("\(logTag) in \(#function) unexpectedly unable to build attachment thumbnail") + owsFail("\(logTag) in \(#function) unexpectedly unable to build attachment thumbnail") return UIImage() } diff --git a/Signal/src/ViewControllers/MediaTileViewController.swift b/Signal/src/ViewControllers/MediaTileViewController.swift index a76c91c01..7cfc9f1ee 100644 --- a/Signal/src/ViewControllers/MediaTileViewController.swift +++ b/Signal/src/ViewControllers/MediaTileViewController.swift @@ -8,7 +8,7 @@ public protocol MediaTileViewControllerDelegate: class { func mediaTileViewController(_ viewController: MediaTileViewController, didTapView tappedView: UIView, mediaGalleryItem: MediaGalleryItem) } -public class MediaTileViewController: UICollectionViewController, MediaGalleryDataSourceDelegate { +public class MediaTileViewController: UICollectionViewController, MediaGalleryDataSourceDelegate, UICollectionViewDelegateFlowLayout { private weak var mediaGalleryDataSource: MediaGalleryDataSource?