Skip to content

Commit ff6bff2

Browse files
committed
Display photos stacked
1 parent 23ab69d commit ff6bff2

23 files changed

Lines changed: 1081 additions & 99 deletions

Mixin.xcodeproj/project.pbxproj

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,12 @@
630630
7CB227862907CE060034F9FD /* DepositNetworkCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CB227842907CE060034F9FD /* DepositNetworkCell.swift */; };
631631
7CB227872907CE060034F9FD /* DepositNetworkCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7CB227852907CE060034F9FD /* DepositNetworkCell.xib */; };
632632
7CB2A57F27C386F0007D9DEE /* GroupsInCommonViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CB2A57E27C386F0007D9DEE /* GroupsInCommonViewController.swift */; };
633+
7CBB77D8298B865E00E01F19 /* StackedPhotoMessageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CBB77D7298B865E00E01F19 /* StackedPhotoMessageCell.swift */; };
634+
7CBB77DA298B94D900E01F19 /* StackedPhotoLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CBB77D9298B94D900E01F19 /* StackedPhotoLayout.swift */; };
635+
7CBB77DC298B979900E01F19 /* StackedPhotoMessageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CBB77DB298B979900E01F19 /* StackedPhotoMessageViewModel.swift */; };
636+
7CBB77DE298B97EF00E01F19 /* StackedPhotoPreviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CBB77DD298B97EF00E01F19 /* StackedPhotoPreviewViewController.swift */; };
637+
7CBB77E0298B9AB700E01F19 /* StackedPhotoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CBB77DF298B9AB700E01F19 /* StackedPhotoCell.swift */; };
638+
7CBB77E2298B9ADF00E01F19 /* StackedPhotoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CBB77E1298B9ADF00E01F19 /* StackedPhotoView.swift */; };
633639
7CBD2EFA268FF6BB00AA0847 /* HomeAppsStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CBD2EF9268FF6BB00AA0847 /* HomeAppsStorage.swift */; };
634640
7CC3B1A026C21F7E0018B0D1 /* ScriptMessageProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CC3B19F26C21F7E0018B0D1 /* ScriptMessageProxy.swift */; };
635641
7CC730502745F95D002780F5 /* StickerStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CC7304F2745F95D002780F5 /* StickerStore.swift */; };
@@ -1663,6 +1669,12 @@
16631669
7CB227842907CE060034F9FD /* DepositNetworkCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DepositNetworkCell.swift; sourceTree = "<group>"; };
16641670
7CB227852907CE060034F9FD /* DepositNetworkCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DepositNetworkCell.xib; sourceTree = "<group>"; };
16651671
7CB2A57E27C386F0007D9DEE /* GroupsInCommonViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupsInCommonViewController.swift; sourceTree = "<group>"; };
1672+
7CBB77D7298B865E00E01F19 /* StackedPhotoMessageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StackedPhotoMessageCell.swift; sourceTree = "<group>"; };
1673+
7CBB77D9298B94D900E01F19 /* StackedPhotoLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StackedPhotoLayout.swift; sourceTree = "<group>"; };
1674+
7CBB77DB298B979900E01F19 /* StackedPhotoMessageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StackedPhotoMessageViewModel.swift; sourceTree = "<group>"; };
1675+
7CBB77DD298B97EF00E01F19 /* StackedPhotoPreviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StackedPhotoPreviewViewController.swift; sourceTree = "<group>"; };
1676+
7CBB77DF298B9AB700E01F19 /* StackedPhotoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StackedPhotoCell.swift; sourceTree = "<group>"; };
1677+
7CBB77E1298B9ADF00E01F19 /* StackedPhotoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StackedPhotoView.swift; sourceTree = "<group>"; };
16661678
7CBD2EF9268FF6BB00AA0847 /* HomeAppsStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeAppsStorage.swift; sourceTree = "<group>"; };
16671679
7CC3B19F26C21F7E0018B0D1 /* ScriptMessageProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScriptMessageProxy.swift; sourceTree = "<group>"; };
16681680
7CC7304F2745F95D002780F5 /* StickerStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerStore.swift; sourceTree = "<group>"; };
@@ -2261,6 +2273,8 @@
22612273
94D63DD52646C29100FD7EE8 /* MessageViewModelFactory.swift */,
22622274
7CC7304F2745F95D002780F5 /* StickerStore.swift */,
22632275
7CF7416D27DAD93000DA0004 /* SnapCenterFlowLayout.swift */,
2276+
7CBB77D9298B94D900E01F19 /* StackedPhotoLayout.swift */,
2277+
7CBB77DB298B979900E01F19 /* StackedPhotoMessageViewModel.swift */,
22642278
);
22652279
path = Model;
22662280
sourceTree = "<group>";
@@ -2920,6 +2934,7 @@
29202934
7C14CFBF26CA35CF0094AF4A /* StaticMessagesViewController.swift */,
29212935
94FCB5FE264673C400CCC8FD /* TranscriptPreviewViewController.swift */,
29222936
7CB0955226CD18F70049F4C7 /* PinMessagesPreviewViewController.swift */,
2937+
7CBB77DD298B97EF00E01F19 /* StackedPhotoPreviewViewController.swift */,
29232938
);
29242939
path = Chat;
29252940
sourceTree = "<group>";
@@ -3455,6 +3470,8 @@
34553470
7C14CFC026CA35CF0094AF4A /* StaticMessagesView.xib */,
34563471
7C359DCF26A6C173001D3AE4 /* StickerStoreBannerView.swift */,
34573472
7C2DE55828DD94D200C00818 /* LiveTextImageView.swift */,
3473+
7CBB77DF298B9AB700E01F19 /* StackedPhotoCell.swift */,
3474+
7CBB77E1298B9ADF00E01F19 /* StackedPhotoView.swift */,
34583475
);
34593476
path = Views;
34603477
sourceTree = "<group>";
@@ -3642,6 +3659,7 @@
36423659
7BA1768D244ACE2E007D50FD /* PickerCell.swift */,
36433660
7B3CDA6324FFDD1D003A3E80 /* FavoriteStickerCell.swift */,
36443661
7CE4BA27283CD2C9001C87D5 /* SelectedMediaCell.swift */,
3662+
7CBB77D7298B865E00E01F19 /* StackedPhotoMessageCell.swift */,
36453663
);
36463664
path = Cells;
36473665
sourceTree = "<group>";
@@ -4696,6 +4714,7 @@
46964714
7B915F74215FB0C100A562C6 /* GiphySearchViewController.swift in Sources */,
46974715
7B7DACA623505793006AA2AC /* AudioCell.swift in Sources */,
46984716
5E5CA86D2674B09100C1E113 /* ScreenLockSettingViewController.swift in Sources */,
4717+
7CBB77DE298B97EF00E01F19 /* StackedPhotoPreviewViewController.swift in Sources */,
46994718
DF5D9F251F9C79E10036D5FD /* LocalizedExtension.swift in Sources */,
47004719
7B4FCCE02440A66600360F65 /* SolidBackgroundColorImageView.swift in Sources */,
47014720
DF1A2C60219BCACC004EFD68 /* ClockSkewViewController.swift in Sources */,
@@ -4750,6 +4769,7 @@
47504769
7BEEC0121FDEA19300514A48 /* EncryptionHintViewModel.swift in Sources */,
47514770
E0D4F5F523A9D803008F0189 /* NotificationManager.swift in Sources */,
47524771
7BADC842204C20820016B0FC /* ChangeNumberVerificationCodeViewController.swift in Sources */,
4772+
7CBB77E2298B9ADF00E01F19 /* StackedPhotoView.swift in Sources */,
47534773
7CB2A57F27C386F0007D9DEE /* GroupsInCommonViewController.swift in Sources */,
47544774
7C66F029268A0384006D8462 /* AppPageCell.swift in Sources */,
47554775
7B2A116122C20F5F00AD029C /* PlayerView.swift in Sources */,
@@ -4891,12 +4911,14 @@
48914911
7B894AF5205BFC9B0065A1B8 /* NewAddressViewController.swift in Sources */,
48924912
7BB5250324160F3D0060DAE1 /* LocationPreviewViewController.swift in Sources */,
48934913
7BDEE5C71FA72EB9004CB189 /* SearchViewController.swift in Sources */,
4914+
7CBB77D8298B865E00E01F19 /* StackedPhotoMessageCell.swift in Sources */,
48944915
7BF4047B2048F008004C54E4 /* VerifyPinNavigationController.swift in Sources */,
48954916
DF2A245E1FCC5D15003A8C1E /* GroupAddMemberCell.swift in Sources */,
48964917
DFB6CE1E23C4805B00FB6615 /* KeychainExtension.swift in Sources */,
48974918
7B2E3E5A1FA0816D00DDDDEB /* LoginContinueButton.swift in Sources */,
48984919
5E3725BA268D4E0400269FE7 /* HomeAppsSnapshotView.swift in Sources */,
48994920
277FF7031F909A1200DBB2EB /* AppDelegate.swift in Sources */,
4921+
7CBB77DC298B979900E01F19 /* StackedPhotoMessageViewModel.swift in Sources */,
49004922
7B2E3E4D1FA07F5D00DDDDEB /* HairlineLayoutConstraint.swift in Sources */,
49014923
94DF7E0E28DC1697006E415B /* AcknowledgementViewController.swift in Sources */,
49024924
7B4ADAA7243C7C8400F04CA6 /* HomeAppsViewController.swift in Sources */,
@@ -4951,6 +4973,7 @@
49514973
7B333A8623406AD000FDA848 /* GalleryTransitionFromMessageCellView.swift in Sources */,
49524974
7B54F95922B243EA00908A9D /* EmergencyContactVerifyPinViewController.swift in Sources */,
49534975
7B68F78B2191741300B79978 /* BiometryType.swift in Sources */,
4976+
7CBB77DA298B94D900E01F19 /* StackedPhotoLayout.swift in Sources */,
49544977
7BD0532820A41F6A00C36F69 /* RangeExtension.swift in Sources */,
49554978
7BC022E5214A13DC00B7A398 /* AuthorizationsViewController.swift in Sources */,
49564979
7C1EDAB42772FF8B00193917 /* VerifyNumberContext.swift in Sources */,
@@ -5138,6 +5161,7 @@
51385161
7C9A734027392FAF00E0127A /* PinSettingTableHeaderView.swift in Sources */,
51395162
7C4E2B0426A9BDAD008190F5 /* StickersEditingViewController.swift in Sources */,
51405163
7B5E9B4C2437434D000AE24E /* CircleEditingButton.swift in Sources */,
5164+
7CBB77E0298B9AB700E01F19 /* StackedPhotoCell.swift in Sources */,
51415165
7B4CBDC22528533600BA66D0 /* ClipSwitcher.swift in Sources */,
51425166
7CB17B642771602A00CF4C94 /* DeleteAccountConfirmWindow.swift in Sources */,
51435167
7BFE47E52284530200FC4379 /* PeerHeaderView.swift in Sources */,
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import UIKit
2+
3+
class StackedPhotoMessageCell: ImageMessageCell {
4+
5+
static let contentCornerRadius: CGFloat = 13
6+
7+
private let stackedPhotoView = StackedPhotoView()
8+
9+
override func prepareForReuse() {
10+
super.prepareForReuse()
11+
stackedPhotoView.viewModels = []
12+
}
13+
14+
override func render(viewModel: MessageViewModel) {
15+
super.render(viewModel: viewModel)
16+
if let viewModel = viewModel as? StackedPhotoMessageViewModel {
17+
stackedPhotoView.viewModels = viewModel.photoMessageViewModels
18+
stackedPhotoView.frame = viewModel.stackedPhotoViewFrame
19+
selectedOverlapView.frame = viewModel.photoFrame
20+
trailingInfoBackgroundView.frame = viewModel.trailingInfoBackgroundFrame
21+
}
22+
}
23+
24+
override func prepare() {
25+
messageContentView.addSubview(stackedPhotoView)
26+
updateAppearance(highlight: false, animated: false)
27+
messageContentView.addSubview(trailingInfoBackgroundView)
28+
super.prepare()
29+
selectedOverlapView.layer.cornerRadius = Self.contentCornerRadius
30+
backgroundImageView.removeFromSuperview()
31+
stackedPhotoView.backgroundColor = .clear
32+
statusImageView.alpha = 0.9
33+
}
34+
35+
}

0 commit comments

Comments
 (0)