diff --git a/UpstraUIKit/AmityUIKit.xcodeproj/project.pbxproj b/UpstraUIKit/AmityUIKit.xcodeproj/project.pbxproj index b304e8c..79aaf30 100644 --- a/UpstraUIKit/AmityUIKit.xcodeproj/project.pbxproj +++ b/UpstraUIKit/AmityUIKit.xcodeproj/project.pbxproj @@ -89,6 +89,7 @@ 68B30A7C2B70E38B006A4102 /* AmityStoryCommentSettingsScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68B30A752B70E38B006A4102 /* AmityStoryCommentSettingsScreenViewModelProtocol.swift */; }; 68B30A7D2B70E38B006A4102 /* AmityStoryCommentSettingsScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68B30A762B70E38B006A4102 /* AmityStoryCommentSettingsScreenViewModel.swift */; }; 68B30A7E2B70E38B006A4102 /* AmityStoryCommentSettingsItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68B30A782B70E38B006A4102 /* AmityStoryCommentSettingsItem.swift */; }; + 68BDD1802CC24EE1001B0D1E /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 68BDD17F2CC24EE1001B0D1E /* SharedFrameworks */; }; 68F0EE062BC6BBDF004B3AA4 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 68F0EE052BC6BBDF004B3AA4 /* PrivacyInfo.xcprivacy */; }; 68F5D9FA2B481E4000A9FA0D /* AmityUIKit4.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 68F5D9F92B481E4000A9FA0D /* AmityUIKit4.framework */; }; 720D599A2525BDB1009734EF /* DispatchGroupWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 720D59992525BDB1009734EF /* DispatchGroupWrapper.swift */; }; @@ -371,7 +372,6 @@ 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 */; }; - 926C52372CB92F750085CA64 /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 926C52362CB92F750085CA64 /* 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 = ( - 926C52372CB92F750085CA64 /* SharedFrameworks in Frameworks */, + 68BDD1802CC24EE1001B0D1E /* SharedFrameworks in Frameworks */, 68F5D9FA2B481E4000A9FA0D /* AmityUIKit4.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -4507,7 +4507,7 @@ ); name = AmityUIKit; packageProductDependencies = ( - 926C52362CB92F750085CA64 /* SharedFrameworks */, + 68BDD17F2CC24EE1001B0D1E /* SharedFrameworks */, ); productName = UpstraUIKit; productReference = 72A3503024EA811500DA9D46 /* AmityUIKit.framework */; @@ -5523,7 +5523,7 @@ /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ - 926C52362CB92F750085CA64 /* SharedFrameworks */ = { + 68BDD17F2CC24EE1001B0D1E /* SharedFrameworks */ = { isa = XCSwiftPackageProductDependency; productName = SharedFrameworks; }; diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4.xcodeproj/project.pbxproj b/UpstraUIKit/AmityUIKit4/AmityUIKit4.xcodeproj/project.pbxproj index 32fc3c4..34f7053 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4.xcodeproj/project.pbxproj +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4.xcodeproj/project.pbxproj @@ -245,6 +245,7 @@ 68BD2D042CB4EF3600FF0A19 /* TabBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68BD2D032CB4EF3200FF0A19 /* TabBarView.swift */; }; 68BD2D5F2CB5119F00FF0A19 /* PreviewLinkView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68BD2D5E2CB5119B00FF0A19 /* PreviewLinkView.swift */; }; 68BD2D612CB51AB400FF0A19 /* AmityReactionListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68BD2D602CB51AB400FF0A19 /* AmityReactionListViewModel.swift */; }; + 68BDD17E2CC24ED8001B0D1E /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 68BDD17D2CC24ED8001B0D1E /* SharedFrameworks */; }; 68BECE6C2BEA097500D1AA36 /* AmityPostModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68BECE6B2BEA097500D1AA36 /* AmityPostModel.swift */; }; 68BECE6E2BEA09FF00D1AA36 /* AmityMedia.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68BECE6D2BEA09FF00D1AA36 /* AmityMedia.swift */; }; 68BECE702BEA0C2300D1AA36 /* FeedManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68BECE6F2BEA0C2300D1AA36 /* FeedManager.swift */; }; @@ -353,7 +354,6 @@ 926894402C474A49004CECF8 /* AmityCommunityPinnedPostComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9268943F2C474A49004CECF8 /* AmityCommunityPinnedPostComponent.swift */; }; 926894422C474A6A004CECF8 /* EmptyCommunityFeedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 926894412C474A6A004CECF8 /* EmptyCommunityFeedView.swift */; }; 926C520D2CB7190B0085CA64 /* AmityLivestreamPlayerPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 926C520C2CB7190B0085CA64 /* AmityLivestreamPlayerPage.swift */; }; - 926C52352CB92F5B0085CA64 /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 926C52342CB92F5B0085CA64 /* SharedFrameworks */; }; 926F079C2BB4DDB9000806CB /* Shimmer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 926F079B2BB4DDB9000806CB /* Shimmer.swift */; }; 926F079E2BB4E25B000806CB /* LiveChatMessageBubble.swift in Sources */ = {isa = PBXBuildFile; fileRef = 926F079D2BB4E25B000806CB /* LiveChatMessageBubble.swift */; }; 9280FDAA2C3C8A390052F01A /* AmityCommunityProfilePage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9280FDA92C3C8A380052F01A /* AmityCommunityProfilePage.swift */; }; @@ -682,8 +682,8 @@ 686830232C915DFC009B1694 /* TimeInterval+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TimeInterval+Extension.swift"; sourceTree = "<group>"; }; 6868302B2C92EBE4009B1694 /* AmityCommunityMembershipPageBehavior.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityCommunityMembershipPageBehavior.swift; sourceTree = "<group>"; }; 686830322C993D52009B1694 /* AmityUserProfilePage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityUserProfilePage.swift; sourceTree = "<group>"; }; - 6869148D2CB7FB6100D64409 /* AmityVideoPlayerKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = AmityVideoPlayerKit.xcframework; path = /Users/zayar/Desktop/Amity/EkoMessagingSDKUIKitIOS/UpstraUIKit/SampleApp/../Shared/AmityVideoPlayerKit.xcframework; sourceTree = "<absolute>"; }; - 686914912CB7FBBC00D64409 /* MobileVLCKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MobileVLCKit.xcframework; path = /Users/zayar/Desktop/Amity/EkoMessagingSDKUIKitIOS/UpstraUIKit/AmityUIKitLiveStream/../Shared/MobileVLCKit.xcframework; sourceTree = "<absolute>"; }; + 6869148D2CB7FB6100D64409 /* AmityVideoPlayerKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = AmityVideoPlayerKit.xcframework; path = ../Shared/AmityVideoPlayerKit.xcframework; sourceTree = "<group>"; }; + 686914912CB7FBBC00D64409 /* MobileVLCKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MobileVLCKit.xcframework; path = ../Shared/MobileVLCKit.xcframework; sourceTree = "<group>"; }; 686D173B2B1452A7007AEF59 /* AmityStoryTabComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityStoryTabComponent.swift; sourceTree = "<group>"; }; 686D173D2B1496D2007AEF59 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 686D173F2B149F63007AEF59 /* AmityIcon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityIcon.swift; sourceTree = "<group>"; }; @@ -868,6 +868,8 @@ 9268943F2C474A49004CECF8 /* AmityCommunityPinnedPostComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityCommunityPinnedPostComponent.swift; sourceTree = "<group>"; }; 926894412C474A6A004CECF8 /* EmptyCommunityFeedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyCommunityFeedView.swift; sourceTree = "<group>"; }; 926C520C2CB7190B0085CA64 /* AmityLivestreamPlayerPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityLivestreamPlayerPage.swift; sourceTree = "<group>"; }; + 926C522D2CB91DA40085CA64 /* MobileVLCKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MobileVLCKit.xcframework; path = ../Shared/MobileVLCKit.xcframework; sourceTree = "<group>"; }; + 926C52312CB91DAA0085CA64 /* AmityVideoPlayerKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = AmityVideoPlayerKit.xcframework; path = ../Shared/AmityVideoPlayerKit.xcframework; sourceTree = "<group>"; }; 926F079B2BB4DDB9000806CB /* Shimmer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Shimmer.swift; sourceTree = "<group>"; }; 926F079D2BB4E25B000806CB /* LiveChatMessageBubble.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveChatMessageBubble.swift; sourceTree = "<group>"; }; 9280FDA92C3C8A380052F01A /* AmityCommunityProfilePage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityCommunityProfilePage.swift; sourceTree = "<group>"; }; @@ -1016,7 +1018,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 926C52352CB92F5B0085CA64 /* SharedFrameworks in Frameworks */, + 68BDD17E2CC24ED8001B0D1E /* SharedFrameworks in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1454,6 +1456,8 @@ 684AE10D2B0C5D2000FD7270 /* Frameworks */ = { isa = PBXGroup; children = ( + 926C52312CB91DAA0085CA64 /* AmityVideoPlayerKit.xcframework */, + 926C522D2CB91DA40085CA64 /* MobileVLCKit.xcframework */, 686914912CB7FBBC00D64409 /* MobileVLCKit.xcframework */, 6869148D2CB7FB6100D64409 /* AmityVideoPlayerKit.xcframework */, 689EE69A2BECC07800927D51 /* AmityUIKit.framework */, @@ -2751,9 +2755,6 @@ dependencies = ( ); name = AmityUIKit4; - packageProductDependencies = ( - 926C52342CB92F5B0085CA64 /* SharedFrameworks */, - ); productName = AmityUIKit4; productReference = 684AE0F12B0C5B0200FD7270 /* AmityUIKit4.framework */; productType = "com.apple.product-type.framework"; @@ -3605,7 +3606,7 @@ /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ - 926C52342CB92F5B0085CA64 /* SharedFrameworks */ = { + 68BDD17D2CC24ED8001B0D1E /* SharedFrameworks */ = { isa = XCSwiftPackageProductDependency; productName = SharedFrameworks; }; diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/AmityUIKit4.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/AmityUIKit4.swift index 6f2bd71..bdd2c80 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/AmityUIKit4.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/AmityUIKit4.swift @@ -232,6 +232,10 @@ final class AmityUIKitManagerInternal: NSObject { let globalFeedComponentBehavior = AmityGlobalFeedComponentBehavior() behavior.globalFeedComponentBehavior = globalFeedComponentBehavior + // PostContentComponent + let postContentComponentBehavior = AmityPostContentComponentBehavior() + behavior.postContentComponentBehavior = postContentComponentBehavior + // CreatePostMenuComponent let createPostMenuComponentBehavior = AmityCreatePostMenuComponentBehavior() behavior.createPostMenuComponentBehavior = createPostMenuComponentBehavior diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/AmityUIKitConfig.json b/UpstraUIKit/AmityUIKit4/AmityUIKit4/AmityUIKitConfig.json index d19fa7c..a014e12 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/AmityUIKitConfig.json +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/AmityUIKitConfig.json @@ -1,5 +1,5 @@ { - "preferred_theme": "default", + "preferred_theme": "light", "theme": { "light": { "primary_color": "#1054DE", diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/CustomViews/MultiSelectionMediaPicker.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/CustomViews/MultiSelectionMediaPicker.swift index 925fc3e..2142c59 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/CustomViews/MultiSelectionMediaPicker.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Core/CustomViews/MultiSelectionMediaPicker.swift @@ -47,53 +47,143 @@ struct MultiSelectionMediaPicker: UIViewControllerRepresentable { final class Coordinator: NSObject, PHPickerViewControllerDelegate { var parent: MultiSelectionMediaPicker + var loadingOverlay: LoadingOverlayView? init(_ parent: MultiSelectionMediaPicker) { self.parent = parent } func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) { - parent.presentationMode.wrappedValue.dismiss() - let identifiers = results.compactMap(\.assetIdentifier) - + let dispatchGroup = DispatchGroup() + var images: [UIImage] = [] + var videos: [URL] = [] + DispatchQueue.main.async { + self.showLoadingOverlay(on: picker.view, message: "Processing media...") + } for result in results { + // load image from item provider if result.itemProvider.canLoadObject(ofClass: UIImage.self) { - - result.itemProvider.loadObject(ofClass: UIImage.self) { [weak self] newImage, error in - if let error = error { - } else if let image = newImage as? UIImage { - DispatchQueue.main.async { - self?.parent.viewModel.selectedImages.append(image) - } - } + dispatchGroup.enter() + result.itemProvider.loadObject(ofClass: UIImage.self) { newImage, error in + defer { dispatchGroup.leave() } + guard error == nil, let image = newImage as? UIImage else { return } + images.append(image) } } else { - guard let assetId = result.assetIdentifier else { continue } let fetchResult = PHAsset.fetchAssets(withLocalIdentifiers: [assetId], options: nil) guard let asset = fetchResult.firstObject else { continue } + // load video as avasset if asset.mediaType == .video { - let options = PHVideoRequestOptions() options.version = .original + options.isNetworkAccessAllowed = true + + dispatchGroup.enter() PHImageManager.default().requestAVAsset(forVideo: asset, options: options) { avAsset, audioMix, info in + defer { dispatchGroup.leave() } if let urlAsset = avAsset as? AVURLAsset { - let fileUrl = urlAsset.url - DispatchQueue.main.async { - self.parent.viewModel.selectedVidoesURLs.append(fileUrl) - } + videos.append(urlAsset.url) } } } } } + + dispatchGroup.notify(queue: .main) { + self.hideLoadingOverlay() + + if self.parent.mediaType == .images { + self.parent.viewModel.selectedImages.append(contentsOf: images) + } else { + self.parent.viewModel.selectedVidoesURLs.append(contentsOf: videos) + } + + self.parent.presentationMode.wrappedValue.dismiss() + } + } + + private func showLoadingOverlay(on view: UIView, message: String) { + loadingOverlay = LoadingOverlayView(message: message) + guard let overlay = loadingOverlay else { return } + + view.addSubview(overlay) + overlay.translatesAutoresizingMaskIntoConstraints = false + + NSLayoutConstraint.activate([ + overlay.topAnchor.constraint(equalTo: view.topAnchor), + overlay.leadingAnchor.constraint(equalTo: view.leadingAnchor), + overlay.trailingAnchor.constraint(equalTo: view.trailingAnchor), + overlay.bottomAnchor.constraint(equalTo: view.bottomAnchor) + ]) } + + private func hideLoadingOverlay() { + loadingOverlay?.removeFromSuperview() + loadingOverlay = nil + } + } +} + + +class LoadingOverlayView: UIView { + private let containerView: UIView + private let activityIndicator: UIActivityIndicatorView + private let messageLabel: UILabel + + init(message: String) { + containerView = UIView() + containerView.backgroundColor = UIColor.systemBackground + containerView.layer.cornerRadius = 10 + containerView.layer.shadowColor = UIColor.black.cgColor + containerView.layer.shadowOffset = CGSize(width: 0, height: 2) + containerView.layer.shadowRadius = 4 + containerView.layer.shadowOpacity = 0.1 + + activityIndicator = UIActivityIndicatorView(style: .medium) + + messageLabel = UILabel() + messageLabel.text = message + messageLabel.textAlignment = .center + messageLabel.numberOfLines = 0 + + super.init(frame: .zero) + + backgroundColor = UIColor.black.withAlphaComponent(0.4) + + addSubview(containerView) + containerView.addSubview(activityIndicator) + containerView.addSubview(messageLabel) + + containerView.translatesAutoresizingMaskIntoConstraints = false + activityIndicator.translatesAutoresizingMaskIntoConstraints = false + messageLabel.translatesAutoresizingMaskIntoConstraints = false + + NSLayoutConstraint.activate([ + containerView.centerXAnchor.constraint(equalTo: centerXAnchor), + containerView.centerYAnchor.constraint(equalTo: centerYAnchor), + containerView.widthAnchor.constraint(equalToConstant: 200), + containerView.heightAnchor.constraint(greaterThanOrEqualToConstant: 100), + + activityIndicator.topAnchor.constraint(equalTo: containerView.topAnchor, constant: 20), + activityIndicator.centerXAnchor.constraint(equalTo: containerView.centerXAnchor), + + messageLabel.topAnchor.constraint(equalTo: activityIndicator.bottomAnchor, constant: 16), + messageLabel.leadingAnchor.constraint(equalTo: containerView.leadingAnchor, constant: 16), + messageLabel.trailingAnchor.constraint(equalTo: containerView.trailingAnchor, constant: -16), + messageLabel.bottomAnchor.constraint(equalTo: containerView.bottomAnchor, constant: -20) + ]) + + activityIndicator.startAnimating() } + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } } diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityHeaderComponent.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityHeaderComponent.swift index 55e086c..3144536 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityHeaderComponent.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/CommunityProfile/AmityCommunityHeaderComponent.swift @@ -83,6 +83,7 @@ public struct AmityCommunityHeaderComponent: AmityComponentView { Text(community.description) .font(.system(size: 15)) + .foregroundColor(Color(viewConfig.theme.baseColor)) .lineLimit(4) .isHidden(community.description.isEmpty || viewConfig.isHidden(elementId: .communityDescription)) .padding(.all, 16) diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/PostCreation/AmityMediaAttatchmentComponent.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/PostCreation/AmityMediaAttatchmentComponent.swift index e1bb082..182cc8f 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/PostCreation/AmityMediaAttatchmentComponent.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/PostCreation/AmityMediaAttatchmentComponent.swift @@ -161,7 +161,7 @@ public struct AmityMediaAttachmentComponent: AmityComponentView { .renderingMode(.template) .resizable() .scaledToFill() - .foregroundColor(isDisable ? Color(viewConfig.theme.baseColorShade3) : nil) + .foregroundColor(isDisable ? Color(viewConfig.theme.baseColor) : nil) .frame(width: 20, height: 20) ) .clipShape(Circle()) diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/SocialHome/Explore/Components/CommunityCategories/AmityCommunityCategoriesComponent.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/SocialHome/Explore/Components/CommunityCategories/AmityCommunityCategoriesComponent.swift index 4702dd1..4521533 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/SocialHome/Explore/Components/CommunityCategories/AmityCommunityCategoriesComponent.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/SocialHome/Explore/Components/CommunityCategories/AmityCommunityCategoriesComponent.swift @@ -88,6 +88,7 @@ struct CategoryLabel: View { Text(category.name) .font(.system(size: 15, weight: .medium)) + .foregroundColor(Color(viewConfig.theme.baseColor)) .padding(.horizontal, 8) } .padding(4) diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/SocialHome/Explore/Pages/CommunitiesByCategory/AmityCommunitiesByCategoryPage.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/SocialHome/Explore/Pages/CommunitiesByCategory/AmityCommunitiesByCategoryPage.swift index e32a2d1..832a5d4 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/SocialHome/Explore/Pages/CommunitiesByCategory/AmityCommunitiesByCategoryPage.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Components/SocialHome/Explore/Pages/CommunitiesByCategory/AmityCommunitiesByCategoryPage.swift @@ -31,6 +31,9 @@ public struct AmityCommunitiesByCategoryPage: AmityPageView { } .background(Color(viewConfig.theme.backgroundColor).ignoresSafeArea()) .updateTheme(with: viewConfig) + .onAppear { + host.controller?.navigationController?.isNavigationBarHidden = true + } } } diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunitySetupPage.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunitySetupPage.swift index 7a2542d..c5f77c3 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunitySetupPage.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/AmityCommunitySetupPage.swift @@ -334,6 +334,7 @@ public struct AmityCommunitySetupPage: AmityPageView { HStack { Text("Categories") .font(.system(size: 17, weight: .semibold)) + .foregroundColor(Color(viewConfig.theme.baseColor)) Spacer() } diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/ChildView/CommunityMemberView.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/ChildView/CommunityMemberView.swift index 0dd48e6..1503b48 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/ChildView/CommunityMemberView.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/CommunityProfile/ChildView/CommunityMemberView.swift @@ -44,6 +44,7 @@ struct CommunityMemberView: View { Text(communityMember.displayName) .font(.system(size: 15, weight: .semibold)) + .foregroundColor(Color(viewConfig.theme.baseColor)) if let isBrand = communityMember.user?.isBrand, isBrand { Image(AmityIcon.brandBadge.imageResource) diff --git a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/SocialHome/AmitySocialHomePage.swift b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/SocialHome/AmitySocialHomePage.swift index 051425f..6a57f4e 100644 --- a/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/SocialHome/AmitySocialHomePage.swift +++ b/UpstraUIKit/AmityUIKit4/AmityUIKit4/Social/Pages/SocialHome/AmitySocialHomePage.swift @@ -44,7 +44,7 @@ public struct AmitySocialHomePage: AmityPageView { .ignoresSafeArea(edges: .bottom) .updateTheme(with: viewConfig) .onAppear { - host.controller?.navigationController?.isNavigationBarHidden = true + host.controller?.navigationController?.isNavigationBarHidden = false } } } diff --git a/UpstraUIKit/AmityUIKitLiveStream/AmityUIKitLiveStream.xcodeproj/project.pbxproj b/UpstraUIKit/AmityUIKitLiveStream/AmityUIKitLiveStream.xcodeproj/project.pbxproj index a942597..4749b97 100644 --- a/UpstraUIKit/AmityUIKitLiveStream/AmityUIKitLiveStream.xcodeproj/project.pbxproj +++ b/UpstraUIKit/AmityUIKitLiveStream/AmityUIKitLiveStream.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 926C52392CB92F7F0085CA64 /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 926C52382CB92F7F0085CA64 /* SharedFrameworks */; }; + 68BDD1822CC24EE8001B0D1E /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 68BDD1812CC24EE8001B0D1E /* 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 = ( - 926C52392CB92F7F0085CA64 /* SharedFrameworks in Frameworks */, + 68BDD1822CC24EE8001B0D1E /* SharedFrameworks in Frameworks */, A0BD0B3426DDD9820054088B /* AmityUIKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -245,7 +245,7 @@ ); name = AmityUIKitLiveStream; packageProductDependencies = ( - 926C52382CB92F7F0085CA64 /* SharedFrameworks */, + 68BDD1812CC24EE8001B0D1E /* SharedFrameworks */, ); productName = AmityUIKitLiveStream; productReference = A0BD0B1526DCE4F50054088B /* AmityUIKitLiveStream.framework */; @@ -529,7 +529,7 @@ /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ - 926C52382CB92F7F0085CA64 /* SharedFrameworks */ = { + 68BDD1812CC24EE8001B0D1E /* SharedFrameworks */ = { isa = XCSwiftPackageProductDependency; productName = SharedFrameworks; }; diff --git a/UpstraUIKit/SampleApp/SampleApp.xcodeproj/project.pbxproj b/UpstraUIKit/SampleApp/SampleApp.xcodeproj/project.pbxproj index aad1742..a5d994a 100644 --- a/UpstraUIKit/SampleApp/SampleApp.xcodeproj/project.pbxproj +++ b/UpstraUIKit/SampleApp/SampleApp.xcodeproj/project.pbxproj @@ -23,6 +23,7 @@ 682C761C2B331DAE00018F80 /* AmityUIKit4.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 684AE12D2B0C841400FD7270 /* AmityUIKit4.framework */; }; 682C761D2B331DAE00018F80 /* AmityUIKit4.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 684AE12D2B0C841400FD7270 /* AmityUIKit4.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 684097562B30607F00697E1B /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 684097552B30607F00697E1B /* GoogleService-Info.plist */; }; + 68BDD1842CC24EF0001B0D1E /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 68BDD1832CC24EF0001B0D1E /* SharedFrameworks */; }; 68F5D9FE2B481E4700A9FA0D /* AmityUIKit4.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 68F5D9FD2B481E4700A9FA0D /* AmityUIKit4.framework */; }; 68F5D9FF2B481E4700A9FA0D /* AmityUIKit4.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 68F5D9FD2B481E4700A9FA0D /* AmityUIKit4.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 7214C9CB2632BE5500192BB3 /* UserLevelPushNotificationsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7214C9CA2632BE5500192BB3 /* UserLevelPushNotificationsTableViewController.swift */; }; @@ -35,7 +36,6 @@ 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 */; }; - 926C523B2CB92F8C0085CA64 /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 926C523A2CB92F8C0085CA64 /* 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 = ( - 926C523B2CB92F8C0085CA64 /* SharedFrameworks in Frameworks */, + 68BDD1842CC24EF0001B0D1E /* 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 = ( - 926C523A2CB92F8C0085CA64 /* SharedFrameworks */, + 68BDD1832CC24EF0001B0D1E /* SharedFrameworks */, ); productName = SampleApp; productReference = B78DA47524BED7D300EE902B /* SampleApp.app */; @@ -1288,7 +1288,7 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 926C523A2CB92F8C0085CA64 /* SharedFrameworks */ = { + 68BDD1832CC24EF0001B0D1E /* SharedFrameworks */ = { isa = XCSwiftPackageProductDependency; productName = SharedFrameworks; }; diff --git a/UpstraUIKit/SampleApp/SampleApp/Feature/FeatureViewController.swift b/UpstraUIKit/SampleApp/SampleApp/Feature/FeatureViewController.swift index 31a8752..6923fed 100644 --- a/UpstraUIKit/SampleApp/SampleApp/Feature/FeatureViewController.swift +++ b/UpstraUIKit/SampleApp/SampleApp/Feature/FeatureViewController.swift @@ -90,11 +90,10 @@ extension FeatureViewController: UITableViewDelegate { // navigationController?.present(hostingController, animated: true) navigationController?.pushViewController(hostingController, animated: true) case .socialUIKit: - let pageView = SocialUIKitPage() - let hostingController = AmitySwiftUIHostingNavigationController(rootView: pageView) - hostingController.isNavigationBarHidden = true - hostingController.modalPresentationStyle = .overFullScreen - navigationController?.present(hostingController, animated: true) + let pageView = AmitySocialHomePage() + let hostingController = AmitySwiftUIHostingController(rootView: pageView) + hostingController.hidesBottomBarWhenPushed = true + navigationController?.pushViewController(hostingController, animated: true) case .socialUIKitV4Comaptible: let homepage = AmitySocialV4Compatible.make() let navigationController = UINavigationController(rootViewController: homepage) @@ -158,31 +157,3 @@ extension Color { self.init(.sRGB, red: Double(((rgbValue & 0xFF0000) >> 16)) / 255.0, green: Double((rgbValue & 0x00FF00) >> 8) / 255.0, blue: Double(rgbValue & 0x0000FF) / 255.0, opacity: 1.0) } } - - -struct SocialUIKitPage: View { - @EnvironmentObject private var host: AmitySwiftUIHostWrapper - @Environment(\.colorScheme) private var colorScheme - - var body: some View { - VStack(spacing: 0) { - HStack { - Button(action: { - host.controller?.dismiss(animated: true) - }) { - Image(uiImage: UIImage(named: "closeIcon") ?? UIImage()) - .renderingMode(.template) - .foregroundColor(colorScheme == .dark ? .white : .black) - .frame(width: 32, height: 32) - } - Spacer() - } - .padding(EdgeInsets(top: 0, leading: 12, bottom: 0, trailing: 15)) - - AmitySocialHomePage() - } - .padding(.top, UIDevice.hasNotch ? 50 : 15) - .background(colorScheme == .dark ? Color(UIColor(hex: "#191919")) : Color(UIColor(hex: "#FFFFFF"))) - .ignoresSafeArea() - } -} diff --git a/UpstraUIKit/SharedFrameworks/Package.swift b/UpstraUIKit/SharedFrameworks/Package.swift index 9f1d07b..530f842 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-beta25/AmitySDK.xcframework.zip", - checksum: "63d0b5f205d90478a621c00449fadbf821afdc5b6b4d29ced5fae633e327face" + url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta26/AmitySDK.xcframework.zip", + checksum: "43e6e6f2d57a7026fade1b4d0cdcefb5cc9b80724be1b787ad6bf09124efa82a" ), .binaryTarget( name: "Realm", - url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta25/Realm.xcframework.zip", - checksum: "1e5c3b81e229b47751f00e501c54a84d1ef445607ed5c4af7dc6dbc459f3fa01" + url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta26/Realm.xcframework.zip", + checksum: "f1e3e4ddf7191be369bb39ea160c89a2497d12275dee222fd39a47226c34282e" ), .binaryTarget( name: "RealmSwift", - url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta25/RealmSwift.xcframework.zip", - checksum: "12acc2b0e8e9e2999d6bb459e41eaf9e04131b4ab8e2cb68ea33a547dfc16035" + url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta26/RealmSwift.xcframework.zip", + checksum: "9fb3f59da0976d6a352a64166dd9df228b058f65e3ca1aa14238f4aa4462fa5a" ), .binaryTarget( name: "AmityLiveVideoBroadcastKit", - url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta25/AmityLiveVideoBroadcastKit.xcframework.zip", - checksum: "36f0db6bfdd693ac32df2c2bf6ad13b6578bd503f939ce1120afebb3677f9a89" + url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta26/AmityLiveVideoBroadcastKit.xcframework.zip", + checksum: "75021a43cc14ac6f4d6c1b135da1d72ab3e6a340cbf79167c6c114984f80647e" ), .binaryTarget( name: "AmityVideoPlayerKit", - url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta25/AmityVideoPlayerKit.xcframework.zip", - checksum: "6871301ff32c34b75a63971e8715079baa8e821e3339299d99d6042e701802ac" + url: "https://sdk.amity.co/sdk-release/ios-uikit-frameworks/4.0.0-beta26/AmityVideoPlayerKit.xcframework.zip", + checksum: "478963431e37a5d51030ade00f0932b05b9946ab62b3153950a1d5a22ca7ae8c" ), .binaryTarget( name: "MobileVLCKit", diff --git a/UpstraUIKit/UpstraUIKit/Modules/Comunity/Feed Posts/Scenes/Feed/AmityStoryTabViewController.swift b/UpstraUIKit/UpstraUIKit/Modules/Comunity/Feed Posts/Scenes/Feed/AmityStoryTabViewController.swift index 73eddeb..3da3c01 100644 --- a/UpstraUIKit/UpstraUIKit/Modules/Comunity/Feed Posts/Scenes/Feed/AmityStoryTabViewController.swift +++ b/UpstraUIKit/UpstraUIKit/Modules/Comunity/Feed Posts/Scenes/Feed/AmityStoryTabViewController.swift @@ -64,4 +64,32 @@ extension AmityStoryTabViewController: FeedHeaderPresentable { } } +#else + +class AmityStoryTabViewController: AmityViewController { + + override func viewDidLoad() { + super.viewDidLoad() + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + } + static func make() -> AmityStoryTabViewController { + let vc = AmityStoryTabViewController(nibName: AmityStoryTabViewController.identifier, bundle: AmityUIKitManager.bundle) + return vc + } + +} + +extension AmityStoryTabViewController: FeedHeaderPresentable { + public var headerView: UIView { + return view + } + + public var height: CGFloat { + return 0 + } +} + #endif diff --git a/UpstraUIKit/UpstraUIKit/Modules/Comunity/Home/AmitySocialV4Compatible.swift b/UpstraUIKit/UpstraUIKit/Modules/Comunity/Home/AmitySocialV4Compatible.swift index 75d8b18..1405293 100644 --- a/UpstraUIKit/UpstraUIKit/Modules/Comunity/Home/AmitySocialV4Compatible.swift +++ b/UpstraUIKit/UpstraUIKit/Modules/Comunity/Home/AmitySocialV4Compatible.swift @@ -8,11 +8,12 @@ import Foundation import AmitySDK +import UIKit #if canImport(AmityUIKit4) import AmityUIKit4 -import UIKit #endif +#if canImport(AmityUIKit4) public class AmitySocialV4Compatible: AmityPageViewController { // MARK: - Properties @@ -98,7 +99,7 @@ private extension AmitySocialV4Compatible { } } -#if canImport(AmityUIKit4) + public class AmityV4NewsFeedViewController: AmityViewController, IndicatorInfoProvider { var pageTitle: String?