diff --git a/UpstraUIKit/AmityUIKit.xcodeproj/project.pbxproj b/UpstraUIKit/AmityUIKit.xcodeproj/project.pbxproj index b376c56..6ecb82c 100644 --- a/UpstraUIKit/AmityUIKit.xcodeproj/project.pbxproj +++ b/UpstraUIKit/AmityUIKit.xcodeproj/project.pbxproj @@ -371,7 +371,7 @@ 78DA0324263C715C007C11CE /* AmityMyCommunityPreviewViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 78DA0320263C715C007C11CE /* AmityMyCommunityPreviewViewController.xib */; }; 78DA0325263C715C007C11CE /* AmityMyCommunityPreviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78DA0321263C715C007C11CE /* AmityMyCommunityPreviewViewController.swift */; }; 921C3FCB2C379FDB00BF403E /* AmitySocialV4Compatible.swift in Sources */ = {isa = PBXBuildFile; fileRef = 921C3FCA2C379FDB00BF403E /* AmitySocialV4Compatible.swift */; }; - 925522522C9C2DF900AD85B5 /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 925522512C9C2DF900AD85B5 /* SharedFrameworks */; }; + 9255225A2CA5653600AD85B5 /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 925522592CA5653600AD85B5 /* SharedFrameworks */; }; 970E784726429FA500E5FCEE /* ChatSettingsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970E784526429FA500E5FCEE /* ChatSettingsTableViewCell.swift */; }; 970E784826429FA500E5FCEE /* ChatSettingsTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 970E784626429FA500E5FCEE /* ChatSettingsTableViewCell.xib */; }; 970E784E26429FB300E5FCEE /* AmityChatSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970E784C26429FB300E5FCEE /* AmityChatSettingsViewController.swift */; }; @@ -1340,7 +1340,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 925522522C9C2DF900AD85B5 /* SharedFrameworks in Frameworks */, + 9255225A2CA5653600AD85B5 /* SharedFrameworks in Frameworks */, 68F5D9FA2B481E4000A9FA0D /* AmityUIKit4.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -4507,7 +4507,7 @@ ); name = AmityUIKit; packageProductDependencies = ( - 925522512C9C2DF900AD85B5 /* SharedFrameworks */, + 925522592CA5653600AD85B5 /* SharedFrameworks */, ); productName = UpstraUIKit; productReference = 72A3503024EA811500DA9D46 /* AmityUIKit.framework */; @@ -5523,7 +5523,7 @@ /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ - 925522512C9C2DF900AD85B5 /* SharedFrameworks */ = { + 925522592CA5653600AD85B5 /* SharedFrameworks */ = { isa = XCSwiftPackageProductDependency; productName = SharedFrameworks; }; diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4.xcodeproj/project.pbxproj b/UpstraUIKit/AmityUIKit4/AmityUIKit4.xcodeproj/project.pbxproj index 3bb738b..90ce608 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4.xcodeproj/project.pbxproj +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4.xcodeproj/project.pbxproj @@ -92,6 +92,8 @@ 684098312B318B3C00697E1B /* ImageVideoPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 684098302B318B3C00697E1B /* ImageVideoPicker.swift */; }; 68435FDD2C8ED5F9000B7737 /* AmityCommunityNotificationSettingPageBehavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68435FDC2C8ED5F9000B7737 /* AmityCommunityNotificationSettingPageBehavior.swift */; }; 68435FDF2C8ED7C3000B7737 /* AmitySocialHomeTopNavigationComponentBehavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68435FDE2C8ED7C3000B7737 /* AmitySocialHomeTopNavigationComponentBehavior.swift */; }; + 68435FE12C8EE19B000B7737 /* AmityCommunityImageFeedComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68435FE02C8EE19B000B7737 /* AmityCommunityImageFeedComponent.swift */; }; + 68435FE32C8EFC9A000B7737 /* AmityCommunityMediaFeedViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68435FE22C8EFC9A000B7737 /* AmityCommunityMediaFeedViewModel.swift */; }; 684AE0F62B0C5B0200FD7270 /* AmityUIKit4.docc in Sources */ = {isa = PBXBuildFile; fileRef = 684AE0F52B0C5B0200FD7270 /* AmityUIKit4.docc */; }; 684AE0FC2B0C5B0200FD7270 /* AmityUIKit4.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 684AE0F12B0C5B0200FD7270 /* AmityUIKit4.framework */; }; 684AE1012B0C5B0200FD7270 /* AmityUIKit4Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 684AE1002B0C5B0200FD7270 /* AmityUIKit4Tests.swift */; }; @@ -167,6 +169,8 @@ 686198532C12E41400BA81BE /* AmityPostTargetSelectionPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 686198522C12E41400BA81BE /* AmityPostTargetSelectionPage.swift */; }; 686198552C12E5B200BA81BE /* TargetSelectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 686198542C12E5B200BA81BE /* TargetSelectionView.swift */; }; 6862513D2B7DD3DC0097BB7E /* AmityViewStoryPageBehaviour.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6862513C2B7DD3DC0097BB7E /* AmityViewStoryPageBehaviour.swift */; }; + 686830222C9154F3009B1694 /* AmityCommunityVideoFeedComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 686830212C9154E7009B1694 /* AmityCommunityVideoFeedComponent.swift */; }; + 686830242C915DFC009B1694 /* TimeInterval+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 686830232C915DFC009B1694 /* TimeInterval+Extension.swift */; }; 6868302C2C92EBE4009B1694 /* AmityCommunityMembershipPageBehavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6868302B2C92EBE4009B1694 /* AmityCommunityMembershipPageBehavior.swift */; }; 686D173C2B1452A7007AEF59 /* AmityStoryTabComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 686D173B2B1452A7007AEF59 /* AmityStoryTabComponent.swift */; }; 686D173E2B1496D2007AEF59 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 686D173D2B1496D2007AEF59 /* Assets.xcassets */; }; @@ -300,7 +304,7 @@ 68FF77DB2B81DEC900B8F561 /* AmityStoryTargetModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68FF77DA2B81DEC900B8F561 /* AmityStoryTargetModel.swift */; }; 921C3FC92C379F3E00BF403E /* AmityPostContentComponentBehavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = 921C3FC82C379F3E00BF403E /* AmityPostContentComponentBehavior.swift */; }; 9250CA2D2C2D55E9007551ED /* MultiSelectionMediaPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9250CA2C2C2D55E9007551ED /* MultiSelectionMediaPicker.swift */; }; - 925522502C9C2DF200AD85B5 /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 9255224F2C9C2DF200AD85B5 /* SharedFrameworks */; }; + 925522582CA5651700AD85B5 /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 925522572CA5651700AD85B5 /* SharedFrameworks */; }; 926894402C474A49004CECF8 /* AmityCommunityPinnedPostComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9268943F2C474A49004CECF8 /* AmityCommunityPinnedPostComponent.swift */; }; 926894422C474A6A004CECF8 /* EmptyCommunityFeedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 926894412C474A6A004CECF8 /* EmptyCommunityFeedView.swift */; }; 926F079C2BB4DDB9000806CB /* Shimmer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 926F079B2BB4DDB9000806CB /* Shimmer.swift */; }; @@ -542,6 +546,8 @@ 684098302B318B3C00697E1B /* ImageVideoPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageVideoPicker.swift; sourceTree = ""; }; 68435FDC2C8ED5F9000B7737 /* AmityCommunityNotificationSettingPageBehavior.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityCommunityNotificationSettingPageBehavior.swift; sourceTree = ""; }; 68435FDE2C8ED7C3000B7737 /* AmitySocialHomeTopNavigationComponentBehavior.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmitySocialHomeTopNavigationComponentBehavior.swift; sourceTree = ""; }; + 68435FE02C8EE19B000B7737 /* AmityCommunityImageFeedComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityCommunityImageFeedComponent.swift; sourceTree = ""; }; + 68435FE22C8EFC9A000B7737 /* AmityCommunityMediaFeedViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityCommunityMediaFeedViewModel.swift; sourceTree = ""; }; 684AE0F12B0C5B0200FD7270 /* AmityUIKit4.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AmityUIKit4.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 684AE0F42B0C5B0200FD7270 /* AmityUIKit4.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AmityUIKit4.h; sourceTree = ""; }; 684AE0F52B0C5B0200FD7270 /* AmityUIKit4.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = AmityUIKit4.docc; sourceTree = ""; }; @@ -626,6 +632,8 @@ 686198522C12E41400BA81BE /* AmityPostTargetSelectionPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityPostTargetSelectionPage.swift; sourceTree = ""; }; 686198542C12E5B200BA81BE /* TargetSelectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TargetSelectionView.swift; sourceTree = ""; }; 6862513C2B7DD3DC0097BB7E /* AmityViewStoryPageBehaviour.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityViewStoryPageBehaviour.swift; sourceTree = ""; }; + 686830212C9154E7009B1694 /* AmityCommunityVideoFeedComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityCommunityVideoFeedComponent.swift; sourceTree = ""; }; + 686830232C915DFC009B1694 /* TimeInterval+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TimeInterval+Extension.swift"; sourceTree = ""; }; 6868302B2C92EBE4009B1694 /* AmityCommunityMembershipPageBehavior.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityCommunityMembershipPageBehavior.swift; sourceTree = ""; }; 686D173B2B1452A7007AEF59 /* AmityStoryTabComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityStoryTabComponent.swift; sourceTree = ""; }; 686D173D2B1496D2007AEF59 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -913,7 +921,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 925522502C9C2DF200AD85B5 /* SharedFrameworks in Frameworks */, + 925522582CA5651700AD85B5 /* SharedFrameworks in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1387,6 +1395,7 @@ 685CE28A2B68E2D400AF8F54 /* Int+Extension.swift */, 685CE28C2B68EFB900AF8F54 /* Date+Extension.swift */, 68FF77802B7E00C300B8F561 /* Array+Extension.swift */, + 686830232C915DFC009B1694 /* TimeInterval+Extension.swift */, 683DF10D2C6B5220005BF06C /* UINavigationController+Extension.swift */, 6877D3782C75CFAA008B3598 /* AmityCommunityNotificaitonSettings+Extension.swift */, ); @@ -1989,11 +1998,14 @@ 9280FDD22C40E9EE0052F01A /* CommunityProfile */ = { isa = PBXGroup; children = ( + 686830212C9154E7009B1694 /* AmityCommunityVideoFeedComponent.swift */, 9280FDD32C40E9F90052F01A /* AmityCommunityHeaderComponent.swift */, 9280FDD72C40EB970052F01A /* AmityCommunityFeedComponent.swift */, 9268943F2C474A49004CECF8 /* AmityCommunityPinnedPostComponent.swift */, 926894412C474A6A004CECF8 /* EmptyCommunityFeedView.swift */, 68804E232C8083560081CBC9 /* AmityPendingPostContentComponent.swift */, + 68435FE02C8EE19B000B7737 /* AmityCommunityImageFeedComponent.swift */, + 68435FE22C8EFC9A000B7737 /* AmityCommunityMediaFeedViewModel.swift */, ); path = CommunityProfile; sourceTree = ""; @@ -2556,7 +2568,7 @@ ); name = AmityUIKit4; packageProductDependencies = ( - 9255224F2C9C2DF200AD85B5 /* SharedFrameworks */, + 925522572CA5651700AD85B5 /* SharedFrameworks */, ); productName = AmityUIKit4; productReference = 684AE0F12B0C5B0200FD7270 /* AmityUIKit4.framework */; @@ -2845,6 +2857,7 @@ 6874B95E2C3F469C0021D8D0 /* AmityPostComposerPageBehavior.swift in Sources */, 68FB40982C3D890E006C97CC /* AmityPostTargetSelectionPageBehavior.swift in Sources */, 68D3A3102BE346740096CF79 /* AmitySocialHomeTopNavigationComponent.swift in Sources */, + 686830222C9154F3009B1694 /* AmityCommunityVideoFeedComponent.swift in Sources */, 6877D3792C75CFAA008B3598 /* AmityCommunityNotificaitonSettings+Extension.swift in Sources */, 689A31D02C634D4D00F17999 /* PrivacyRadioButtonView.swift in Sources */, 684098162B313A6F00697E1B /* GSAVPlayerViewController.swift in Sources */, @@ -2865,6 +2878,7 @@ A97A442B2C2D2D4D0017327D /* ImageContext.swift in Sources */, 680204662B88527D00CC0CD0 /* AccessibilityID.swift in Sources */, 68FF77C72B81C4A300B8F561 /* Pager.swift in Sources */, + 68435FE12C8EE19B000B7737 /* AmityCommunityImageFeedComponent.swift in Sources */, A97A443A2C2D2D4D0017327D /* AnimatedImageView.swift in Sources */, 684097DC2B30942F00697E1B /* DownloadTypes.swift in Sources */, A97A441A2C2D2D4D0017327D /* ImageFormat.swift in Sources */, @@ -3034,8 +3048,10 @@ 6877D3A12C7C849E008B3598 /* AmityCommunityNotificationSettingPage.swift in Sources */, 684098252B313A6F00697E1B /* VideoDownloader.swift in Sources */, A97188462B7F382F00B1BCA2 /* AmityLiveChatHeader.swift in Sources */, + 686830242C915DFC009B1694 /* TimeInterval+Extension.swift in Sources */, 685CE26E2B67665E00AF8F54 /* AmityCommentTrayComponent.swift in Sources */, A97A44182C2D2D4D0017327D /* Image.swift in Sources */, + 68435FE32C8EFC9A000B7737 /* AmityCommunityMediaFeedViewModel.swift in Sources */, 921C3FC92C379F3E00BF403E /* AmityPostContentComponentBehavior.swift in Sources */, 687A69C62B5F77ED00C17B6D /* AmityHyperLinkConfigComponent.swift in Sources */, A9AD73B32B8759F3009D6C19 /* ExpandableTextEditorView.swift in Sources */, @@ -3359,7 +3375,7 @@ /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ - 9255224F2C9C2DF200AD85B5 /* SharedFrameworks */ = { + 925522572CA5651700AD85B5 /* SharedFrameworks */ = { isa = XCSwiftPackageProductDependency; productName = SharedFrameworks; }; diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/communityProfileEmptyImageIcon.imageset/Contents.json b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/communityProfileEmptyImageIcon.imageset/Contents.json new file mode 100644 index 0000000..43512a2 --- /dev/null +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/communityProfileEmptyImageIcon.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "community_profile_empty_image_icon.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/communityProfileEmptyImageIcon.imageset/community_profile_empty_image_icon.svg b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/communityProfileEmptyImageIcon.imageset/community_profile_empty_image_icon.svg new file mode 100644 index 0000000..562a142 --- /dev/null +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/communityProfileEmptyImageIcon.imageset/community_profile_empty_image_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/communityProfileEmptyVideoIcon.imageset/Contents.json b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/communityProfileEmptyVideoIcon.imageset/Contents.json new file mode 100644 index 0000000..39c636a --- /dev/null +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/communityProfileEmptyVideoIcon.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "community_profile_empty_video_icon.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/communityProfileEmptyVideoIcon.imageset/community_profile_empty_video_icon.svg b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/communityProfileEmptyVideoIcon.imageset/community_profile_empty_video_icon.svg new file mode 100644 index 0000000..261f8bf --- /dev/null +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/communityProfileEmptyVideoIcon.imageset/community_profile_empty_video_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/imageFeedIcon.imageset/Contents.json b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/imageFeedIcon.imageset/Contents.json new file mode 100644 index 0000000..95140a5 --- /dev/null +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/imageFeedIcon.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "image_feed_icon.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/imageFeedIcon.imageset/image_feed_icon.svg b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/imageFeedIcon.imageset/image_feed_icon.svg new file mode 100644 index 0000000..f129bb1 --- /dev/null +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/imageFeedIcon.imageset/image_feed_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/videoFeedIcon.imageset/Contents.json b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/videoFeedIcon.imageset/Contents.json new file mode 100644 index 0000000..dff6b32 --- /dev/null +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/videoFeedIcon.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "video_feed_icon.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/videoFeedIcon.imageset/video_feed_icon.svg b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/videoFeedIcon.imageset/video_feed_icon.svg new file mode 100644 index 0000000..faabdf3 --- /dev/null +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Assets.xcassets/videoFeedIcon.imageset/video_feed_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/CustomViewModifiers/CustomViewModifiers.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/CustomViewModifiers/CustomViewModifiers.swift index f9d68c0..160aa2d 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/CustomViewModifiers/CustomViewModifiers.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/CustomViewModifiers/CustomViewModifiers.swift @@ -68,6 +68,10 @@ extension View { .debounce(for: .seconds(0.1), scheduler: RunLoop.main) .eraseToAnyPublisher() } + + func adaptiveVerticalPadding(top: CGFloat = 0, bottom: CGFloat = 0) -> some View { + self.modifier(AdaptiveVerticalPadding(top: top, bottom: bottom)) + } } // MARK: Button @@ -181,3 +185,44 @@ struct HiddenListSeparator: ViewModifier { } } } + +struct AdaptiveVerticalPadding: ViewModifier { + let additionalTopPadding: CGFloat + let additionalBottomPadding: CGFloat + @State private var topPadding: CGFloat = 0 + @State private var bottomPadding: CGFloat = 0 + + init(top: CGFloat = 0, bottom: CGFloat = 0) { + self.additionalTopPadding = top + self.additionalBottomPadding = bottom + } + + func body(content: Content) -> some View { + content + .padding(.top, topPadding) + .padding(.bottom, bottomPadding) + .edgesIgnoringSafeArea([.top, .bottom]) + .onAppear { + calculatePadding() + } + } + + private func calculatePadding() { + guard let window = UIApplication.shared.windows.first else { return } + let safeAreaInsets = window.safeAreaInsets + + + // For devices with a notch or home indicator + if additionalTopPadding > 0 { + topPadding = safeAreaInsets.top > 20 ? safeAreaInsets.top + additionalTopPadding : additionalTopPadding + } else { + topPadding = 0 + } + + if additionalBottomPadding > 0 { + bottomPadding = safeAreaInsets.bottom > 0 ? safeAreaInsets.bottom + additionalBottomPadding : additionalBottomPadding + } else { + bottomPadding = 0 + } + } +} diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/CustomViews/AVPlayerView.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/CustomViews/AVPlayerView.swift index fa59461..f9dcc89 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/CustomViews/AVPlayerView.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/CustomViews/AVPlayerView.swift @@ -11,9 +11,11 @@ import SwiftUI struct AVPlayerView: UIViewControllerRepresentable { private let url: URL + private let autoPlay: Bool - init(url: URL) { + init(url: URL, autoPlay: Bool = true) { self.url = url + self.autoPlay = autoPlay } func makeUIViewController(context: Context) -> AVPlayerViewController { @@ -27,7 +29,9 @@ struct AVPlayerView: UIViewControllerRepresentable { let vc = AVPlayerViewController() vc.player = player - player.play() + if autoPlay { + player.play() + } return vc } diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Extensions/Int+Extension.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Extensions/Int+Extension.swift index cd5cc32..37b6bc1 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Extensions/Int+Extension.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Extensions/Int+Extension.swift @@ -25,7 +25,7 @@ extension Int { switch num { case 1_000_000_000...: - guard num.remainder(dividingBy: 1_000_000_000) >= 100_000_000 else { + guard num > 1_100_000_000 else { return "1B" } @@ -33,7 +33,7 @@ extension Int { return String(format: "%.1fB", kCount) case 1_000_000...: - guard num.remainder(dividingBy: 1_000_000) >= 100_000 else { + guard num > 1_100_000 else { return "1M" } @@ -41,7 +41,7 @@ extension Int { return String(format: "%.1fM", kCount) case 1_000...: - guard num.remainder(dividingBy: 1_000) >= 100 else { + guard num > 1100 else { return "1K" } diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Extensions/TimeInterval+Extension.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Extensions/TimeInterval+Extension.swift new file mode 100644 index 0000000..f65814d --- /dev/null +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Extensions/TimeInterval+Extension.swift @@ -0,0 +1,18 @@ +// +// TimeInterval+Extension.swift +// AmityUIKit4 +// +// Created by Zay Yar Htun on 9/11/24. +// + +import Foundation + +extension TimeInterval { + var formattedDurationString: String? { + let formatter = DateComponentsFormatter() + formatter.unitsStyle = .positional + formatter.allowedUnits = self >= 3600 ? [.hour, .minute, .second] : [.minute, .second] + formatter.zeroFormattingBehavior = .pad + return formatter.string(from: self) + } +} diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Managers/PostManager.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Managers/PostManager.swift index b04fc5c..f6e7618 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Managers/PostManager.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Managers/PostManager.swift @@ -8,6 +8,10 @@ import Foundation import AmitySDK +enum PostTypeFilter: String { + case image, video +} + class PostManager { private let postRepository = AmityPostRepository(client: AmityUIKitManagerInternal.shared.client) @@ -16,6 +20,10 @@ class PostManager { postRepository.getPost(withId: withId) } + func getPosts(options: AmityPostQueryOptions) -> AmityCollection { + postRepository.getPosts(options) + } + @discardableResult func deletePost(withId: String) async throws -> Bool { try await postRepository.hardDeletePost(withId: withId, parentId: nil) diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Utilities/AmityIcon.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Utilities/AmityIcon.swift index ab3eb37..d578df7 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Utilities/AmityIcon.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Utilities/AmityIcon.swift @@ -125,9 +125,13 @@ enum AmityIcon: String, ImageResourceProvider { case communityProfilePlaceholder = "communityProfilePlaceholder" case communityFeedIcon = "communityFeedIcon" case communityPinIcon = "communityPinIcon" + case communityImageFeedIcon = "imageFeedIcon" + case communityVideoFeedIcon = "videoFeedIcon" case communityAnnouncementBadge = "communityAnnouncementBadge" case communityPinBadge = "communityPinBadge" case communityProfileEmptyPostIcon = "communityProfileEmptyPostIcon" + case communityProfileEmptyImageIcon = "communityProfileEmptyImageIcon" + case communityProfileEmptyVideoIcon = "communityProfileEmptyVideoIcon" case communityPendingPostIcon = "communityPendingPostIcon" case tickIcon = "tickIcon" case communityCategoryPlaceholder = "categoriesPlaceholder" diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Utilities/Constants/AmityViewId.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Utilities/Constants/AmityViewId.swift index 254f6f0..75ad6b2 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Utilities/Constants/AmityViewId.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/Utilities/Constants/AmityViewId.swift @@ -72,6 +72,7 @@ public enum ComponentId: String { case communityPin = "community_pin" case mediaAttachment = "media_attachment" case detailedMediaAttachment = "detailed_media_attachment" + case communityImageFeed = "community_image_feed" case recommendedCommunities = "recommended_communities" case trendingCommunities = "trending_communities" diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityFeedComponent.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityFeedComponent.swift index 270ab5c..7ac0a72 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityFeedComponent.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityFeedComponent.swift @@ -111,7 +111,7 @@ public struct AmityCommunityFeedComponent: AmityComponentView { .listRowInsets(EdgeInsets()) .modifier(HiddenListSeparator()) .onAppear { - if index == postFeedViewModel.postItems.count - 1 { + if index == postFeedViewModel.postItems.filter({$0.id != communityProfileViewModel.announcementPost?.postId ?? ""}).count - 1 { postFeedViewModel.loadMorePosts() } } diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityImageFeedComponent.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityImageFeedComponent.swift new file mode 100644 index 0000000..f011231 --- /dev/null +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityImageFeedComponent.swift @@ -0,0 +1,111 @@ +// +// AmityCommunityImageFeedComponent.swift +// AmityUIKit4 +// +// Created by Zay Yar Htun on 9/9/24. +// + +import SwiftUI + +public struct AmityCommunityImageFeedComponent: AmityComponentView { + public var id: ComponentId { + .communityImageFeed + } + + public var pageId: PageId? + @StateObject private var viewModel: MediaFeedViewModel + @StateObject private var viewConfig: AmityViewConfigController + + private var gridLayout: [GridItem] { + [ + GridItem(.flexible(), spacing: 8), + GridItem(.flexible(), spacing: 8) + ] + } + + init(communityId: String, communityProfileViewModel: CommunityProfileViewModel? = nil, pageId: PageId? = nil) { + self.pageId = pageId + self._viewConfig = StateObject(wrappedValue: AmityViewConfigController(pageId: pageId, componentId: .communityImageFeed)) + + if let communityProfileViewModel { + self._viewModel = StateObject(wrappedValue: communityProfileViewModel.mediaFeedViewModel) + } else { + self._viewModel = StateObject(wrappedValue: MediaFeedViewModel(feedType: .community(communityId: communityId))) + } + } + + public var body: some View { + ZStack(alignment: .top) { + imageFeedView + .isHidden(viewModel.medias.isEmpty && viewModel.loadingStatus == .loaded) + + EmptyCommunityFeedView(.image) + .isHidden(!(viewModel.medias.isEmpty && viewModel.loadingStatus == .loaded)) + } + .onAppear { + viewModel.loadMediaFeed(.image) + } + .updateTheme(with: viewConfig) + } + + @ViewBuilder + private var imageFeedView: some View { + VStack(spacing: 0) { + Color.clear + .frame(height: 8) + + LazyVGrid(columns: gridLayout, spacing: 8) { + ForEach(Array(viewModel.medias.enumerated()), id: \.element.id) { index, media in + if let url = media.getImageURL() { + getImageView(url) + .frame(maxWidth: .infinity) + .aspectRatio(1, contentMode: .fit) + .background(Color.gray) + .cornerRadius(10) + .onTapGesture { + viewModel.selectedMediaIndex = index + withoutAnimation { + viewModel.showMediaViewer.toggle() + } + } + .onAppear { + if index == viewModel.medias.count - 1 { + viewModel.loadMore() + } + } + } + } + } + .padding(.horizontal, 8) + .fullScreenCover(isPresented: $viewModel.showMediaViewer) { + MediaViewer(medias: [viewModel.medias[viewModel.selectedMediaIndex]], startIndex: 0, closeAction: { viewModel.showMediaViewer.toggle() }) + } + } + } + + @ViewBuilder + private func getImageView(_ url: URL) -> some View { + let emptyView = Color(viewConfig.theme.baseColorShade4) + Color.clear + .overlay( + URLImage(url, empty: { + emptyView + }, + inProgress: {_ in + emptyView + }, + failure: {_, _ in + emptyView + }, + content: { image in + image + .resizable() + .scaledToFill() + }) + .environment(\.urlImageOptions, URLImageOptions.amityOptions) + ) + .compositingGroup() + .clipped() + .contentShape(Rectangle()) + } +} diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityMediaFeedViewModel.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityMediaFeedViewModel.swift new file mode 100644 index 0000000..4c67ecb --- /dev/null +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityMediaFeedViewModel.swift @@ -0,0 +1,68 @@ +// +// AmityCommunityMediaFeedViewModel.swift +// AmityUIKit4 +// +// Created by Zay Yar Htun on 9/9/24. +// + +import Foundation +import AmitySDK +import Combine +import UIKit + +enum MediaFeedType: Equatable { + case community(communityId: String) + case user(userId: String) +} + +class MediaFeedViewModel: ObservableObject { + @Published var medias: [AmityMedia] = [] + @Published var loadingStatus: AmityLoadingStatus = .notLoading + private let feedType: MediaFeedType + private var cancellable: AnyCancellable? + private var loadingCancellable: AnyCancellable? + private let postManager = PostManager() + private var postCollection: AmityCollection? + + @Published var showMediaViewer: Bool = false + var selectedMediaIndex: Int = 0 + var videoURL: URL? = nil + + init(feedType: MediaFeedType) { + self.feedType = feedType + } + + func loadMediaFeed(_ type: PostTypeFilter) { + let queryOptions: AmityPostQueryOptions + + switch feedType { + case .community(let communityId): + queryOptions = AmityPostQueryOptions(targetType: .community, targetId: communityId, sortBy: .lastCreated, deletedOption: .notDeleted, filterPostTypes: [type.rawValue]) + case .user(let userId): + queryOptions = AmityPostQueryOptions(targetType: .user, targetId: userId, sortBy: .lastCreated, deletedOption: .notDeleted, filterPostTypes: [type.rawValue]) + } + + postCollection = postManager.getPosts(options: queryOptions) + cancellable = postCollection?.$snapshots + .sink(receiveValue: { [weak self] posts in + self?.medias.removeAll() + + // Traverse all post to prepare the data soruce. + self?.medias.append(contentsOf: posts.flatMap { post -> [AmityMedia] in + let model = AmityPostModel(post: post) + return model.medias + }) + + }) + + loadingCancellable = postCollection?.$loadingStatus + .sink(receiveValue: { [weak self] status in + self?.loadingStatus = status + }) + } + + func loadMore() { + guard let postCollection, postCollection.hasNext else { return } + postCollection.nextPage() + } +} diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityVideoFeedComponent.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityVideoFeedComponent.swift new file mode 100644 index 0000000..7ff50dd --- /dev/null +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityVideoFeedComponent.swift @@ -0,0 +1,133 @@ +// +// AmityCommunityVideoFeedComponent.swift +// AmityUIKit4 +// +// Created by Zay Yar Htun on 9/11/24. +// + +import SwiftUI + +public struct AmityCommunityVideoFeedComponent: AmityComponentView { + public var pageId: PageId? + @StateObject private var viewModel: MediaFeedViewModel + @StateObject private var viewConfig: AmityViewConfigController + + public var id: ComponentId { + .commentTrayComponent + } + + private var gridLayout: [GridItem] { + [ + GridItem(.flexible(), spacing: 8), + GridItem(.flexible(), spacing: 8) + ] + } + + init(communityId: String, communityProfileViewModel: CommunityProfileViewModel? = nil, pageId: PageId? = nil) { + self.pageId = pageId + self._viewConfig = StateObject(wrappedValue: AmityViewConfigController(pageId: pageId, componentId: .communityImageFeed)) + + if let communityProfileViewModel { + self._viewModel = StateObject(wrappedValue: communityProfileViewModel.mediaFeedViewModel) + } else { + self._viewModel = StateObject(wrappedValue: MediaFeedViewModel(feedType: .community(communityId: communityId))) + } + } + + public var body: some View { + ZStack(alignment: .top) { + videoFeedView + .isHidden(viewModel.medias.isEmpty && viewModel.loadingStatus == .loaded) + + EmptyCommunityFeedView(.video) + .isHidden(!(viewModel.medias.isEmpty && viewModel.loadingStatus == .loaded)) + } + .onAppear { + viewModel.loadMediaFeed(.video) + } + .updateTheme(with: viewConfig) + } + + @ViewBuilder + private var videoFeedView: some View { + VStack(spacing: 0) { + Color.clear + .frame(height: 8) + + LazyVGrid(columns: gridLayout, spacing: 8) { + ForEach(Array(viewModel.medias.enumerated()), id: \.element.id) { index, media in + if let url = media.getImageURL(), + let attributes = media.video?.attributes, + let meta = attributes["metadata"] as? [String: Any], + let videoMeta = meta["video"] as? [String: Any], + let duration = videoMeta["duration"] as? TimeInterval { + getVideoView(url, duration) + .frame(maxWidth: .infinity) + .aspectRatio(1, contentMode: .fit) + .background(Color.gray) + .cornerRadius(10) + .onTapGesture { + if let urlStr = media.video?.getVideo(resolution: .original) { + viewModel.videoURL = URL(string: urlStr) + } else { + viewModel.videoURL = URL(string: media.video?.fileURL ?? "") + } + + viewModel.showMediaViewer.toggle() + } + .onAppear { + if index == viewModel.medias.count - 1 { + viewModel.loadMore() + } + } + } + + } + } + .padding(.horizontal, 8) + .fullScreenCover(isPresented: $viewModel.showMediaViewer) { + if let videoURL = viewModel.videoURL { + AVPlayerView(url: videoURL, autoPlay: false) + .ignoresSafeArea(.all) + } + } + } + } + + @ViewBuilder + private func getVideoView(_ url: URL, _ duration: TimeInterval) -> some View { + let emptyView = Color(viewConfig.theme.baseColorShade4) + ZStack(alignment: .bottomLeading) { + Color.clear + .overlay( + URLImage(url, empty: { + emptyView + }, + inProgress: {_ in + emptyView + }, + failure: {_, _ in + emptyView + }, + content: { image in + image + .resizable() + .scaledToFill() + }) + .environment(\.urlImageOptions, URLImageOptions.amityOptions) + ) + .compositingGroup() + .clipped() + .contentShape(Rectangle()) + + Text("\(duration.formattedDurationString ?? "0:00")") + .font(.system(size: 13.0)) + .foregroundColor(.white) + .padding(.all, 4) + .background(Color.black.opacity(0.7)) + .cornerRadius(4) + .padding([.leading, .bottom], 8) + } + + } +} diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/EmptyCommunityFeedView.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/EmptyCommunityFeedView.swift index 348d43d..292621f 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/EmptyCommunityFeedView.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/EmptyCommunityFeedView.swift @@ -7,24 +7,53 @@ import SwiftUI +public enum EmptyCommunityFeedViewType { + case post, image, video + + var icon: ImageResource { + switch self { + case .post: + AmityIcon.communityProfileEmptyPostIcon.imageResource + case .image: + AmityIcon.communityProfileEmptyImageIcon.imageResource + case .video: + AmityIcon.communityProfileEmptyVideoIcon.imageResource + } + } + + var description: String { + switch self { + case .post: + "No post yet" + case .image: + "No photo yet" + case .video: + "No video yet" + } + } +} + public struct EmptyCommunityFeedView: View { @StateObject private var viewConfig: AmityViewConfigController - public init() { + private let feedViewType: EmptyCommunityFeedViewType + + public init(_ type: EmptyCommunityFeedViewType = .post) { self._viewConfig = StateObject(wrappedValue: AmityViewConfigController(pageId: nil, componentId: nil)) + self.feedViewType = type } public var body: some View { VStack(spacing: 0) { - Image(AmityIcon.communityProfileEmptyPostIcon.imageResource) + Image(feedViewType.icon) .renderingMode(.template) .frame(width: 60, height: 60) .foregroundColor(Color(viewConfig.theme.baseColorShade4)) .padding(.top, 24) - Text("No post yet") - .font(.system(size: 17)) + Text(feedViewType.description) + .font(.system(size: 17, weight: .semibold)) .padding(.top, 8) .padding(.bottom, 24) .foregroundColor(Color(viewConfig.theme.baseColorShade3)) @@ -32,7 +61,7 @@ public struct EmptyCommunityFeedView: View { } .background(Color(viewConfig.theme.backgroundColor)) .padding(.horizontal, 16) - .padding(.vertical, 175) + .padding(.top, 110) .frame(maxWidth: 387) .updateTheme(with: viewConfig) } diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/PostDetail/AmityPostContentComponent.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/PostDetail/AmityPostContentComponent.swift index 692b883..33cf979 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/PostDetail/AmityPostContentComponent.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/PostDetail/AmityPostContentComponent.swift @@ -82,6 +82,7 @@ public struct AmityPostContentComponent: AmityComponentView { HStack { Text("Featured") .font(.system(size: 15, weight: .medium)) + .foregroundColor(Color(viewConfig.defaultLightTheme.baseColor)) .padding(.horizontal, 8) .padding(.vertical, 6) diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/PostDetail/PostContent/MediaViewer.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/PostDetail/PostContent/MediaViewer.swift index d228b32..dde8db2 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/PostDetail/PostContent/MediaViewer.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/PostDetail/PostContent/MediaViewer.swift @@ -41,19 +41,29 @@ struct MediaViewer: View { Pager(page: page, data: medias, id: \.id) { media in ZStack { + let emptyView = Color(hex: "#EBECEF").padding(.vertical, 100) /// If the media is local file, it will load from local file path. /// When MediaViewer is used to preview attached medias in AmityComposePage, media will have localUrl. if let url = media.localUrl { Image(uiImage: media.type == .image ? UIImage(contentsOfFile: url.path) ?? UIImage() : media.generatedThumbnailImage ?? UIImage()) .resizable() .aspectRatio(contentMode: .fit) + .adaptiveVerticalPadding(top: 35, bottom: 35) } else if let url = media.getImageURL() { - URLImage(url, content: { image in + URLImage(url, empty: { + emptyView + }, inProgress: {_ in + emptyView + }, + failure: {_, _ in + emptyView + }, content: { image in image .resizable() .aspectRatio(contentMode: .fit) }) .environment(\.urlImageOptions, URLImageOptions.amityOptions) + .adaptiveVerticalPadding(top: 35, bottom: 35) } if media.type == .video { @@ -65,7 +75,14 @@ struct MediaViewer: View { } .onTapGesture { if media.type == .video { - viewModel.videoURL = media.localUrl ?? URL(string: media.video?.getVideo(resolution: .original) ?? "") + let url: URL? + if let urlStr = media.video?.getVideo(resolution: .original) { + url = URL(string: urlStr) + } else { + url = URL(string: media.video?.fileURL ?? "") + } + + viewModel.videoURL = media.localUrl ?? url showVideoPlayer.toggle() } } @@ -130,14 +147,15 @@ struct MediaViewer: View { Spacer() } - .offset(x: 20, y: 30) + .padding(.leading, 16) Text("\(pageIndex) / \(page.totalPages)") .font(.system(size: 17)) .foregroundColor(.white) - .offset(y: 30) + .isHidden(page.totalPages == 1) } - .frame(height: 110) + .adaptiveVerticalPadding(top: 20) + .padding(.bottom, 15) .background(Color.black.opacity(0.5)) .opacity(backgroundOpacity == 1.0 ? 1.0 : 0) .transition(.opacity.combined(with: .scale)) diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Models/AmityPostModel.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Models/AmityPostModel.swift index 9915bbc..8221fa1 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Models/AmityPostModel.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Models/AmityPostModel.swift @@ -390,53 +390,60 @@ public class AmityPostModel: Identifiable { text = data[DataType.text.rawValue] as? String ?? "" dataTypeInternal = DataType(rawValue: dataType) ?? .unknown - // Get images/files for post if any + // Get media data if parent post itself is not text type. + // If the posts are queried with a specific data type, parent post is the post of data type and it does not have any child posts. + if childrenPosts.isEmpty && object.dataType != "text" { + prepareData(object) + } - for aChild in childrenPosts { - switch aChild.dataType { - case "image": - if let imageData = aChild.getImageInfo() { - let state = AmityMediaState.downloadableImage( - imageData: imageData, - placeholder: UIImage() - ) - let media = AmityMedia(state: state, type: .image) - media.image = imageData - medias.append(media) - fileMap[imageData.fileId] = aChild.postId - dataTypeInternal = .image - } - case "file": break + for childPost in childrenPosts { + prepareData(childPost) + } + } + + private func prepareData(_ post: AmityPost) { + switch post.dataType { + case "image": + if let imageData = post.getImageInfo() { + let state = AmityMediaState.downloadableImage( + imageData: imageData, + placeholder: UIImage() + ) + let media = AmityMedia(state: state, type: .image) + media.image = imageData + medias.append(media) + fileMap[imageData.fileId] = post.postId + dataTypeInternal = .image + } + case "file": break // if let fileData = aChild.getFileInfo() { // let tempFile = AmityFile(state: .downloadable(fileData: fileData)) // files.append(tempFile) // fileMap[fileData.fileId] = aChild.postId // dataTypeInternal = .file // } - case "video": - if let videoData = aChild.getVideoInfo() { - let thumbnail = aChild.getVideoThumbnailInfo() - let state = AmityMediaState.downloadableVideo( - videoData: videoData, - thumbnailUrl: thumbnail?.fileURL - ) - let media = AmityMedia(state: state, type: .video) - media.video = videoData - medias.append(media) - fileMap[videoData.fileId] = aChild.postId - dataTypeInternal = .video - } - case "poll": break + case "video": + if let videoData = post.getVideoInfo() { + let thumbnail = post.getVideoThumbnailInfo() + let state = AmityMediaState.downloadableVideo( + videoData: videoData, + thumbnailUrl: thumbnail?.fileURL + ) + let media = AmityMedia(state: state, type: .video) + media.video = videoData + medias.append(media) + fileMap[videoData.fileId] = post.postId + dataTypeInternal = .video + } + case "poll": break // dataTypeInternal = .poll - case "liveStream": - if let liveStreamData = aChild.getLiveStreamInfo() { - liveStream = liveStreamData - dataTypeInternal = .liveStream - } - default: - dataTypeInternal = .unknown + case "liveStream": + if let liveStreamData = post.getLiveStreamInfo() { + liveStream = liveStreamData + dataTypeInternal = .liveStream } + default: + dataTypeInternal = .unknown } } - } diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityAddCategoryPage.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityAddCategoryPage.swift index da0ac38..876027a 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityAddCategoryPage.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityAddCategoryPage.swift @@ -76,6 +76,7 @@ public struct AmityCommunityAddCategoryPage: AmityPageView { .padding(.bottom, 10) } .background(Color(viewConfig.theme.backgroundColor).ignoresSafeArea()) + .updateTheme(with: viewConfig) } private var navigationBarView: some View { diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityAddUserPage.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityAddUserPage.swift index 4ffa3fe..bfbe347 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityAddUserPage.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityAddUserPage.swift @@ -84,6 +84,7 @@ public struct AmityCommunityAddUserPage: AmityPageView { .padding(.bottom, 10) } .background(Color(viewConfig.theme.backgroundColor).ignoresSafeArea()) + .updateTheme(with: viewConfig) } private var navigationBarView: some View { diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityMembershipPage.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityMembershipPage.swift index eb53bd3..5bc2f23 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityMembershipPage.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityMembershipPage.swift @@ -68,7 +68,7 @@ public struct AmityCommunityMembershipPage: AmityPageView { host.controller?.navigationController?.isNavigationBarHidden = true } .background(Color(viewConfig.theme.backgroundColor).ignoresSafeArea()) - + .updateTheme(with: viewConfig) } diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityPostPermissionPage.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityPostPermissionPage.swift index 2bf577c..1f907ac 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityPostPermissionPage.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityPostPermissionPage.swift @@ -39,6 +39,7 @@ public struct AmityCommunityPostPermissionPage: AmityPageView { host.controller?.navigationController?.isNavigationBarHidden = true } .background(Color(viewConfig.theme.backgroundColor).ignoresSafeArea()) + .updateTheme(with: viewConfig) } private var navigationBarView: some View { diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityProfilePage.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityProfilePage.swift index a6e8fab..cd49cd5 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityProfilePage.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityProfilePage.swift @@ -105,7 +105,13 @@ public struct AmityCommunityProfilePage: AmityPageView { let context = AmityCommunityProfilePageBehavior.Context(page: self) AmityUIKitManagerInternal.shared.behavior.communityProfilePageBehavior?.goToPostDetailPage(context: context, post: post, category: category) }) - .isHidden(currentTab != 1 ) + .isHidden(currentTab != 1) + + AmityCommunityImageFeedComponent(communityId: communityId, communityProfileViewModel: viewModel, pageId: .communityProfilePage) + .isHidden(currentTab != 2) + + AmityCommunityVideoFeedComponent(communityId: communityId, communityProfileViewModel: viewModel, pageId: .communityProfilePage) + .isHidden(currentTab != 3) } .offset(y: 0) diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunitySettingPage.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunitySettingPage.swift index 1943c6a..d8f5630 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunitySettingPage.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunitySettingPage.swift @@ -32,6 +32,7 @@ public struct AmityCommunitySettingPage: AmityPageView { Text(AmityLocalizedStringSet.Social.communitySettingBasicInfoTitle.localizedString) .font(.system(size: 17, weight: .semibold)) .frame(maxWidth: .infinity, alignment: .leading) + .foregroundColor(Color(viewConfig.theme.baseColor)) /// Edit Profile setting if viewModel.shouldShowEditProfile { @@ -71,6 +72,7 @@ public struct AmityCommunitySettingPage: AmityPageView { Text(AmityLocalizedStringSet.Social.communitySettingCommunityPermissionsTitle.localizedString) .font(.system(size: 17, weight: .semibold)) .frame(maxWidth: .infinity, alignment: .leading) + .foregroundColor(Color(viewConfig.theme.baseColor)) } /// Post Permissions setting @@ -165,6 +167,7 @@ public struct AmityCommunitySettingPage: AmityPageView { } .padding([.leading, .trailing], 16) .background(Color(viewConfig.theme.backgroundColor).ignoresSafeArea()) + .updateTheme(with: viewConfig) } private var navigationBarView: some View { diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunitySetupPage.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunitySetupPage.swift index c04a10e..795b583 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunitySetupPage.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunitySetupPage.swift @@ -222,6 +222,7 @@ public struct AmityCommunitySetupPage: AmityPageView { host.controller?.navigationController?.isNavigationBarHidden = true } .background(Color(viewConfig.theme.backgroundColor).ignoresSafeArea()) + .updateTheme(with: viewConfig) } private var navigationBarView: some View { diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityStorySettingPage.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityStorySettingPage.swift index 16cd314..1790821 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityStorySettingPage.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunityStorySettingPage.swift @@ -49,6 +49,7 @@ public struct AmityCommunityStorySettingPage: AmityPageView { host.controller?.navigationController?.isNavigationBarHidden = true } .background(Color(viewConfig.theme.backgroundColor).ignoresSafeArea()) + .updateTheme(with: viewConfig) } private var navigationBarView: some View { diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/ChildView/AmityCommunityProfileTabComponent.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/ChildView/AmityCommunityProfileTabComponent.swift index 18e137d..bf5f48a 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/ChildView/AmityCommunityProfileTabComponent.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/ChildView/AmityCommunityProfileTabComponent.swift @@ -26,25 +26,29 @@ public struct AmityCommunityProfileTabComponent: AmityComponentView { } public var body: some View { - ScrollView(.horizontal, showsIndicators: false) { - HStack(spacing: 20) { - - let feedIcon = AmityIcon.getImageResource(named: viewConfig.getConfig(elementId: .communityFeedTabButton, key: "image", of: String.self) ?? "") - - let feedTabItem = CommunityPageTabItem(index: 0, image: feedIcon) - - CommunityPageTabBarItemView(currentTab: $currentTab, namespace: namespace.self, tabItem: feedTabItem) - .isHidden(viewConfig.isHidden(elementId: .communityFeedTabButton)) - - let pinIcon = AmityIcon.getImageResource(named: viewConfig.getConfig(elementId: .communityPinTabButton, key: "image", of: String.self) ?? "") - let pinTabItem = CommunityPageTabItem(index: 1, image: pinIcon) - CommunityPageTabBarItemView(currentTab: $currentTab, namespace: namespace.self, tabItem: pinTabItem) - .isHidden(viewConfig.isHidden(elementId: .communityPinTabButton)) - } - .padding(.horizontal) + HStack(spacing: 20) { + let feedIcon = AmityIcon.getImageResource(named: viewConfig.getConfig(elementId: .communityFeedTabButton, key: "image", of: String.self) ?? "") + let feedTabItem = CommunityPageTabItem(index: 0, image: feedIcon) + CommunityPageTabBarItemView(currentTab: $currentTab, namespace: namespace.self, tabItem: feedTabItem) + .isHidden(viewConfig.isHidden(elementId: .communityFeedTabButton)) + + let pinIcon = AmityIcon.getImageResource(named: viewConfig.getConfig(elementId: .communityPinTabButton, key: "image", of: String.self) ?? "") + let pinTabItem = CommunityPageTabItem(index: 1, image: pinIcon) + CommunityPageTabBarItemView(currentTab: $currentTab, namespace: namespace.self, tabItem: pinTabItem) + .isHidden(viewConfig.isHidden(elementId: .communityPinTabButton)) + + let imageFeedTabIcon = AmityIcon.communityImageFeedIcon.getImageResource() + let imageFeedTabItem = CommunityPageTabItem(index: 2, image: imageFeedTabIcon) + CommunityPageTabBarItemView(currentTab: $currentTab, namespace: namespace.self, tabItem: imageFeedTabItem) + + let videoFeedTabIcon = AmityIcon.communityVideoFeedIcon.getImageResource() + let videoFeedTabItem = CommunityPageTabItem(index: 3, image: videoFeedTabIcon) + CommunityPageTabBarItemView(currentTab: $currentTab, namespace: namespace.self, tabItem: videoFeedTabItem) } + .padding(.horizontal) .padding(.top, 8) .background(Color(viewConfig.theme.backgroundColor)) + .updateTheme(with: viewConfig) } } @@ -68,7 +72,6 @@ struct CommunityPageTabBarItemView: View { .frame(width: 24, height: 24) .foregroundColor(currentTab == tabItem.index ? Color(viewConfig.theme.baseColor) : Color(viewConfig.theme.baseColorShade3)) } - .frame(width: 70) .padding(.bottom, 12) // Underline diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityNotification/AmityCommunityCommentsNotificationSettingPage.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityNotification/AmityCommunityCommentsNotificationSettingPage.swift index 174d48e..beed33f 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityNotification/AmityCommunityCommentsNotificationSettingPage.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityNotification/AmityCommunityCommentsNotificationSettingPage.swift @@ -58,6 +58,7 @@ public struct AmityCommunityCommentsNotificationSettingPage: AmityPageView { host.controller?.navigationController?.isNavigationBarHidden = true } .background(Color(viewConfig.theme.backgroundColor).ignoresSafeArea()) + .updateTheme(with: viewConfig) } private var navigationBarView: some View { diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityNotification/AmityCommunityNotificationSettingPage.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityNotification/AmityCommunityNotificationSettingPage.swift index 89d53f9..72bbf3d 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityNotification/AmityCommunityNotificationSettingPage.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityNotification/AmityCommunityNotificationSettingPage.swift @@ -51,6 +51,7 @@ public struct AmityCommunityNotificationSettingPage: AmityPageView { host.controller?.navigationController?.isNavigationBarHidden = true } .background(Color(viewConfig.theme.backgroundColor).ignoresSafeArea()) + .updateTheme(with: viewConfig) } @ViewBuilder diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityNotification/AmityCommunityPostsNotificationSettingPage.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityNotification/AmityCommunityPostsNotificationSettingPage.swift index d2cf9ab..59830b7 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityNotification/AmityCommunityPostsNotificationSettingPage.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityNotification/AmityCommunityPostsNotificationSettingPage.swift @@ -52,6 +52,7 @@ public struct AmityCommunityPostsNotificationSettingPage: AmityPageView { host.controller?.navigationController?.isNavigationBarHidden = true } .background(Color(viewConfig.theme.backgroundColor).ignoresSafeArea()) + .updateTheme(with: viewConfig) } private var navigationBarView: some View { diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityNotification/AmityCommunityStoriesNotificationSettingPage.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityNotification/AmityCommunityStoriesNotificationSettingPage.swift index 8f3e523..31b5dfe 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityNotification/AmityCommunityStoriesNotificationSettingPage.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityNotification/AmityCommunityStoriesNotificationSettingPage.swift @@ -58,6 +58,7 @@ public struct AmityCommunityStoriesNotificationSettingPage: AmityPageView { host.controller?.navigationController?.isNavigationBarHidden = true } .background(Color(viewConfig.theme.backgroundColor).ignoresSafeArea()) + .updateTheme(with: viewConfig) } private var navigationBarView: some View { diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityProfileViewModel.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityProfileViewModel.swift index de25dec..cde475f 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityProfileViewModel.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/CommunityProfileViewModel.swift @@ -36,10 +36,12 @@ public class CommunityProfileViewModel: ObservableObject { var hasStoryManagePermission: Bool = false var postFeedViewModel: PostFeedViewModel + var mediaFeedViewModel: MediaFeedViewModel public init(communityId: String) { self.communityId = communityId self.postFeedViewModel = PostFeedViewModel(feedType: .community(communityId: communityId)) + self.mediaFeedViewModel = MediaFeedViewModel(feedType: .community(communityId: communityId)) loadCommunity() loadStories() @@ -50,6 +52,10 @@ public class CommunityProfileViewModel: ObservableObject { } } + deinit { + URLImageService.defaultImageService.inMemoryStore?.removeAllImages() + } + func loadCommunity() { communityToken = nil communityToken = communityManger.getCommunity(withId: communityId).observe { [weak self] community, error in @@ -109,8 +115,12 @@ public class CommunityProfileViewModel: ObservableObject { if currentTab == 0 { loadPinnedFeed() postFeedViewModel.loadFeed(feedType: .community(communityId: communityId)) - } else { + } else if currentTab == 1 { loadPinnedFeed() + } else if currentTab == 2 { + mediaFeedViewModel.loadMediaFeed(.image) + } else if currentTab == 3 { + mediaFeedViewModel.loadMediaFeed(.video) } } diff --git a/UpstraUIKit/AmityUIKitLiveStream/AmityUIKitLiveStream.xcodeproj/project.pbxproj b/UpstraUIKit/AmityUIKitLiveStream/AmityUIKitLiveStream.xcodeproj/project.pbxproj index b060df0..60e1e1d 100644 --- a/UpstraUIKit/AmityUIKitLiveStream/AmityUIKitLiveStream.xcodeproj/project.pbxproj +++ b/UpstraUIKit/AmityUIKitLiveStream/AmityUIKitLiveStream.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 925522542C9C2E0100AD85B5 /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 925522532C9C2E0100AD85B5 /* SharedFrameworks */; }; + 9255225C2CA5654D00AD85B5 /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 9255225B2CA5654D00AD85B5 /* SharedFrameworks */; }; A0B68B3026E07278007D7B5B /* LiveStreamViewController+GoLive.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0B68B2F26E07278007D7B5B /* LiveStreamViewController+GoLive.swift */; }; A0B68B3626E07824007D7B5B /* AsyncOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0B68B3526E07824007D7B5B /* AsyncOperation.swift */; }; A0B68B3F26E07912007D7B5B /* CreatePost.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0B68B3E26E07912007D7B5B /* CreatePost.swift */; }; @@ -69,7 +69,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 925522542C9C2E0100AD85B5 /* SharedFrameworks in Frameworks */, + 9255225C2CA5654D00AD85B5 /* SharedFrameworks in Frameworks */, A0BD0B3426DDD9820054088B /* AmityUIKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -245,7 +245,7 @@ ); name = AmityUIKitLiveStream; packageProductDependencies = ( - 925522532C9C2E0100AD85B5 /* SharedFrameworks */, + 9255225B2CA5654D00AD85B5 /* SharedFrameworks */, ); productName = AmityUIKitLiveStream; productReference = A0BD0B1526DCE4F50054088B /* AmityUIKitLiveStream.framework */; @@ -529,7 +529,7 @@ /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ - 925522532C9C2E0100AD85B5 /* SharedFrameworks */ = { + 9255225B2CA5654D00AD85B5 /* SharedFrameworks */ = { isa = XCSwiftPackageProductDependency; productName = SharedFrameworks; }; diff --git a/UpstraUIKit/SampleApp/SampleApp.xcodeproj/project.pbxproj b/UpstraUIKit/SampleApp/SampleApp.xcodeproj/project.pbxproj index 2f20362..ea9d5c6 100644 --- a/UpstraUIKit/SampleApp/SampleApp.xcodeproj/project.pbxproj +++ b/UpstraUIKit/SampleApp/SampleApp.xcodeproj/project.pbxproj @@ -35,7 +35,7 @@ 729CAF3E273CC8ED000AE162 /* Binding+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 729CAF3D273CC8ED000AE162 /* Binding+Extension.swift */; }; 729CAF42273CC95B000AE162 /* EndpointManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 729CAF41273CC95B000AE162 /* EndpointManager.swift */; }; 72AACE0B273931F100E59D55 /* EndpointsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72AACE0A273931F100E59D55 /* EndpointsView.swift */; }; - 925522562C9C2E0D00AD85B5 /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 925522552C9C2E0D00AD85B5 /* SharedFrameworks */; }; + 9255225E2CA5655F00AD85B5 /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 9255225D2CA5655F00AD85B5 /* SharedFrameworks */; }; 92DBE8A62ACA98CF007D873C /* DataListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D495077325E637C1005C033F /* DataListViewController.swift */; }; 92DBE8A72ACA98CF007D873C /* SamplePageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 724C25F3274CE38B0058B066 /* SamplePageViewController.swift */; }; 92DBE8A82ACA98CF007D873C /* PostCreatorSettingsPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = A03190A6272169C1008A85DC /* PostCreatorSettingsPage.swift */; }; @@ -279,7 +279,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 925522562C9C2E0D00AD85B5 /* SharedFrameworks in Frameworks */, + 9255225E2CA5655F00AD85B5 /* SharedFrameworks in Frameworks */, A0BD0B4826DDE0E30054088B /* AmityUIKitLiveStream.framework in Frameworks */, 68F5D9FE2B481E4700A9FA0D /* AmityUIKit4.framework in Frameworks */, D478D16926240A5E006EA140 /* AmityUIKit.framework in Frameworks */, @@ -605,7 +605,7 @@ ); name = SampleApp; packageProductDependencies = ( - 925522552C9C2E0D00AD85B5 /* SharedFrameworks */, + 9255225D2CA5655F00AD85B5 /* SharedFrameworks */, ); productName = SampleApp; productReference = B78DA47524BED7D300EE902B /* SampleApp.app */; @@ -1288,7 +1288,7 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 925522552C9C2E0D00AD85B5 /* SharedFrameworks */ = { + 9255225D2CA5655F00AD85B5 /* SharedFrameworks */ = { isa = XCSwiftPackageProductDependency; productName = SharedFrameworks; }; diff --git a/UpstraUIKit/SharedFrameworks/Package.swift b/UpstraUIKit/SharedFrameworks/Package.swift index 126b5d7..4edfc13 100644 --- a/UpstraUIKit/SharedFrameworks/Package.swift +++ b/UpstraUIKit/SharedFrameworks/Package.swift @@ -23,28 +23,28 @@ let package = Package( dependencies: []), .binaryTarget( name: "AmitySDK", - url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta21/AmitySDK.xcframework.zip", - checksum: "b95582d90256610bb4cbe393fb158ae97b2f2ba36dbf2fa1fd14410ec794c69b" + url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta22/AmitySDK.xcframework.zip", + checksum: "6bcf31f0cfd985c4edd0f127946e780897d9128937c1be9e83e3e78a8dd6822e" ), .binaryTarget( name: "Realm", - url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta21/Realm.xcframework.zip", - checksum: "fe727567d51b301a7b5c315a4821e2cf926bb26e72a4441eb88491ccfd827635" + url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta22/Realm.xcframework.zip", + checksum: "f20d3f0d637cdc9c6856f3b488d98feffa5e8fbdd33799077040ef94e86ba049" ), .binaryTarget( name: "RealmSwift", - url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta21/RealmSwift.xcframework.zip", - checksum: "898c21448d9bd54bc531a2b98235bd85d022563356d4224829ccd8a0598e6808" + url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta22/RealmSwift.xcframework.zip", + checksum: "8bc02587f2af1160984347574f1b400a89b398ee38e2bc9184a7f1b435450028" ), .binaryTarget( name: "AmityLiveVideoBroadcastKit", - url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta21/AmityLiveVideoBroadcastKit.xcframework.zip", - checksum: "517f68b1bc856e856d4a4b1fd8be588801631d142624082eadb1525e639852d1" + url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta22/AmityLiveVideoBroadcastKit.xcframework.zip", + checksum: "5dd730695f4b8b35e37f014168d01d0a80e03d82d351ffd2dce753a3b8ec538e" ), .binaryTarget( name: "AmityVideoPlayerKit", - url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta21/AmityVideoPlayerKit.xcframework.zip", - checksum: "3d5af83b23c20434f73e4e61e56c2af9496053a79b6fa402d62fa569e1fcd295" + url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta22/AmityVideoPlayerKit.xcframework.zip", + checksum: "e70fbe4e74aef3dc1d3e25bb1fedeffe7a5871c357d7e8f730caeeeec0bc9d22" ), .binaryTarget( name: "MobileVLCKit",