From 777e2b92510333b4ccd9ba4097fa8b8e2f0d8a36 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 7 Nov 2018 12:26:57 -0500 Subject: [PATCH] Rename to media album. --- Signal.xcodeproj/project.pbxproj | 8 ++--- ...ellView.swift => MediaAlbumCellView.swift} | 32 +++++++++---------- .../Cells/OWSMessageBubbleView.m | 18 +++++------ 3 files changed, 29 insertions(+), 29 deletions(-) rename Signal/src/ViewControllers/ConversationView/Cells/{MediaAlbumGalleryCellView.swift => MediaAlbumCellView.swift} (87%) diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index c329a8bbd..3aa8448ec 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -156,7 +156,7 @@ 3496744F2076ACD000080B5F /* LongTextViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3496744E2076ACCE00080B5F /* LongTextViewController.swift */; }; 349EA07C2162AEA800F7B17F /* OWS111UDAttributesMigration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 349EA07B2162AEA700F7B17F /* OWS111UDAttributesMigration.swift */; }; 34A55F3720485465002CC6DE /* OWS2FARegistrationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A55F3520485464002CC6DE /* OWS2FARegistrationViewController.m */; }; - 34A8B3512190A40E00218A25 /* MediaAlbumGalleryCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A8B3502190A40E00218A25 /* MediaAlbumGalleryCellView.swift */; }; + 34A8B3512190A40E00218A25 /* MediaAlbumCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A8B3502190A40E00218A25 /* MediaAlbumCellView.swift */; }; 34A910601FFEB114000C4745 /* OWSBackup.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A9105F1FFEB114000C4745 /* OWSBackup.m */; }; 34ABB2C42090C59700C727A6 /* OWSResaveCollectionDBMigration.m in Sources */ = {isa = PBXBuildFile; fileRef = 34ABB2C22090C59600C727A6 /* OWSResaveCollectionDBMigration.m */; }; 34ABB2C52090C59700C727A6 /* OWSResaveCollectionDBMigration.h in Headers */ = {isa = PBXBuildFile; fileRef = 34ABB2C32090C59700C727A6 /* OWSResaveCollectionDBMigration.h */; }; @@ -805,7 +805,7 @@ 349EA07B2162AEA700F7B17F /* OWS111UDAttributesMigration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OWS111UDAttributesMigration.swift; sourceTree = ""; }; 34A55F3520485464002CC6DE /* OWS2FARegistrationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWS2FARegistrationViewController.m; sourceTree = ""; }; 34A55F3620485464002CC6DE /* OWS2FARegistrationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWS2FARegistrationViewController.h; sourceTree = ""; }; - 34A8B3502190A40E00218A25 /* MediaAlbumGalleryCellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaAlbumGalleryCellView.swift; sourceTree = ""; }; + 34A8B3502190A40E00218A25 /* MediaAlbumCellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaAlbumCellView.swift; sourceTree = ""; }; 34A9105E1FFEB113000C4745 /* OWSBackup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSBackup.h; sourceTree = ""; }; 34A9105F1FFEB114000C4745 /* OWSBackup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSBackup.m; sourceTree = ""; }; 34ABB2C22090C59600C727A6 /* OWSResaveCollectionDBMigration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSResaveCollectionDBMigration.m; sourceTree = ""; }; @@ -1830,7 +1830,7 @@ 3488F9352191CC4000E524CC /* ConversationMediaView.swift */, 34D1F0961F867BFC0066283D /* ConversationViewCell.h */, 34D1F0971F867BFC0066283D /* ConversationViewCell.m */, - 34A8B3502190A40E00218A25 /* MediaAlbumGalleryCellView.swift */, + 34A8B3502190A40E00218A25 /* MediaAlbumCellView.swift */, 34D1F0B81F8800D90066283D /* OWSAudioMessageView.h */, 34D1F0B91F8800D90066283D /* OWSAudioMessageView.m */, 34DBF005206C3CB100025978 /* OWSBubbleShapeView.h */, @@ -3369,7 +3369,7 @@ 3403B95D20EA9527001A1F44 /* OWSContactShareButtonsView.m in Sources */, 34B0796D1FCF46B100E248C2 /* MainAppContext.m in Sources */, 34E3EF101EFC2684007F6822 /* DebugUIPage.m in Sources */, - 34A8B3512190A40E00218A25 /* MediaAlbumGalleryCellView.swift in Sources */, + 34A8B3512190A40E00218A25 /* MediaAlbumCellView.swift in Sources */, 340FC8CD20518C77007AEB0F /* OWSBackupJob.m in Sources */, 34D1F0AE1F867BFC0066283D /* OWSMessageCell.m in Sources */, 4C4AEC4520EC343B0020E72B /* DismissableTextField.swift in Sources */, diff --git a/Signal/src/ViewControllers/ConversationView/Cells/MediaAlbumGalleryCellView.swift b/Signal/src/ViewControllers/ConversationView/Cells/MediaAlbumCellView.swift similarity index 87% rename from Signal/src/ViewControllers/ConversationView/Cells/MediaAlbumGalleryCellView.swift rename to Signal/src/ViewControllers/ConversationView/Cells/MediaAlbumCellView.swift index 7b47485c3..dca34997d 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/MediaAlbumGalleryCellView.swift +++ b/Signal/src/ViewControllers/ConversationView/Cells/MediaAlbumCellView.swift @@ -4,8 +4,8 @@ import Foundation -@objc(OWSMediaAlbumGalleryCellView) -public class MediaAlbumGalleryCellView: UIStackView { +@objc(OWSMediaAlbumCellView) +public class MediaAlbumCellView: UIStackView { private let items: [ConversationMediaAlbumItem] @objc @@ -24,7 +24,7 @@ public class MediaAlbumGalleryCellView: UIStackView { items: [ConversationMediaAlbumItem], maxMessageWidth: CGFloat) { self.items = items - self.itemViews = MediaAlbumGalleryCellView.itemsToDisplay(forItems: items).map { + self.itemViews = MediaAlbumCellView.itemsToDisplay(forItems: items).map { ConversationMediaView(mediaCache: mediaCache, attachment: $0.attachment) } @@ -55,19 +55,19 @@ public class MediaAlbumGalleryCellView: UIStackView { case 2: // X X // side-by-side. - let imageSize = (maxMessageWidth - MediaAlbumGalleryCellView.kSpacingPts) / 2 + let imageSize = (maxMessageWidth - MediaAlbumCellView.kSpacingPts) / 2 autoSet(viewSize: imageSize, ofViews: itemViews) for itemView in itemViews { addArrangedSubview(itemView) } self.axis = .horizontal - self.spacing = MediaAlbumGalleryCellView.kSpacingPts + self.spacing = MediaAlbumCellView.kSpacingPts case 3: // x // X x // Big on left, 2 small on right. - let smallImageSize = (maxMessageWidth - MediaAlbumGalleryCellView.kSpacingPts * 2) / 3 - let bigImageSize = smallImageSize * 2 + MediaAlbumGalleryCellView.kSpacingPts + let smallImageSize = (maxMessageWidth - MediaAlbumCellView.kSpacingPts * 2) / 3 + let bigImageSize = smallImageSize * 2 + MediaAlbumCellView.kSpacingPts guard let leftItemView = itemViews.first else { owsFailDebug("Missing view") @@ -81,12 +81,12 @@ public class MediaAlbumGalleryCellView: UIStackView { axis: .vertical, viewSize: smallImageSize)) self.axis = .horizontal - self.spacing = MediaAlbumGalleryCellView.kSpacingPts + self.spacing = MediaAlbumCellView.kSpacingPts case 4: // X X // X X // Square - let imageSize = (maxMessageWidth - MediaAlbumGalleryCellView.kSpacingPts) / 2 + let imageSize = (maxMessageWidth - MediaAlbumCellView.kSpacingPts) / 2 let topViews = Array(itemViews[0..<2]) addArrangedSubview(newRow(rowViews: topViews, @@ -99,13 +99,13 @@ public class MediaAlbumGalleryCellView: UIStackView { viewSize: imageSize)) self.axis = .vertical - self.spacing = MediaAlbumGalleryCellView.kSpacingPts + self.spacing = MediaAlbumCellView.kSpacingPts default: // X X // xxx // 2 big on top, 3 small on bottom. - let bigImageSize = (maxMessageWidth - MediaAlbumGalleryCellView.kSpacingPts) / 2 - let smallImageSize = (maxMessageWidth - MediaAlbumGalleryCellView.kSpacingPts * 2) / 3 + let bigImageSize = (maxMessageWidth - MediaAlbumCellView.kSpacingPts) / 2 + let smallImageSize = (maxMessageWidth - MediaAlbumCellView.kSpacingPts * 2) / 3 let topViews = Array(itemViews[0..<2]) addArrangedSubview(newRow(rowViews: topViews, @@ -118,9 +118,9 @@ public class MediaAlbumGalleryCellView: UIStackView { viewSize: smallImageSize)) self.axis = .vertical - self.spacing = MediaAlbumGalleryCellView.kSpacingPts + self.spacing = MediaAlbumCellView.kSpacingPts - if items.count > MediaAlbumGalleryCellView.kMaxItems { + if items.count > MediaAlbumCellView.kMaxItems { guard let lastView = bottomViews.last else { owsFailDebug("Missing lastView") return @@ -133,7 +133,7 @@ public class MediaAlbumGalleryCellView: UIStackView { lastView.addSubview(tintView) tintView.autoPinEdgesToSuperviewEdges() - let moreCount = max(1, items.count - MediaAlbumGalleryCellView.kMaxItems) + let moreCount = max(1, items.count - MediaAlbumCellView.kMaxItems) let moreCountText = OWSFormat.formatInt(Int32(moreCount)) let moreText = String(format: NSLocalizedString("MEDIA_GALLERY_MORE_ITEMS_FORMAT", comment: "Format for the 'more items' indicator for media galleries. Embeds {{the number of additional items}}."), moreCountText) @@ -195,7 +195,7 @@ public class MediaAlbumGalleryCellView: UIStackView { axis: UILayoutConstraintAxis) -> UIStackView { let stackView = UIStackView(arrangedSubviews: rowViews) stackView.axis = axis - stackView.spacing = MediaAlbumGalleryCellView.kSpacingPts + stackView.spacing = MediaAlbumCellView.kSpacingPts return stackView } diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m index 32c3e157f..37b2198fc 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m @@ -784,15 +784,15 @@ const UIDataDetectorTypes kOWSAllowedDataDetectorTypes { OWSAssertDebug(self.viewItem.mediaAlbumItems); - OWSMediaAlbumGalleryCellView *galleryView = - [[OWSMediaAlbumGalleryCellView alloc] initWithMediaCache:self.cellMediaCache - items:self.viewItem.mediaAlbumItems - maxMessageWidth:self.conversationStyle.maxMessageWidth]; + OWSMediaAlbumCellView *albumView = + [[OWSMediaAlbumCellView alloc] initWithMediaCache:self.cellMediaCache + items:self.viewItem.mediaAlbumItems + maxMessageWidth:self.conversationStyle.maxMessageWidth]; self.loadCellContentBlock = ^{ - [galleryView loadMedia]; + [albumView loadMedia]; }; self.unloadCellContentBlock = ^{ - [galleryView unloadMedia]; + [albumView unloadMedia]; }; for (UIView *itemView in galleryView.itemViews) { OWSBubbleShapeView *strokeView = [[OWSBubbleShapeView alloc] initDraw]; @@ -803,7 +803,7 @@ const UIDataDetectorTypes kOWSAllowedDataDetectorTypes [self.viewConstraints addObjectsFromArray:[strokeView ows_autoPinToSuperviewEdges]]; } - return galleryView; + return albumView; } - (UIView *)loadViewForMedia @@ -1051,8 +1051,8 @@ const UIDataDetectorTypes kOWSAllowedDataDetectorTypes result = CGSizeMake(maxMessageWidth, [OWSContactShareView bubbleHeight]); break; case OWSMessageCellType_MediaAlbum: - result = [OWSMediaAlbumGalleryCellView layoutSizeForMaxMessageWidth:maxMessageWidth - items:self.viewItem.mediaAlbumItems]; + result = [OWSMediaAlbumCellView layoutSizeForMaxMessageWidth:maxMessageWidth + items:self.viewItem.mediaAlbumItems]; break; }