diff --git a/Mixin.xcodeproj/project.pbxproj b/Mixin.xcodeproj/project.pbxproj index 0cfd3852bd..41a35925e6 100644 --- a/Mixin.xcodeproj/project.pbxproj +++ b/Mixin.xcodeproj/project.pbxproj @@ -551,12 +551,6 @@ 7C104A8127D83A51004D0530 /* RefreshExternalSchemeJob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C104A8027D83A51004D0530 /* RefreshExternalSchemeJob.swift */; }; 7C11E349281BF4BC00D3362B /* ic_time_animation@2x.gif in Resources */ = {isa = PBXBuildFile; fileRef = 7C11E347281BF4BC00D3362B /* ic_time_animation@2x.gif */; }; 7C11E34A281BF4BC00D3362B /* ic_time_animation_dark@2x.gif in Resources */ = {isa = PBXBuildFile; fileRef = 7C11E348281BF4BC00D3362B /* ic_time_animation_dark@2x.gif */; }; - 7C0E16A52702A9EF002FC718 /* CollectibleResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C0E16A42702A9EF002FC718 /* CollectibleResponse.swift */; }; - 7C0E16A72702AF22002FC718 /* CollectibleAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C0E16A62702AF22002FC718 /* CollectibleAPI.swift */; }; - 7C0E16A92702FB85002FC718 /* CollectibleToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C0E16A82702FB85002FC718 /* CollectibleToken.swift */; }; - 7C0E1D0D2786EAC900762FBE /* SnappingFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C0E1D0C2786EAC900762FBE /* SnappingFlowLayout.swift */; }; - 7C13BF76279EA4E90027FF25 /* StackedPhotoMessageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C13BF75279EA4E90027FF25 /* StackedPhotoMessageCell.swift */; }; - 7C148ED227A3E7FA00599E76 /* StackedPhotoPreviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C148ED127A3E7FA00599E76 /* StackedPhotoPreviewViewController.swift */; }; 7C14CFC126CA35CF0094AF4A /* StaticMessagesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C14CFBF26CA35CF0094AF4A /* StaticMessagesViewController.swift */; }; 7C14CFC226CA35CF0094AF4A /* StaticMessagesView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7C14CFC026CA35CF0094AF4A /* StaticMessagesView.xib */; }; 7C1A6C4326C6580600A1D6CE /* StickerPreviewItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C1A6C4226C6580600A1D6CE /* StickerPreviewItemCell.swift */; }; @@ -567,11 +561,6 @@ 7C2ACDAE27D73F7C00E9DDB3 /* LeftAlignedCollectionViewFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C2ACDAD27D73F7C00E9DDB3 /* LeftAlignedCollectionViewFlowLayout.swift */; }; 7C2DEFF12824FCF500758208 /* ic_time_animation_dark@3x.gif in Resources */ = {isa = PBXBuildFile; fileRef = 7C2DEFF02824FCF500758208 /* ic_time_animation_dark@3x.gif */; }; 7C2DEFF32824FF0600758208 /* ic_time_animation@3x.gif in Resources */ = {isa = PBXBuildFile; fileRef = 7C2DEFF22824FF0600758208 /* ic_time_animation@3x.gif */; }; - 7C247AA5277AED6800112A30 /* StackedPhotoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C247AA4277AED6800112A30 /* StackedPhotoView.swift */; }; - 7C247AA7277AEDD100112A30 /* StackedPhotoLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C247AA6277AEDD100112A30 /* StackedPhotoLayout.swift */; }; - 7C247AA9277AF2DA00112A30 /* StackedPhotoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C247AA8277AF2DA00112A30 /* StackedPhotoCell.swift */; }; - 7C247C67277C0DC100112A30 /* BadgeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C247C66277C0DC100112A30 /* BadgeView.swift */; }; - 7C2ACDAE27D73F7C00E9DDB3 /* LeftAlignedCollectionViewFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C2ACDAD27D73F7C00E9DDB3 /* LeftAlignedCollectionViewFlowLayout.swift */; }; 7C359DCE26A6C15A001D3AE4 /* StickerStorePreviewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C359DCD26A6C15A001D3AE4 /* StickerStorePreviewCell.swift */; }; 7C359DD026A6C173001D3AE4 /* StickerStoreBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C359DCF26A6C173001D3AE4 /* StickerStoreBannerView.swift */; }; 7C36BE88274F248C00089B6D /* StickerStoreBannerCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C36BE87274F248C00089B6D /* StickerStoreBannerCell.swift */; }; @@ -622,10 +611,10 @@ 7CF5929627979CBB00015495 /* DeleteAccountVerifyPinWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CF5929527979CBB00015495 /* DeleteAccountVerifyPinWindow.swift */; }; 7CF5929827979CCF00015495 /* DeleteAccountVerifyPinWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7CF5929727979CCF00015495 /* DeleteAccountVerifyPinWindow.xib */; }; 7CF7416E27DAD93000DA0004 /* SnapCenterFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CF7416D27DAD93000DA0004 /* SnapCenterFlowLayout.swift */; }; - 7CF9503F277D8839000AECC7 /* MediasPreviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CF9503E277D8839000AECC7 /* MediasPreviewViewController.swift */; }; + 7CF9503F277D8839000AECC7 /* SelectedPhotoInputItemsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CF9503E277D8839000AECC7 /* SelectedPhotoInputItemsViewController.swift */; }; 7CF95041277D8904000AECC7 /* SelectedMediaCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CF95040277D8904000AECC7 /* SelectedMediaCell.swift */; }; - 7CFF1387277D5C3400FA745D /* MediasPreviewWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CFF1386277D5C3400FA745D /* MediasPreviewWindow.swift */; }; - 7CFF1389277D5C6600FA745D /* MediasPreviewWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7CFF1388277D5C6600FA745D /* MediasPreviewWindow.xib */; }; + 7CFF1387277D5C3400FA745D /* SelectedPhotoInputItemsPreviewWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CFF1386277D5C3400FA745D /* SelectedPhotoInputItemsPreviewWindow.swift */; }; + 7CFF1389277D5C6600FA745D /* SelectedPhotoInputItemsPreviewWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7CFF1388277D5C6600FA745D /* SelectedPhotoInputItemsPreviewWindow.xib */; }; 811C8154F03C8CBB72DBA1F4 /* Pods_MixinShare.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 67A8E0E9B65F16ADB27E6F25 /* Pods_MixinShare.framework */; }; 842347EE2695BA6400009A39 /* InitializeBotJob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842347ED2695BA6400009A39 /* InitializeBotJob.swift */; }; 94046B91272DC265007C1D4A /* GroupCallMembersDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94046B90272DC265007C1D4A /* GroupCallMembersDataSource.swift */; }; @@ -1546,12 +1535,6 @@ 7C104A8027D83A51004D0530 /* RefreshExternalSchemeJob.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RefreshExternalSchemeJob.swift; sourceTree = ""; }; 7C11E347281BF4BC00D3362B /* ic_time_animation@2x.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = "ic_time_animation@2x.gif"; sourceTree = ""; }; 7C11E348281BF4BC00D3362B /* ic_time_animation_dark@2x.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = "ic_time_animation_dark@2x.gif"; sourceTree = ""; }; - 7C0E16A42702A9EF002FC718 /* CollectibleResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectibleResponse.swift; sourceTree = ""; }; - 7C0E16A62702AF22002FC718 /* CollectibleAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectibleAPI.swift; sourceTree = ""; }; - 7C0E16A82702FB85002FC718 /* CollectibleToken.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectibleToken.swift; sourceTree = ""; }; - 7C0E1D0C2786EAC900762FBE /* SnappingFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SnappingFlowLayout.swift; sourceTree = ""; }; - 7C13BF75279EA4E90027FF25 /* StackedPhotoMessageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StackedPhotoMessageCell.swift; sourceTree = ""; }; - 7C148ED127A3E7FA00599E76 /* StackedPhotoPreviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StackedPhotoPreviewViewController.swift; sourceTree = ""; }; 7C14CFBF26CA35CF0094AF4A /* StaticMessagesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StaticMessagesViewController.swift; sourceTree = ""; }; 7C14CFC026CA35CF0094AF4A /* StaticMessagesView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = StaticMessagesView.xib; sourceTree = ""; }; 7C1A6C4226C6580600A1D6CE /* StickerPreviewItemCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerPreviewItemCell.swift; sourceTree = ""; }; @@ -1562,10 +1545,6 @@ 7C2ACDAD27D73F7C00E9DDB3 /* LeftAlignedCollectionViewFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeftAlignedCollectionViewFlowLayout.swift; sourceTree = ""; }; 7C2DEFF02824FCF500758208 /* ic_time_animation_dark@3x.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = "ic_time_animation_dark@3x.gif"; sourceTree = ""; }; 7C2DEFF22824FF0600758208 /* ic_time_animation@3x.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = "ic_time_animation@3x.gif"; sourceTree = ""; }; - 7C247AA4277AED6800112A30 /* StackedPhotoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StackedPhotoView.swift; sourceTree = ""; }; - 7C247AA6277AEDD100112A30 /* StackedPhotoLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StackedPhotoLayout.swift; sourceTree = ""; }; - 7C247C66277C0DC100112A30 /* BadgeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeView.swift; sourceTree = ""; }; - 7C2ACDAD27D73F7C00E9DDB3 /* LeftAlignedCollectionViewFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeftAlignedCollectionViewFlowLayout.swift; sourceTree = ""; }; 7C359DCD26A6C15A001D3AE4 /* StickerStorePreviewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerStorePreviewCell.swift; sourceTree = ""; }; 7C359DCF26A6C173001D3AE4 /* StickerStoreBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerStoreBannerView.swift; sourceTree = ""; }; 7C36BE87274F248C00089B6D /* StickerStoreBannerCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerStoreBannerCell.swift; sourceTree = ""; }; @@ -1616,10 +1595,10 @@ 7CF5929527979CBB00015495 /* DeleteAccountVerifyPinWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeleteAccountVerifyPinWindow.swift; sourceTree = ""; }; 7CF5929727979CCF00015495 /* DeleteAccountVerifyPinWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DeleteAccountVerifyPinWindow.xib; sourceTree = ""; }; 7CF7416D27DAD93000DA0004 /* SnapCenterFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SnapCenterFlowLayout.swift; sourceTree = ""; }; - 7CF9503E277D8839000AECC7 /* MediasPreviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediasPreviewViewController.swift; sourceTree = ""; }; + 7CF9503E277D8839000AECC7 /* SelectedPhotoInputItemsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectedPhotoInputItemsViewController.swift; sourceTree = ""; }; 7CF95040277D8904000AECC7 /* SelectedMediaCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectedMediaCell.swift; sourceTree = ""; }; - 7CFF1386277D5C3400FA745D /* MediasPreviewWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediasPreviewWindow.swift; sourceTree = ""; }; - 7CFF1388277D5C6600FA745D /* MediasPreviewWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MediasPreviewWindow.xib; sourceTree = ""; }; + 7CFF1386277D5C3400FA745D /* SelectedPhotoInputItemsPreviewWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectedPhotoInputItemsPreviewWindow.swift; sourceTree = ""; }; + 7CFF1388277D5C6600FA745D /* SelectedPhotoInputItemsPreviewWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SelectedPhotoInputItemsPreviewWindow.xib; sourceTree = ""; }; 842347ED2695BA6400009A39 /* InitializeBotJob.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InitializeBotJob.swift; sourceTree = ""; }; 8C43D9D96FCB101481DFD90F /* Pods-Mixin.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mixin.release.xcconfig"; path = "Pods/Target Support Files/Pods-Mixin/Pods-Mixin.release.xcconfig"; sourceTree = ""; }; 94046B90272DC265007C1D4A /* GroupCallMembersDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GroupCallMembersDataSource.swift; sourceTree = ""; }; @@ -2854,7 +2833,7 @@ 7B915F73215FB0C100A562C6 /* GiphySearchViewController.swift */, 7B05CFDC22293B72006DA9E3 /* PhotoInputViewController.swift */, 7B93CAA4222963120053AE90 /* PhotoInputGridViewController.swift */, - 7CF9503E277D8839000AECC7 /* MediasPreviewViewController.swift */, + 7CF9503E277D8839000AECC7 /* SelectedPhotoInputItemsViewController.swift */, 7B6A4045228400AF0037C7E5 /* MessageReceiverViewController.swift */, 7BFD3457228589ED00524EA0 /* ContactSelectorViewController.swift */, 7BEBCE2C228185130037BF18 /* MediaPreviewViewController.swift */, @@ -2963,8 +2942,8 @@ 7CB17B652771608400CF4C94 /* DeleteAccountConfirmWindow.xib */, 7C6132B527953B15002777EE /* DeleteAccountAbortWindow.swift */, 7C6132B727953B4F002777EE /* DeleteAccountAbortWindow.xib */, - 7CFF1386277D5C3400FA745D /* MediasPreviewWindow.swift */, - 7CFF1388277D5C6600FA745D /* MediasPreviewWindow.xib */, + 7CFF1386277D5C3400FA745D /* SelectedPhotoInputItemsPreviewWindow.swift */, + 7CFF1388277D5C6600FA745D /* SelectedPhotoInputItemsPreviewWindow.xib */, ); path = Windows; sourceTree = ""; @@ -3400,7 +3379,6 @@ 7CB0954E26CCED2E0049F4C7 /* PinMessageBannerView.swift */, 7C14CFC026CA35CF0094AF4A /* StaticMessagesView.xib */, 7C359DCF26A6C173001D3AE4 /* StickerStoreBannerView.swift */, - 7C247C66277C0DC100112A30 /* BadgeView.swift */, ); path = Views; sourceTree = ""; @@ -3924,7 +3902,7 @@ DF44B0CE20C6897D00A099B6 /* EmptyView.xib in Resources */, 277FF70C1F909A1200DBB2EB /* Assets.xcassets in Resources */, 7BF19C20241D40FA00B192D5 /* LocationSearchView.xib in Resources */, - 7CFF1389277D5C6600FA745D /* MediasPreviewWindow.xib in Resources */, + 7CFF1389277D5C6600FA745D /* SelectedPhotoInputItemsPreviewWindow.xib in Resources */, 7B8BB590234F36C000991ACB /* Colors.xcassets in Resources */, 94B8D18A266E41D300F43CBB /* DatabaseDiagnosticView.xib in Resources */, 7BFCB7762419FC5B00E7BC43 /* LocationCell.xib in Resources */, @@ -4501,7 +4479,6 @@ 7BDBDE6C223636B8006220DF /* ShadowImageView.swift in Sources */, 7BBC6EA81FA98D1A00DC130A /* AddPeopleViewController.swift in Sources */, 7CB0955926CE69250049F4C7 /* PinMessageViewModel.swift in Sources */, - 7C247C67277C0DC100112A30 /* BadgeView.swift in Sources */, DFD93F1E2111C0030013401A /* UIDeviceExtension.swift in Sources */, 7B35AF78228AA3BD00E8101D /* MessagesWithUserSearchResult.swift in Sources */, 7B61B9CA2538E1C8001F94A3 /* ScreenHeightCompatibleLayoutConstraint.swift in Sources */, @@ -4591,7 +4568,7 @@ E0C7674D23CC9411003F9215 /* BackgroundedTrailingInfoViewModel.swift in Sources */, 7B6A4046228400AF0037C7E5 /* MessageReceiverViewController.swift in Sources */, 7BB0F94F2434D75D00BEDA97 /* CircleMember+Convenience.swift in Sources */, - 7CF9503F277D8839000AECC7 /* MediasPreviewViewController.swift in Sources */, + 7CF9503F277D8839000AECC7 /* SelectedPhotoInputItemsViewController.swift in Sources */, 7B0B01981FEA63FA000EEE4F /* StrangerHintView.swift in Sources */, DFC2646C24E585C000BF954D /* DuplicateConfirmationWindow.swift in Sources */, 7BA4193E209AFAB500DFCD39 /* AppCardMessageCell.swift in Sources */, @@ -5024,7 +5001,7 @@ E08F4DDC2395345500C0D021 /* SharedAppCell.swift in Sources */, 7B9F810E222EA3EC0012BFDD /* PopupPresentationAnimator.swift in Sources */, DFDD89EB22C4D5F900128991 /* DepositTipWindow.swift in Sources */, - 7CFF1387277D5C3400FA745D /* MediasPreviewWindow.swift in Sources */, + 7CFF1387277D5C3400FA745D /* SelectedPhotoInputItemsPreviewWindow.swift in Sources */, 94D63DD62646C29100FD7EE8 /* MessageViewModelFactory.swift in Sources */, 7BF4047D2048FA0E004C54E4 /* VerifyPinViewController.swift in Sources */, 7BA24D7325342575004906AD /* HomeOverlaysCoordinator.swift in Sources */, diff --git a/Mixin/Assets.xcassets/ic_photo_checkmark.imageset/ic_photo_checkmark@2x.png b/Mixin/Assets.xcassets/ic_photo_checkmark.imageset/ic_photo_checkmark@2x.png index 1a69a54b0a..755af11ffd 100644 Binary files a/Mixin/Assets.xcassets/ic_photo_checkmark.imageset/ic_photo_checkmark@2x.png and b/Mixin/Assets.xcassets/ic_photo_checkmark.imageset/ic_photo_checkmark@2x.png differ diff --git a/Mixin/Assets.xcassets/ic_photo_checkmark.imageset/ic_photo_checkmark@3x.png b/Mixin/Assets.xcassets/ic_photo_checkmark.imageset/ic_photo_checkmark@3x.png index 8335f54dc2..9f774b1b68 100644 Binary files a/Mixin/Assets.xcassets/ic_photo_checkmark.imageset/ic_photo_checkmark@3x.png and b/Mixin/Assets.xcassets/ic_photo_checkmark.imageset/ic_photo_checkmark@3x.png differ diff --git a/Mixin/Assets.xcassets/ic_photo_unselected.imageset/Contents.json b/Mixin/Assets.xcassets/ic_photo_unselected.imageset/Contents.json new file mode 100644 index 0000000000..7139e5d701 --- /dev/null +++ b/Mixin/Assets.xcassets/ic_photo_unselected.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_photo_unselected@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_photo_unselected@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Mixin/Assets.xcassets/ic_photo_unselected.imageset/ic_photo_unselected@2x.png b/Mixin/Assets.xcassets/ic_photo_unselected.imageset/ic_photo_unselected@2x.png new file mode 100644 index 0000000000..5f4f402c92 Binary files /dev/null and b/Mixin/Assets.xcassets/ic_photo_unselected.imageset/ic_photo_unselected@2x.png differ diff --git a/Mixin/Assets.xcassets/ic_photo_unselected.imageset/ic_photo_unselected@3x.png b/Mixin/Assets.xcassets/ic_photo_unselected.imageset/ic_photo_unselected@3x.png new file mode 100644 index 0000000000..d3fd566e73 Binary files /dev/null and b/Mixin/Assets.xcassets/ic_photo_unselected.imageset/ic_photo_unselected@3x.png differ diff --git a/Mixin/Assets.xcassets/ic_photo_unselected_narrow.imageset/Contents.json b/Mixin/Assets.xcassets/ic_photo_unselected_narrow.imageset/Contents.json new file mode 100644 index 0000000000..cfe7a5145c --- /dev/null +++ b/Mixin/Assets.xcassets/ic_photo_unselected_narrow.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_photo_unselected_narrow@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_photo_unselected_narrow@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Mixin/Assets.xcassets/ic_photo_unselected_narrow.imageset/ic_photo_unselected_narrow@2x.png b/Mixin/Assets.xcassets/ic_photo_unselected_narrow.imageset/ic_photo_unselected_narrow@2x.png new file mode 100644 index 0000000000..bd6e1a4d2a Binary files /dev/null and b/Mixin/Assets.xcassets/ic_photo_unselected_narrow.imageset/ic_photo_unselected_narrow@2x.png differ diff --git a/Mixin/Assets.xcassets/ic_photo_unselected_narrow.imageset/ic_photo_unselected_narrow@3x.png b/Mixin/Assets.xcassets/ic_photo_unselected_narrow.imageset/ic_photo_unselected_narrow@3x.png new file mode 100644 index 0000000000..2eed5be70a Binary files /dev/null and b/Mixin/Assets.xcassets/ic_photo_unselected_narrow.imageset/ic_photo_unselected_narrow@3x.png differ diff --git a/Mixin/UserInterface/Controllers/Chat/Cells/PhotoInputGridCell.swift b/Mixin/UserInterface/Controllers/Chat/Cells/PhotoInputGridCell.swift index fa5d6ab36e..4db203c1ef 100644 --- a/Mixin/UserInterface/Controllers/Chat/Cells/PhotoInputGridCell.swift +++ b/Mixin/UserInterface/Controllers/Chat/Cells/PhotoInputGridCell.swift @@ -5,7 +5,8 @@ class PhotoInputGridCell: UICollectionViewCell { @IBOutlet weak var imageWrapperView: UIView! @IBOutlet weak var imageView: UIImageView! @IBOutlet weak var mediaTypeView: MediaTypeOverlayView! - @IBOutlet weak var badge: BadgeView! + @IBOutlet weak var statusImageView: UIImageView! + @IBOutlet weak var indexLabel: UILabel! @IBOutlet weak var overlayView: UIView! let cornerRadius: CGFloat = 8 @@ -20,8 +21,6 @@ class PhotoInputGridCell: UICollectionViewCell { contentView.layer.shadowColor = UIColor.shadow.cgColor contentView.layer.shadowOpacity = 0.29 contentView.layer.shadowRadius = 5 - badge.cornerRadius = 10 - badge.textColor = .white } override func layoutSubviews() { @@ -32,21 +31,18 @@ class PhotoInputGridCell: UICollectionViewCell { override func prepareForReuse() { super.prepareForReuse() imageView.image = nil - overlayView.isHidden = true } func updateBadge(with index: Int?) { if let index = index { - badge.text = "\(index + 1)" - badge.borderWidth = 0 - badge.borderColor = .clear - badge.badgeColor = .theme + indexLabel.text = "\(index + 1)" + statusImageView.backgroundColor = .theme + statusImageView.image = nil overlayView.isHidden = false } else { - badge.text = nil - badge.borderWidth = 1 - badge.borderColor = .white - badge.badgeColor = .black.withAlphaComponent(0.16) + indexLabel.text = nil + statusImageView.backgroundColor = .clear + statusImageView.image = R.image.ic_photo_unselected_narrow() overlayView.isHidden = true } } diff --git a/Mixin/UserInterface/Controllers/Chat/Cells/SelectedMediaCell.swift b/Mixin/UserInterface/Controllers/Chat/Cells/SelectedMediaCell.swift index 46800da456..7e5d36ed82 100644 --- a/Mixin/UserInterface/Controllers/Chat/Cells/SelectedMediaCell.swift +++ b/Mixin/UserInterface/Controllers/Chat/Cells/SelectedMediaCell.swift @@ -6,11 +6,12 @@ import MixinServices class SelectedMediaCell: UICollectionViewCell { - @IBOutlet weak var imageView: SDAnimatedImageView! + @IBOutlet weak var imageView: UIImageView! @IBOutlet weak var mediaTypeView: MediaTypeOverlayView! var deselectAsset: (() -> Void)? + private var requestId: PHImageRequestID? private lazy var imageRequestOptions: PHImageRequestOptions = { let options = PHImageRequestOptions() options.version = .current @@ -22,6 +23,9 @@ class SelectedMediaCell: UICollectionViewCell { override func prepareForReuse() { super.prepareForReuse() imageView.image = nil + if let id = requestId { + PHCachingImageManager.default().cancelImageRequest(id) + } } func load(asset: PHAsset, size: CGSize) { @@ -34,7 +38,7 @@ class SelectedMediaCell: UICollectionViewCell { mediaTypeView.style = .hidden } } - PHImageManager.default().requestImage(for: asset, targetSize: size * UIScreen.main.scale, contentMode: .aspectFill, options: imageRequestOptions) { [weak self] (image, info) in + requestId = PHImageManager.default().requestImage(for: asset, targetSize: size * UIScreen.main.scale, contentMode: .aspectFill, options: imageRequestOptions) { [weak self] (image, info) in guard let self = self, let image = image else { return } diff --git a/Mixin/UserInterface/Controllers/Chat/ConversationInputViewController.swift b/Mixin/UserInterface/Controllers/Chat/ConversationInputViewController.swift index b0a6b2f1b4..16d144bd64 100644 --- a/Mixin/UserInterface/Controllers/Chat/ConversationInputViewController.swift +++ b/Mixin/UserInterface/Controllers/Chat/ConversationInputViewController.swift @@ -406,7 +406,7 @@ class ConversationInputViewController: UIViewController { if minimize { setPreferredContentHeightAnimated(.minimized) } - photoViewController.dismissMediasPreviewControllerIfNeeded() + photoViewController.dismissSelectedPhotoInputItemsViewControllerIfNeeded() UIView.animate(withDuration: 0.5, delay: 0, options: .overdampedCurve) { self.customInputContainerView.alpha = 0 } completion: { _ in diff --git a/Mixin/UserInterface/Controllers/Chat/PhotoInputGridViewController.swift b/Mixin/UserInterface/Controllers/Chat/PhotoInputGridViewController.swift index b5a55de246..28d9539aee 100644 --- a/Mixin/UserInterface/Controllers/Chat/PhotoInputGridViewController.swift +++ b/Mixin/UserInterface/Controllers/Chat/PhotoInputGridViewController.swift @@ -133,12 +133,14 @@ extension PhotoInputGridViewController: UICollectionViewDataSource { cell.imageView.image = R.image.conversation.ic_camera() cell.imageView.backgroundColor = R.color.camera_background() cell.mediaTypeView.style = .hidden - cell.badge.isHidden = true + cell.indexLabel.isHidden = true + cell.statusImageView.isHidden = true } else if let asset = asset(at: indexPath) { cell.identifier = asset.localIdentifier cell.imageView.contentMode = .scaleAspectFill cell.imageView.backgroundColor = .background - cell.badge.isHidden = false + cell.indexLabel.isHidden = false + cell.statusImageView.isHidden = false cell.updateBadge(with: selectedAssets.firstIndex(of: asset)) imageManager.requestImage(for: asset, targetSize: thumbnailSize, contentMode: .aspectFill, options: imageRequestOptions) { [weak cell] (image, _) in guard let cell = cell, cell.identifier == asset.localIdentifier else { diff --git a/Mixin/UserInterface/Controllers/Chat/PhotoInputViewController.swift b/Mixin/UserInterface/Controllers/Chat/PhotoInputViewController.swift index 0362cddb50..8de7b30b45 100644 --- a/Mixin/UserInterface/Controllers/Chat/PhotoInputViewController.swift +++ b/Mixin/UserInterface/Controllers/Chat/PhotoInputViewController.swift @@ -21,11 +21,11 @@ class PhotoInputViewController: UIViewController, ConversationInputAccessible { } } - private weak var mediasPreviewControllerIfLoaded: MediasPreviewViewController? - private lazy var mediasPreviewController: MediasPreviewViewController = { - let controller = R.storyboard.chat.selected_medias()! + private weak var selectedPhotoInputItemsViewControllerIfLoaded: SelectedPhotoInputItemsViewController? + private lazy var selectedPhotoInputItemsViewController: SelectedPhotoInputItemsViewController = { + let controller = R.storyboard.chat.selected_photo_input_items()! controller.delegate = self - mediasPreviewControllerIfLoaded = controller + selectedPhotoInputItemsViewControllerIfLoaded = controller return controller }() private var allPhotos: PHFetchResult? @@ -190,7 +190,7 @@ extension PhotoInputViewController: PHPhotoLibraryChangeObserver { func photoLibraryDidChange(_ changeInstance: PHChange) { DispatchQueue.main.sync { - self.dismissMediasPreviewControllerIfNeeded() + self.dismissSelectedPhotoInputItemsViewControllerIfNeeded() if let allPhotos = self.allPhotos, let changeDetails = changeInstance.changeDetails(for: allPhotos) { self.allPhotos = changeDetails.fetchResultAfterChanges } @@ -233,46 +233,46 @@ extension PhotoInputViewController: PhotoInputGridViewControllerDelegate { func photoInputGridViewController(_ controller: PhotoInputGridViewController, didSelect asset: PHAsset) { if !controller.selectedAssets.isEmpty { - presentMediasPreviewControllerAnimated() + presentSelectedPhotoInputItemsViewControllerAnimated() } - mediasPreviewController.add(asset) + selectedPhotoInputItemsViewController.add(asset) } func photoInputGridViewController(_ controller: PhotoInputGridViewController, didDeselect asset: PHAsset) { if controller.selectedAssets.isEmpty { - dismissMediasPreviewControllerAnimated() + dismissSelectedPhotoInputItemsViewControllerAnimated() } else { - mediasPreviewController.remove(asset) + selectedPhotoInputItemsViewController.remove(asset) } } func photoInputGridViewControllerDidTapCamera(_ controller: PhotoInputGridViewController) { - dismissMediasPreviewControllerIfNeeded() + dismissSelectedPhotoInputItemsViewControllerIfNeeded() } } -extension PhotoInputViewController: MediasPreviewViewControllerDelegate { +extension PhotoInputViewController: SelectedPhotoInputItemsViewControllerDelegate { - func mediasPreviewViewController(_ controller: MediasPreviewViewController, didSend assets: [PHAsset]) { + func selectedPhotoInputItemsViewController(_ controller: SelectedPhotoInputItemsViewController, didSend assets: [PHAsset]) { sendItems(assets: assets) } - func mediasPreviewViewController(_ controller: MediasPreviewViewController, didCancelSend assets: [PHAsset]) { + func selectedPhotoInputItemsViewController(_ controller: SelectedPhotoInputItemsViewController, didCancelSend assets: [PHAsset]) { conversationInputViewController?.dismiss() } - func mediasPreviewViewController(_ controller: MediasPreviewViewController, didRemove asset: PHAsset) { + func selectedPhotoInputItemsViewController(_ controller: SelectedPhotoInputItemsViewController, didDeselect asset: PHAsset) { gridViewController.deselect(asset) if gridViewController.selectedAssets.isEmpty { - dismissMediasPreviewControllerAnimated() + dismissSelectedPhotoInputItemsViewControllerAnimated() } } - func mediasPreviewViewController(_ controller: MediasPreviewViewController, didSelectAssetAt index: Int) { + func selectedPhotoInputItemsViewController(_ controller: SelectedPhotoInputItemsViewController, didSelectAssetAt index: Int) { conversationInputViewController?.setPreferredContentHeightAnimated(.regular) let assets = gridViewController.selectedAssets - let window = MediasPreviewWindow.instance() + let window = SelectedPhotoInputItemsPreviewWindow.instance() window.load(assets: assets, initIndex: index) window.delegate = self window.presentPopupControllerAnimated() @@ -280,23 +280,23 @@ extension PhotoInputViewController: MediasPreviewViewControllerDelegate { } -extension PhotoInputViewController: MediasPreviewWindowDelegate { +extension PhotoInputViewController: SelectedPhotoInputItemsPreviewWindowDelegate { - func mediasPreviewWindow(_ window: MediasPreviewWindow, willDismissWindow assets: [PHAsset]) { + func selectedPhotoInputItemsPreviewWindow(_ window: SelectedPhotoInputItemsPreviewWindow, willDismissWindow assets: [PHAsset]) { if assets.isEmpty { gridViewController.deselectAll() - dismissMediasPreviewControllerAnimated() + dismissSelectedPhotoInputItemsViewControllerAnimated() } else { gridViewController.updateSelectdAssets(assets) - mediasPreviewController.updateAssets(assets) + selectedPhotoInputItemsViewController.updateAssets(assets) } } - func mediasPreviewWindow(_ window: MediasPreviewWindow, didTapSendItems assets: [PHAsset]) { + func selectedPhotoInputItemsPreviewWindow(_ window: SelectedPhotoInputItemsPreviewWindow, didTapSendItems assets: [PHAsset]) { sendItems(assets: assets) } - func mediasPreviewWindow(_ window: MediasPreviewWindow, didTapSendFiles assets: [PHAsset]) { + func selectedPhotoInputItemsPreviewWindow(_ window: SelectedPhotoInputItemsPreviewWindow, didTapSendFiles assets: [PHAsset]) { sendAsFiles(assets: assets) } @@ -310,7 +310,7 @@ extension PhotoInputViewController { } assets.forEach(controller.send(asset:)) gridViewController.deselectAll() - dismissMediasPreviewControllerAnimated() + dismissSelectedPhotoInputItemsViewControllerAnimated() } private func sendAsFiles(assets: [PHAsset]) { @@ -326,26 +326,26 @@ extension PhotoInputViewController { } urls.forEach(controller.sendFile(url:)) self.gridViewController.deselectAll() - self.dismissMediasPreviewControllerAnimated() + self.dismissSelectedPhotoInputItemsViewControllerAnimated() } } - func dismissMediasPreviewControllerIfNeeded() { - guard let previewController = mediasPreviewControllerIfLoaded, previewController.parent != nil else { + func dismissSelectedPhotoInputItemsViewControllerIfNeeded() { + guard let controller = selectedPhotoInputItemsViewControllerIfLoaded, controller.parent != nil else { return } gridViewController.view.isUserInteractionEnabled = false gridViewController.deselectAll() - previewController.removeAllAssets() - previewController.view.removeFromSuperview() - previewController.removeFromParent() - previewController.view.snp.removeConstraints() + controller.removeAllAssets() + controller.view.removeFromSuperview() + controller.removeFromParent() + controller.view.snp.removeConstraints() gridViewController.view.isUserInteractionEnabled = true } - private func presentMediasPreviewControllerAnimated() { + private func presentSelectedPhotoInputItemsViewControllerAnimated() { guard - mediasPreviewController.parent == nil, + selectedPhotoInputItemsViewController.parent == nil, let conversationInputViewController = conversationInputViewController, let inputBarView = conversationInputViewController.inputBarView, let conversationViewController = conversationInputViewController.parent @@ -353,59 +353,59 @@ extension PhotoInputViewController { return } gridViewController.view.isUserInteractionEnabled = false - let previewController = mediasPreviewController - let previewViewHeight = mediasPreviewController.viewHeight - addChild(previewController) - view.insertSubview(previewController.view, at: 0) - previewController.view.snp.makeConstraints({ (make) in + let controller = selectedPhotoInputItemsViewController + let viewHeight = selectedPhotoInputItemsViewController.viewHeight + addChild(controller) + view.insertSubview(controller.view, at: 0) + controller.view.snp.makeConstraints({ (make) in make.left.right.equalToSuperview() make.top.equalTo(inputBarView.snp.bottom).offset(0) }) view.layoutIfNeeded() - previewController.view.snp.updateConstraints { make in - make.top.equalTo(inputBarView.snp.bottom).offset(-previewViewHeight) + controller.view.snp.updateConstraints { make in + make.top.equalTo(inputBarView.snp.bottom).offset(-viewHeight) } UIView.animate(withDuration: 0.3, delay: 0, options: .overdampedCurve) { self.view.layoutIfNeeded() } completion: { _ in - conversationViewController.addChild(previewController) - conversationViewController.view.addSubview(previewController.view) - previewController.view.snp.remakeConstraints({ (make) in + conversationViewController.addChild(controller) + conversationViewController.view.addSubview(controller.view) + controller.view.snp.remakeConstraints({ (make) in make.left.right.equalToSuperview() - make.top.equalTo(inputBarView.snp.bottom).offset(-previewViewHeight) + make.top.equalTo(inputBarView.snp.bottom).offset(-viewHeight) }) self.gridViewController.view.isUserInteractionEnabled = true } } - private func dismissMediasPreviewControllerAnimated() { + private func dismissSelectedPhotoInputItemsViewControllerAnimated() { guard - mediasPreviewController.parent != nil, + selectedPhotoInputItemsViewController.parent != nil, let conversationInputViewController = conversationInputViewController, let inputBarView = conversationInputViewController.inputBarView else { return } gridViewController.view.isUserInteractionEnabled = false - let previewController = mediasPreviewController - let previewViewHeight = mediasPreviewController.viewHeight - addChild(previewController) - view.insertSubview(previewController.view, at: 0) - previewController.view.snp.remakeConstraints({ (make) in + let controller = selectedPhotoInputItemsViewController + let viewHeight = selectedPhotoInputItemsViewController.viewHeight + addChild(controller) + view.insertSubview(controller.view, at: 0) + controller.view.snp.remakeConstraints({ (make) in make.left.right.equalToSuperview() - make.top.equalTo(inputBarView.snp.bottom).offset(-previewViewHeight) + make.top.equalTo(inputBarView.snp.bottom).offset(-viewHeight) }) view.layoutIfNeeded() - previewController.view.snp.updateConstraints { make in + controller.view.snp.updateConstraints { make in make.top.equalTo(inputBarView.snp.bottom).offset(0) } UIView.animate(withDuration: 0.3, delay: 0, options: .overdampedCurve) { self.view.layoutIfNeeded() } completion: { _ in - previewController.removeAllAssets() - previewController.view.removeFromSuperview() - previewController.removeFromParent() - previewController.view.snp.removeConstraints() + controller.removeAllAssets() + controller.view.removeFromSuperview() + controller.removeFromParent() + controller.view.snp.removeConstraints() self.gridViewController.view.isUserInteractionEnabled = true } } diff --git a/Mixin/UserInterface/Controllers/Chat/MediasPreviewViewController.swift b/Mixin/UserInterface/Controllers/Chat/SelectedPhotoInputItemsViewController.swift similarity index 71% rename from Mixin/UserInterface/Controllers/Chat/MediasPreviewViewController.swift rename to Mixin/UserInterface/Controllers/Chat/SelectedPhotoInputItemsViewController.swift index 60db43b6cc..b43b0b3e79 100644 --- a/Mixin/UserInterface/Controllers/Chat/MediasPreviewViewController.swift +++ b/Mixin/UserInterface/Controllers/Chat/SelectedPhotoInputItemsViewController.swift @@ -1,21 +1,21 @@ import UIKit import Photos -protocol MediasPreviewViewControllerDelegate: AnyObject { - func mediasPreviewViewController(_ controller: MediasPreviewViewController, didSend assets: [PHAsset]) - func mediasPreviewViewController(_ controller: MediasPreviewViewController, didRemove asset: PHAsset) - func mediasPreviewViewController(_ controller: MediasPreviewViewController, didSelectAssetAt index: Int) - func mediasPreviewViewController(_ controller: MediasPreviewViewController, didCancelSend assets: [PHAsset]) +protocol SelectedPhotoInputItemsViewControllerDelegate: AnyObject { + func selectedPhotoInputItemsViewController(_ controller: SelectedPhotoInputItemsViewController, didSend assets: [PHAsset]) + func selectedPhotoInputItemsViewController(_ controller: SelectedPhotoInputItemsViewController, didDeselect asset: PHAsset) + func selectedPhotoInputItemsViewController(_ controller: SelectedPhotoInputItemsViewController, didSelectAssetAt index: Int) + func selectedPhotoInputItemsViewController(_ controller: SelectedPhotoInputItemsViewController, didCancelSend assets: [PHAsset]) } -final class MediasPreviewViewController: UIViewController { +final class SelectedPhotoInputItemsViewController: UIViewController { let viewHeight: CGFloat = 224 @IBOutlet weak var collectionView: UICollectionView! @IBOutlet weak var sendButton: UIButton! - weak var delegate: MediasPreviewViewControllerDelegate? + weak var delegate: SelectedPhotoInputItemsViewControllerDelegate? private var cellSizeCache = [String: CGSize]() private var assets = [PHAsset]() { @@ -25,16 +25,16 @@ final class MediasPreviewViewController: UIViewController { } @IBAction func cancelAction(_ sender: Any) { - delegate?.mediasPreviewViewController(self, didCancelSend: assets) + delegate?.selectedPhotoInputItemsViewController(self, didCancelSend: assets) } @IBAction func sendAction(_ sender: Any) { - delegate?.mediasPreviewViewController(self, didSend: assets) + delegate?.selectedPhotoInputItemsViewController(self, didSend: assets) } } -extension MediasPreviewViewController { +extension SelectedPhotoInputItemsViewController { func add(_ asset: PHAsset) { guard !assets.contains(asset) else { @@ -69,7 +69,7 @@ extension MediasPreviewViewController { } -extension MediasPreviewViewController: UICollectionViewDataSource { +extension SelectedPhotoInputItemsViewController: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { assets.count @@ -85,7 +85,7 @@ extension MediasPreviewViewController: UICollectionViewDataSource { return } self.remove(asset) - self.delegate?.mediasPreviewViewController(self, didRemove: asset) + self.delegate?.selectedPhotoInputItemsViewController(self, didDeselect: asset) } } return cell @@ -93,19 +93,19 @@ extension MediasPreviewViewController: UICollectionViewDataSource { } -extension MediasPreviewViewController: UICollectionViewDelegateFlowLayout, UICollectionViewDelegate { +extension SelectedPhotoInputItemsViewController: UICollectionViewDelegateFlowLayout, UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { cellSizeForItemAt(indexPath.item) } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - delegate?.mediasPreviewViewController(self, didSelectAssetAt: indexPath.item) + delegate?.selectedPhotoInputItemsViewController(self, didSelectAssetAt: indexPath.item) } } -extension MediasPreviewViewController { +extension SelectedPhotoInputItemsViewController { private func cellSizeForItemAt(_ index: Int) -> CGSize { guard index < assets.count else { diff --git a/Mixin/UserInterface/Controllers/Chat/Views/BadgeView.swift b/Mixin/UserInterface/Controllers/Chat/Views/BadgeView.swift deleted file mode 100644 index f91353d98d..0000000000 --- a/Mixin/UserInterface/Controllers/Chat/Views/BadgeView.swift +++ /dev/null @@ -1,58 +0,0 @@ -import UIKit - -class BadgeView: UILabel { - - var badgeColor: UIColor = .clear { - didSet { - setNeedsDisplay() - } - } - var borderWidth: CGFloat = 0 { - didSet { - setNeedsDisplay() - } - } - var borderColor: UIColor = .clear { - didSet { - setNeedsDisplay() - } - } - var cornerRadius: CGFloat = 0 { - didSet { - setNeedsDisplay() - } - } - - override init(frame: CGRect) { - super.init(frame: frame) - prepare() - } - - required init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - prepare() - } - - override func draw(_ rect: CGRect) { - let rectInset = rect.insetBy(dx: borderWidth / 2, dy: borderWidth / 2) - let path: UIBezierPath - if cornerRadius > 0 { - path = UIBezierPath(roundedRect: rectInset, cornerRadius: cornerRadius) - } else { - path = UIBezierPath(rect: rectInset) - } - badgeColor.setFill() - path.fill() - if borderWidth > 0 { - borderColor.setStroke() - path.lineWidth = borderWidth - path.stroke() - } - super.draw(rect) - } - - private func prepare() { - textAlignment = NSTextAlignment.center - } - -} diff --git a/Mixin/UserInterface/Storyboard/Chat.storyboard b/Mixin/UserInterface/Storyboard/Chat.storyboard index 7dc1887835..62c6e6f033 100644 --- a/Mixin/UserInterface/Storyboard/Chat.storyboard +++ b/Mixin/UserInterface/Storyboard/Chat.storyboard @@ -1441,10 +1441,10 @@ - + - + @@ -1469,7 +1469,7 @@ - + @@ -1537,6 +1537,7 @@ + @@ -1553,6 +1554,7 @@ + @@ -2510,15 +2512,24 @@ - - + diff --git a/Mixin/UserInterface/Windows/MediasPreviewWindow.swift b/Mixin/UserInterface/Windows/SelectedPhotoInputItemsPreviewWindow.swift similarity index 83% rename from Mixin/UserInterface/Windows/MediasPreviewWindow.swift rename to Mixin/UserInterface/Windows/SelectedPhotoInputItemsPreviewWindow.swift index b73977f9c3..5562659fe7 100644 --- a/Mixin/UserInterface/Windows/MediasPreviewWindow.swift +++ b/Mixin/UserInterface/Windows/SelectedPhotoInputItemsPreviewWindow.swift @@ -1,13 +1,13 @@ import UIKit import Photos -protocol MediasPreviewWindowDelegate: AnyObject { - func mediasPreviewWindow(_ window: MediasPreviewWindow, didTapSendItems assets: [PHAsset]) - func mediasPreviewWindow(_ window: MediasPreviewWindow, didTapSendFiles assets: [PHAsset]) - func mediasPreviewWindow(_ window: MediasPreviewWindow, willDismissWindow assets: [PHAsset]) +protocol SelectedPhotoInputItemsPreviewWindowDelegate: AnyObject { + func selectedPhotoInputItemsPreviewWindow(_ window: SelectedPhotoInputItemsPreviewWindow, didTapSendItems assets: [PHAsset]) + func selectedPhotoInputItemsPreviewWindow(_ window: SelectedPhotoInputItemsPreviewWindow, didTapSendFiles assets: [PHAsset]) + func selectedPhotoInputItemsPreviewWindow(_ window: SelectedPhotoInputItemsPreviewWindow, willDismissWindow assets: [PHAsset]) } -final class MediasPreviewWindow: BottomSheetView { +final class SelectedPhotoInputItemsPreviewWindow: BottomSheetView { @IBOutlet weak var label: UILabel! @IBOutlet weak var collectionView: UICollectionView! @@ -17,7 +17,7 @@ final class MediasPreviewWindow: BottomSheetView { @IBOutlet weak var collectionViewHeightConstraint: NSLayoutConstraint! - weak var delegate: MediasPreviewWindowDelegate? + weak var delegate: SelectedPhotoInputItemsPreviewWindowDelegate? private var assets = [PHAsset]() private var selectedAssets = [PHAsset]() @@ -48,7 +48,7 @@ final class MediasPreviewWindow: BottomSheetView { override func dismissPopupControllerAnimated() { if !isSending { - delegate?.mediasPreviewWindow(self, willDismissWindow: selectedAssets) + delegate?.selectedPhotoInputItemsPreviewWindow(self, willDismissWindow: selectedAssets) } super.dismissPopupControllerAnimated() } @@ -60,13 +60,13 @@ final class MediasPreviewWindow: BottomSheetView { @IBAction func sendPhotosAction(_ sender: Any) { isSending = true - delegate?.mediasPreviewWindow(self, didTapSendItems: selectedAssets) + delegate?.selectedPhotoInputItemsPreviewWindow(self, didTapSendItems: selectedAssets) dismissPopupControllerAnimated() } @IBAction func sendAsFilesAction(_ sender: Any) { isSending = true - delegate?.mediasPreviewWindow(self, didTapSendFiles: selectedAssets) + delegate?.selectedPhotoInputItemsPreviewWindow(self, didTapSendFiles: selectedAssets) dismissPopupControllerAnimated() } @@ -80,13 +80,13 @@ final class MediasPreviewWindow: BottomSheetView { } } - class func instance() -> MediasPreviewWindow { - R.nib.mediasPreviewWindow(owner: nil)! + class func instance() -> SelectedPhotoInputItemsPreviewWindow { + R.nib.selectedPhotoInputItemsPreviewWindow(owner: nil)! } } -extension MediasPreviewWindow: UICollectionViewDataSource { +extension SelectedPhotoInputItemsPreviewWindow: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { assets.count @@ -104,7 +104,7 @@ extension MediasPreviewWindow: UICollectionViewDataSource { } -extension MediasPreviewWindow: UICollectionViewDelegate, UICollectionViewDelegateFlowLayout { +extension SelectedPhotoInputItemsPreviewWindow: UICollectionViewDelegate, UICollectionViewDelegateFlowLayout { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { MediaPreviewCell.cellSize @@ -128,7 +128,7 @@ extension MediasPreviewWindow: UICollectionViewDelegate, UICollectionViewDelegat } -extension MediasPreviewWindow { +extension SelectedPhotoInputItemsPreviewWindow { private func updateUI() { let title: String diff --git a/Mixin/UserInterface/Windows/MediasPreviewWindow.xib b/Mixin/UserInterface/Windows/SelectedPhotoInputItemsPreviewWindow.xib similarity index 97% rename from Mixin/UserInterface/Windows/MediasPreviewWindow.xib rename to Mixin/UserInterface/Windows/SelectedPhotoInputItemsPreviewWindow.xib index 0f887296bc..4c3c1819bf 100644 --- a/Mixin/UserInterface/Windows/MediasPreviewWindow.xib +++ b/Mixin/UserInterface/Windows/SelectedPhotoInputItemsPreviewWindow.xib @@ -11,7 +11,7 @@ - + @@ -75,6 +75,7 @@ + @@ -92,6 +93,7 @@ +