Rename to media album.
This commit is contained in:
parent
2dfd4b2c0d
commit
777e2b9251
|
@ -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 = "<group>"; };
|
||||
34A55F3520485464002CC6DE /* OWS2FARegistrationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWS2FARegistrationViewController.m; sourceTree = "<group>"; };
|
||||
34A55F3620485464002CC6DE /* OWS2FARegistrationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWS2FARegistrationViewController.h; sourceTree = "<group>"; };
|
||||
34A8B3502190A40E00218A25 /* MediaAlbumGalleryCellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaAlbumGalleryCellView.swift; sourceTree = "<group>"; };
|
||||
34A8B3502190A40E00218A25 /* MediaAlbumCellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaAlbumCellView.swift; sourceTree = "<group>"; };
|
||||
34A9105E1FFEB113000C4745 /* OWSBackup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSBackup.h; sourceTree = "<group>"; };
|
||||
34A9105F1FFEB114000C4745 /* OWSBackup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSBackup.m; sourceTree = "<group>"; };
|
||||
34ABB2C22090C59600C727A6 /* OWSResaveCollectionDBMigration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSResaveCollectionDBMigration.m; sourceTree = "<group>"; };
|
||||
|
@ -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 */,
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue