Room Widget Permission: Create room widget permission screen.

This commit is contained in:
SBiOSoftWhare 2019-11-28 12:49:53 +01:00
parent 9248eec44f
commit bb0d373dfa
5 changed files with 529 additions and 0 deletions

View file

@ -160,6 +160,8 @@
B110872421F098F0003554A5 /* ActivityIndicatorView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B110872021F098EF003554A5 /* ActivityIndicatorView.xib */; };
B110872521F098F0003554A5 /* ActivityIndicatorPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = B110872121F098EF003554A5 /* ActivityIndicatorPresenter.swift */; };
B110872621F098F0003554A5 /* ActivityIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B110872221F098F0003554A5 /* ActivityIndicatorView.swift */; };
B11291EA238D35590077B478 /* SlidingModalPresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B11291E9238D35590077B478 /* SlidingModalPresentable.swift */; };
B11291EC238D704C0077B478 /* FloatingPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = B11291EB238D704C0077B478 /* FloatingPoint.swift */; };
B120863722EF375F001F89E0 /* ReactionHistoryBridgeCoordinatorPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = B120863622EF375F001F89E0 /* ReactionHistoryBridgeCoordinatorPresenter.swift */; };
B125FE1B231D5BF200B72806 /* SettingsDiscoveryTableViewSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = B125FE1A231D5BF200B72806 /* SettingsDiscoveryTableViewSection.swift */; };
B125FE1D231D5DE400B72806 /* SettingsDiscoveryViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B125FE1C231D5DE400B72806 /* SettingsDiscoveryViewModel.swift */; };
@ -252,6 +254,12 @@
B19EFA3B21F8BB4100FC070E /* KeyBackupRecoverCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = B19EFA3A21F8BB4100FC070E /* KeyBackupRecoverCoordinator.swift */; };
B1A5B33E227ADF2A004CBA85 /* UIImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1A5B33D227ADF2A004CBA85 /* UIImage.swift */; };
B1A68593229E807A00D6C09A /* RoomBubbleCellLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1A68592229E807800D6C09A /* RoomBubbleCellLayout.swift */; };
B1A6C10723881EF2002882FD /* SlidingModalPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1A6C10623881EF2002882FD /* SlidingModalPresenter.swift */; };
B1A6C109238828A6002882FD /* SlidingModalPresentationDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1A6C108238828A6002882FD /* SlidingModalPresentationDelegate.swift */; };
B1A6C10B23882B6C002882FD /* SlidingModalPresentationAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1A6C10A23882B6C002882FD /* SlidingModalPresentationAnimator.swift */; };
B1A6C10D23882D1D002882FD /* SlidingModalPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1A6C10C23882D1D002882FD /* SlidingModalPresentationController.swift */; };
B1A6C111238BD236002882FD /* SlidingModalContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1A6C110238BD236002882FD /* SlidingModalContainerView.swift */; };
B1A6C113238BD245002882FD /* SlidingModalContainerView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B1A6C112238BD245002882FD /* SlidingModalContainerView.xib */; };
B1B12B2922942315002CB419 /* UITouch.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1B12B2822942315002CB419 /* UITouch.swift */; };
B1B5571820EE6C4D00210D55 /* CountryPickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B1B5567A20EE6C4C00210D55 /* CountryPickerViewController.m */; };
B1B5571920EE6C4D00210D55 /* LanguagePickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B1B5567C20EE6C4C00210D55 /* LanguagePickerViewController.m */; };
@ -504,6 +512,10 @@
B1B9DEF122EB396B0065E677 /* ReactionHistoryViewData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1B9DEF022EB396B0065E677 /* ReactionHistoryViewData.swift */; };
B1B9DEF422EB426D0065E677 /* ReactionHistoryViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1B9DEF222EB426D0065E677 /* ReactionHistoryViewCell.swift */; };
B1B9DEF522EB426D0065E677 /* ReactionHistoryViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B1B9DEF322EB426D0065E677 /* ReactionHistoryViewCell.xib */; };
B1BD71B5238DCBF700BA92E2 /* SlidingModalEmptyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1BD71B4238DCBF700BA92E2 /* SlidingModalEmptyViewController.swift */; };
B1BD71BC238E8F9600BA92E2 /* WidgetPermissionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1BD71BA238E8F9600BA92E2 /* WidgetPermissionViewController.swift */; };
B1BD71BF238EA56700BA92E2 /* WidgetPermissionViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B1BD71BE238EA56700BA92E2 /* WidgetPermissionViewController.storyboard */; };
B1BD71C1238EA92100BA92E2 /* WidgetPermissionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1BD71C0238EA92000BA92E2 /* WidgetPermissionViewModel.swift */; };
B1C335CD22F1C1320021BA8D /* CameraPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1C335CC22F1C1320021BA8D /* CameraPresenter.swift */; };
B1C3360122F1ED600021BA8D /* MediaPickerCoordinatorType.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1C335FE22F1ED5F0021BA8D /* MediaPickerCoordinatorType.swift */; };
B1C3360222F1ED600021BA8D /* MediaPickerCoordinatorBridgePresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1C335FF22F1ED5F0021BA8D /* MediaPickerCoordinatorBridgePresenter.swift */; };
@ -824,6 +836,8 @@
B110872021F098EF003554A5 /* ActivityIndicatorView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ActivityIndicatorView.xib; sourceTree = "<group>"; };
B110872121F098EF003554A5 /* ActivityIndicatorPresenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActivityIndicatorPresenter.swift; sourceTree = "<group>"; };
B110872221F098F0003554A5 /* ActivityIndicatorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActivityIndicatorView.swift; sourceTree = "<group>"; };
B11291E9238D35590077B478 /* SlidingModalPresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SlidingModalPresentable.swift; sourceTree = "<group>"; };
B11291EB238D704C0077B478 /* FloatingPoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FloatingPoint.swift; sourceTree = "<group>"; };
B120863622EF375F001F89E0 /* ReactionHistoryBridgeCoordinatorPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReactionHistoryBridgeCoordinatorPresenter.swift; sourceTree = "<group>"; };
B125FE1A231D5BF200B72806 /* SettingsDiscoveryTableViewSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsDiscoveryTableViewSection.swift; sourceTree = "<group>"; };
B125FE1C231D5DE400B72806 /* SettingsDiscoveryViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsDiscoveryViewModel.swift; sourceTree = "<group>"; };
@ -965,6 +979,12 @@
B19EFA3A21F8BB4100FC070E /* KeyBackupRecoverCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyBackupRecoverCoordinator.swift; sourceTree = "<group>"; };
B1A5B33D227ADF2A004CBA85 /* UIImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIImage.swift; sourceTree = "<group>"; };
B1A68592229E807800D6C09A /* RoomBubbleCellLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomBubbleCellLayout.swift; sourceTree = "<group>"; };
B1A6C10623881EF2002882FD /* SlidingModalPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SlidingModalPresenter.swift; sourceTree = "<group>"; };
B1A6C108238828A6002882FD /* SlidingModalPresentationDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SlidingModalPresentationDelegate.swift; sourceTree = "<group>"; };
B1A6C10A23882B6C002882FD /* SlidingModalPresentationAnimator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SlidingModalPresentationAnimator.swift; sourceTree = "<group>"; };
B1A6C10C23882D1D002882FD /* SlidingModalPresentationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SlidingModalPresentationController.swift; sourceTree = "<group>"; };
B1A6C110238BD236002882FD /* SlidingModalContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SlidingModalContainerView.swift; sourceTree = "<group>"; };
B1A6C112238BD245002882FD /* SlidingModalContainerView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SlidingModalContainerView.xib; sourceTree = "<group>"; };
B1B12B2822942315002CB419 /* UITouch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITouch.swift; sourceTree = "<group>"; };
B1B5567920EE6C4C00210D55 /* CountryPickerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountryPickerViewController.h; sourceTree = "<group>"; };
B1B5567A20EE6C4C00210D55 /* CountryPickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CountryPickerViewController.m; sourceTree = "<group>"; };
@ -1353,6 +1373,10 @@
B1B9DEF022EB396B0065E677 /* ReactionHistoryViewData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReactionHistoryViewData.swift; sourceTree = "<group>"; };
B1B9DEF222EB426D0065E677 /* ReactionHistoryViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReactionHistoryViewCell.swift; sourceTree = "<group>"; };
B1B9DEF322EB426D0065E677 /* ReactionHistoryViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ReactionHistoryViewCell.xib; sourceTree = "<group>"; };
B1BD71B4238DCBF700BA92E2 /* SlidingModalEmptyViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SlidingModalEmptyViewController.swift; sourceTree = "<group>"; };
B1BD71BA238E8F9600BA92E2 /* WidgetPermissionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetPermissionViewController.swift; sourceTree = "<group>"; };
B1BD71BE238EA56700BA92E2 /* WidgetPermissionViewController.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = WidgetPermissionViewController.storyboard; sourceTree = "<group>"; };
B1BD71C0238EA92000BA92E2 /* WidgetPermissionViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetPermissionViewModel.swift; sourceTree = "<group>"; };
B1C335CC22F1C1320021BA8D /* CameraPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraPresenter.swift; sourceTree = "<group>"; };
B1C335FE22F1ED5F0021BA8D /* MediaPickerCoordinatorType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaPickerCoordinatorType.swift; sourceTree = "<group>"; };
B1C335FF22F1ED5F0021BA8D /* MediaPickerCoordinatorBridgePresenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaPickerCoordinatorBridgePresenter.swift; sourceTree = "<group>"; };
@ -1991,6 +2015,16 @@
path = ActivityIndicator;
sourceTree = "<group>";
};
B11291ED238DC8C80077B478 /* WidgetPermission */ = {
isa = PBXGroup;
children = (
B1BD71C0238EA92000BA92E2 /* WidgetPermissionViewModel.swift */,
B1BD71BA238E8F9600BA92E2 /* WidgetPermissionViewController.swift */,
B1BD71BE238EA56700BA92E2 /* WidgetPermissionViewController.storyboard */,
);
path = WidgetPermission;
sourceTree = "<group>";
};
B125FE19231D5B5600B72806 /* Discovery */ = {
isa = PBXGroup;
children = (
@ -2348,9 +2382,25 @@
path = Riot/Modules/Common/CollectionView;
sourceTree = SOURCE_ROOT;
};
B1A6C10523881ECB002882FD /* Modal */ = {
isa = PBXGroup;
children = (
B1A6C10623881EF2002882FD /* SlidingModalPresenter.swift */,
B11291E9238D35590077B478 /* SlidingModalPresentable.swift */,
B1A6C108238828A6002882FD /* SlidingModalPresentationDelegate.swift */,
B1A6C10A23882B6C002882FD /* SlidingModalPresentationAnimator.swift */,
B1A6C10C23882D1D002882FD /* SlidingModalPresentationController.swift */,
B1A6C110238BD236002882FD /* SlidingModalContainerView.swift */,
B1A6C112238BD245002882FD /* SlidingModalContainerView.xib */,
B1BD71B4238DCBF700BA92E2 /* SlidingModalEmptyViewController.swift */,
);
path = Modal;
sourceTree = "<group>";
};
B1B5567620EE6C4C00210D55 /* Modules */ = {
isa = PBXGroup;
children = (
B1A6C10523881ECB002882FD /* Modal */,
32DB556722FDADE50016329E /* ServiceTerms */,
3232AB94225730E100AD6A5C /* DeviceVerification */,
B1B556EA20EE6C4C00210D55 /* Main */,
@ -2851,6 +2901,7 @@
children = (
B1B5576420EE702800210D55 /* IntegrationManagerViewController.h */,
B1B5576020EE702800210D55 /* IntegrationManagerViewController.m */,
B11291ED238DC8C80077B478 /* WidgetPermission */,
B1B5576120EE702800210D55 /* WidgetPicker */,
B1B5576520EE702800210D55 /* Widgets */,
);
@ -3712,6 +3763,7 @@
B1C562CB228AB3510037F12A /* UIStackView.swift */,
B1B12B2822942315002CB419 /* UITouch.swift */,
B1DCC63322E72C1B00625807 /* UISearchBar.swift */,
B11291EB238D704C0077B478 /* FloatingPoint.swift */,
);
path = Categories;
sourceTree = "<group>";
@ -3991,6 +4043,7 @@
B1B5592B20EF7A5D00210D55 /* TableViewCellWithButton.xib in Resources */,
B1B5574620EE6C4D00210D55 /* StartChatViewController.xib in Resources */,
B1B5590A20EF768F00210D55 /* RoomOutgoingAttachmentWithoutSenderInfoBubbleCell.xib in Resources */,
B1A6C113238BD245002882FD /* SlidingModalContainerView.xib in Resources */,
B1B5594420EF7BD000210D55 /* TableViewCellWithCollectionView.xib in Resources */,
B1B558D520EF768F00210D55 /* RoomIncomingEncryptedTextMsgWithPaginationTitleWithoutSenderNameBubbleCell.xib in Resources */,
B1B5590020EF768F00210D55 /* RoomOutgoingTextMsgWithoutSenderNameBubbleCell.xib in Resources */,
@ -4074,6 +4127,7 @@
3232AB4B2256558300AD6A5C /* TemplateScreenViewController.storyboard in Resources */,
B1D1BDA822BBAFC900831367 /* ReactionsMenuView.xib in Resources */,
32B1FEDB21A46F2C00637127 /* TermsView.xib in Resources */,
B1BD71BF238EA56700BA92E2 /* WidgetPermissionViewController.storyboard in Resources */,
B1DCC63222E7026F00625807 /* EmojiPickerHeaderView.xib in Resources */,
B1B5578E20EF568D00210D55 /* GroupInviteTableViewCell.xib in Resources */,
B1B5582020EF625800210D55 /* SimpleRoomTitleView.xib in Resources */,
@ -4374,6 +4428,7 @@
B1B558DE20EF768F00210D55 /* RoomIncomingAttachmentBubbleCell.m in Sources */,
B1B5574820EE6C4D00210D55 /* PeopleViewController.m in Sources */,
B1B5598720EFC3E000210D55 /* Widget.m in Sources */,
B1BD71C1238EA92100BA92E2 /* WidgetPermissionViewModel.swift in Sources */,
B1B557E320EF60B900210D55 /* MessagesSearchResultAttachmentBubbleCell.m in Sources */,
B1CE9F062216FB09000FAE6A /* EncryptionKeysExportPresenter.swift in Sources */,
3232ABAA225730E100AD6A5C /* DeviceVerificationCoordinatorBridgePresenter.swift in Sources */,
@ -4404,7 +4459,9 @@
B1963B2E228F1C4900CBA17F /* BubbleReactionViewData.swift in Sources */,
B1C3361C22F32B4A0021BA8D /* SingleImagePickerPresenter.swift in Sources */,
B1B5572F20EE6C4D00210D55 /* ReadReceiptsViewController.m in Sources */,
B1BD71BC238E8F9600BA92E2 /* WidgetPermissionViewController.swift in Sources */,
B1B558CB20EF768F00210D55 /* RoomIncomingEncryptedTextMsgWithoutSenderInfoBubbleCell.m in Sources */,
B11291EA238D35590077B478 /* SlidingModalPresentable.swift in Sources */,
B157FAA823264BED00EBFBD4 /* SettingsDiscoveryThreePidDetailsCoordinatorBridgePresenter.swift in Sources */,
B169330B20F3CA3A00746532 /* Contact.m in Sources */,
B1A5B33E227ADF2A004CBA85 /* UIImage.swift in Sources */,
@ -4425,6 +4482,7 @@
32A6001E22C661100042C1D9 /* EditHistoryCoordinatorBridgePresenter.swift in Sources */,
B1B5574A20EE6C4D00210D55 /* MediaPickerViewController.m in Sources */,
B1B5598520EFC3E000210D55 /* RageShakeManager.m in Sources */,
B1A6C111238BD236002882FD /* SlidingModalContainerView.swift in Sources */,
B1DCC62D22E61EAF00625807 /* EmojiPickerViewCell.swift in Sources */,
3232ABA8225730E100AD6A5C /* DeviceVerificationStartViewState.swift in Sources */,
B1B558D420EF768F00210D55 /* RoomOutgoingEncryptedTextMsgWithoutSenderInfoBubbleCell.m in Sources */,
@ -4441,6 +4499,7 @@
32863A5A2384070300D07C4A /* RiotSharedSettings.swift in Sources */,
B1B5594720EF7BD000210D55 /* RoomCollectionViewCell.m in Sources */,
B10CFBC32268D99D00A5842E /* JitsiService.swift in Sources */,
B1A6C10B23882B6C002882FD /* SlidingModalPresentationAnimator.swift in Sources */,
B1B558C120EF768F00210D55 /* RoomIncomingEncryptedAttachmentWithPaginationTitleBubbleCell.m in Sources */,
B1B5573E20EE6C4D00210D55 /* RiotNavigationController.m in Sources */,
B1B5593B20EF7BAC00210D55 /* TableViewCellWithCheckBoxAndLabel.m in Sources */,
@ -4463,6 +4522,7 @@
3232ABBC2257BE6500AD6A5C /* DeviceVerificationVerifyViewAction.swift in Sources */,
F05927C91FDED836009F2A68 /* MXGroup+Riot.m in Sources */,
B1B5594520EF7BD000210D55 /* TableViewCellWithCollectionView.m in Sources */,
B1A6C109238828A6002882FD /* SlidingModalPresentationDelegate.swift in Sources */,
32DB557722FDADE50016329E /* ServiceTermsModalCoordinator.swift in Sources */,
32DB557922FDADE50016329E /* ServiceTermsModalScreenViewModel.swift in Sources */,
32891D75226728EE00C82226 /* DeviceVerificationDataLoadingViewController.swift in Sources */,
@ -4570,6 +4630,7 @@
B1B5572620EE6C4D00210D55 /* RoomFilesSearchViewController.m in Sources */,
B1B5583120EF66BA00210D55 /* RoomIdOrAliasTableViewCell.m in Sources */,
B1CA3A2921EF692B000D1D89 /* UIView.swift in Sources */,
B1A6C10D23882D1D002882FD /* SlidingModalPresentationController.swift in Sources */,
32A6001D22C661100042C1D9 /* EditHistoryCoordinatorType.swift in Sources */,
F083BDFA1E7009ED00A9B29C /* RoomPreviewData.m in Sources */,
B1B557B420EF5AEF00210D55 /* EventDetailsView.m in Sources */,
@ -4598,6 +4659,7 @@
B1B5597520EFB02A00210D55 /* InviteRecentTableViewCell.m in Sources */,
B1B5571E20EE6C4D00210D55 /* ContactDetailsViewController.m in Sources */,
B1798302211B13B3001FD722 /* OnBoardingManager.swift in Sources */,
B1A6C10723881EF2002882FD /* SlidingModalPresenter.swift in Sources */,
B1B5573520EE6C4D00210D55 /* GroupDetailsViewController.m in Sources */,
B10B3B5B2201DD740072C76B /* KeyBackupBannerCell.swift in Sources */,
B1DCC61A22E5E17100625807 /* EmojiPickerViewController.swift in Sources */,
@ -4661,6 +4723,7 @@
B1B557BF20EF5B4500210D55 /* DisabledRoomInputToolbarView.m in Sources */,
B1B5578620EF564900210D55 /* GroupTableViewCellWithSwitch.m in Sources */,
B1098BE821ECFE52000DDA48 /* Coordinator.swift in Sources */,
B11291EC238D704C0077B478 /* FloatingPoint.swift in Sources */,
B1B557E920EF60F500210D55 /* MessagesSearchResultTextMsgBubbleCell.m in Sources */,
324A2050225FC571004FE8B0 /* DeviceVerificationIncomingViewController.swift in Sources */,
B1098C0D21ED07E4000DDA48 /* NavigationRouter.swift in Sources */,
@ -4715,6 +4778,7 @@
3232AB482256558300AD6A5C /* FlowTemplateCoordinatorType.swift in Sources */,
B1B9DEF122EB396B0065E677 /* ReactionHistoryViewData.swift in Sources */,
B1B558F820EF768F00210D55 /* RoomIncomingTextMsgWithPaginationTitleWithoutSenderNameBubbleCell.m in Sources */,
B1BD71B5238DCBF700BA92E2 /* SlidingModalEmptyViewController.swift in Sources */,
B125FE1B231D5BF200B72806 /* SettingsDiscoveryTableViewSection.swift in Sources */,
32242F0921E8B05F00725742 /* UIColor.swift in Sources */,
B16932E720F3C37100746532 /* HomeMessagesSearchDataSource.m in Sources */,

View file

@ -117,6 +117,11 @@ internal enum StoryboardScene {
internal static let initialScene = InitialSceneType<Riot.TemplateScreenViewController>(storyboard: TemplateScreenViewController.self)
}
internal enum WidgetPermissionViewController: StoryboardType {
internal static let storyboardName = "WidgetPermissionViewController"
internal static let initialScene = InitialSceneType<Riot.WidgetPermissionViewController>(storyboard: WidgetPermissionViewController.self)
}
}
// swiftlint:enable explicit_type_interface identifier_name line_length type_body_length type_name

View file

@ -0,0 +1,189 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="3Nb-ba-XcY">
<device id="retina6_1" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Widget Permission View Controller-->
<scene sceneID="hVk-V5-GY4">
<objects>
<viewController id="3Nb-ba-XcY" customClass="WidgetPermissionViewController" customModule="Riot" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Z4L-Ka-Saj">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yPm-GN-iNf">
<rect key="frame" x="0.0" y="44" width="414" height="852"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vsY-4j-uQz">
<rect key="frame" x="0.0" y="0.0" width="414" height="421.5"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="F2c-As-8Ce">
<rect key="frame" x="364" y="20" width="30" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="g3s-jh-fkQ"/>
<constraint firstAttribute="height" constant="30" id="qvd-zA-8uA"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<state key="normal" image="close_button"/>
<connections>
<action selector="closeButtonAction:" destination="3Nb-ba-XcY" eventType="touchUpInside" id="qJ1-fx-suE"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Load Widget" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4jF-pR-0xn">
<rect key="frame" x="20" y="24.5" width="334" height="21.5"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="This widget was added by:" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iUc-92-5Iv">
<rect key="frame" x="20" y="64" width="374" height="18"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="i5q-8U-NpS">
<rect key="frame" x="20" y="102" width="374" height="54"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UvZ-W0-l9O" customClass="MXKImageView">
<rect key="frame" x="0.0" y="7" width="40" height="40"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="CsC-a2-xHm"/>
<constraint firstAttribute="width" constant="40" id="f9t-fq-fc8"/>
</constraints>
</view>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="niK-55-mG3">
<rect key="frame" x="50" y="0.0" width="324" height="54"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="azre azer azer azer azer aezr azer azer zaer ae" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FjU-fb-8u1">
<rect key="frame" x="0.0" y="0.0" width="324" height="36"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="@paul:matrix.org" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Y8T-5r-qPI">
<rect key="frame" x="0.0" y="36" width="324" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="UvZ-W0-l9O" firstAttribute="leading" secondItem="i5q-8U-NpS" secondAttribute="leading" id="2Os-M9-Pld"/>
<constraint firstItem="niK-55-mG3" firstAttribute="top" relation="greaterThanOrEqual" secondItem="i5q-8U-NpS" secondAttribute="top" id="5NQ-1c-JIi"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="UvZ-W0-l9O" secondAttribute="bottom" id="LhM-Ik-Cag"/>
<constraint firstAttribute="height" priority="250" id="U78-dc-mnC"/>
<constraint firstItem="niK-55-mG3" firstAttribute="leading" secondItem="UvZ-W0-l9O" secondAttribute="trailing" constant="10" id="VUY-T5-xMd"/>
<constraint firstItem="UvZ-W0-l9O" firstAttribute="top" relation="greaterThanOrEqual" secondItem="i5q-8U-NpS" secondAttribute="top" id="Whs-DN-c3I"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="niK-55-mG3" secondAttribute="bottom" id="m6M-rS-dt4"/>
<constraint firstItem="UvZ-W0-l9O" firstAttribute="centerY" secondItem="i5q-8U-NpS" secondAttribute="centerY" id="n5u-UV-Cw6"/>
<constraint firstItem="niK-55-mG3" firstAttribute="centerY" secondItem="UvZ-W0-l9O" secondAttribute="centerY" id="qLj-Te-QyY"/>
<constraint firstAttribute="trailing" secondItem="niK-55-mG3" secondAttribute="trailing" id="qeG-IV-RJa"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="justified" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="d3k-sH-pkd">
<rect key="frame" x="20" y="176" width="374" height="161.5"/>
<string key="text">Using it may set cookies and share data with widget.com:
• Your display name
• Your avatar URL
• Your user ID
• Your theme
• Room ID
• Widget ID</string>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="249" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0mL-Yj-ueq">
<rect key="frame" x="20" y="357.5" width="374" height="44"/>
<accessibility key="accessibilityConfiguration" identifier="AuthenticationVCLoginButton"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="100" id="e3O-dh-ock"/>
<constraint firstAttribute="height" constant="44" id="vW7-2c-XUA"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
<inset key="contentEdgeInsets" minX="30" minY="0.0" maxX="30" maxY="0.0"/>
<state key="normal" title="Continue">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="continueButtonAction:" destination="3Nb-ba-XcY" eventType="touchUpInside" id="56l-uP-Q22"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="d3k-sH-pkd" firstAttribute="top" secondItem="i5q-8U-NpS" secondAttribute="bottom" constant="20" id="0zY-vK-dcB"/>
<constraint firstItem="0mL-Yj-ueq" firstAttribute="width" secondItem="d3k-sH-pkd" secondAttribute="width" priority="250" id="6aV-C7-iNC"/>
<constraint firstItem="iUc-92-5Iv" firstAttribute="top" secondItem="4jF-pR-0xn" secondAttribute="bottom" constant="18" id="96I-eP-mad"/>
<constraint firstItem="0mL-Yj-ueq" firstAttribute="top" secondItem="d3k-sH-pkd" secondAttribute="bottom" constant="20" id="9lC-9v-jhB"/>
<constraint firstAttribute="bottom" secondItem="0mL-Yj-ueq" secondAttribute="bottom" constant="20" id="Ae2-ca-Wj8"/>
<constraint firstItem="4jF-pR-0xn" firstAttribute="centerY" secondItem="F2c-As-8Ce" secondAttribute="centerY" id="EM7-qU-UJn"/>
<constraint firstItem="i5q-8U-NpS" firstAttribute="trailing" secondItem="iUc-92-5Iv" secondAttribute="trailing" id="KFE-YJ-23G"/>
<constraint firstAttribute="trailing" secondItem="d3k-sH-pkd" secondAttribute="trailing" constant="20" id="OVs-CR-hnR"/>
<constraint firstItem="i5q-8U-NpS" firstAttribute="leading" secondItem="iUc-92-5Iv" secondAttribute="leading" id="Oid-gA-1Ul"/>
<constraint firstItem="iUc-92-5Iv" firstAttribute="leading" secondItem="4jF-pR-0xn" secondAttribute="leading" id="cUc-9r-Z6J"/>
<constraint firstItem="iUc-92-5Iv" firstAttribute="trailing" secondItem="F2c-As-8Ce" secondAttribute="trailing" id="e64-iy-oYE"/>
<constraint firstItem="i5q-8U-NpS" firstAttribute="top" secondItem="iUc-92-5Iv" secondAttribute="bottom" constant="20" id="fEi-E8-VEb"/>
<constraint firstItem="d3k-sH-pkd" firstAttribute="leading" secondItem="vsY-4j-uQz" secondAttribute="leading" constant="20" id="fXW-MO-s6w"/>
<constraint firstItem="F2c-As-8Ce" firstAttribute="top" secondItem="vsY-4j-uQz" secondAttribute="top" constant="20" id="iKL-c9-I8u"/>
<constraint firstItem="F2c-As-8Ce" firstAttribute="leading" secondItem="4jF-pR-0xn" secondAttribute="trailing" constant="10" id="io2-qE-Xmg"/>
<constraint firstItem="0mL-Yj-ueq" firstAttribute="centerX" secondItem="vsY-4j-uQz" secondAttribute="centerX" id="tLS-tp-y26"/>
<constraint firstItem="0mL-Yj-ueq" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="vsY-4j-uQz" secondAttribute="leading" constant="20" id="tXE-bz-MoB"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="0mL-Yj-ueq" secondAttribute="trailing" constant="20" id="xHm-ec-RiN"/>
<constraint firstAttribute="trailing" secondItem="F2c-As-8Ce" secondAttribute="trailing" constant="20" id="y9f-Kq-oYP"/>
<constraint firstItem="4jF-pR-0xn" firstAttribute="leading" secondItem="vsY-4j-uQz" secondAttribute="leading" constant="20" id="yyc-kc-was"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstItem="vsY-4j-uQz" firstAttribute="top" secondItem="yPm-GN-iNf" secondAttribute="top" id="8Ca-HP-L6B"/>
<constraint firstAttribute="bottom" secondItem="vsY-4j-uQz" secondAttribute="bottom" id="bEQ-7N-MIg"/>
<constraint firstAttribute="trailing" secondItem="vsY-4j-uQz" secondAttribute="trailing" id="dJ0-Fd-abb"/>
<constraint firstItem="vsY-4j-uQz" firstAttribute="leading" secondItem="yPm-GN-iNf" secondAttribute="leading" id="eIi-U9-scV"/>
<constraint firstItem="vsY-4j-uQz" firstAttribute="width" secondItem="yPm-GN-iNf" secondAttribute="width" id="zZN-Jx-lhS"/>
</constraints>
</scrollView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="yPm-GN-iNf" secondAttribute="bottom" id="AVK-pe-mSa"/>
<constraint firstAttribute="trailing" secondItem="yPm-GN-iNf" secondAttribute="trailing" id="Pm4-AI-Yah"/>
<constraint firstItem="yPm-GN-iNf" firstAttribute="leading" secondItem="Z4L-Ka-Saj" secondAttribute="leading" id="Spn-UK-HMu"/>
<constraint firstItem="yPm-GN-iNf" firstAttribute="top" secondItem="0Vv-Fe-78X" secondAttribute="top" id="qkB-1D-obj"/>
</constraints>
<viewLayoutGuide key="safeArea" id="0Vv-Fe-78X"/>
</view>
<connections>
<outlet property="closeButton" destination="F2c-As-8Ce" id="dJz-ii-CtQ"/>
<outlet property="continueButton" destination="0mL-Yj-ueq" id="TlH-WR-YZc"/>
<outlet property="creatorAvatarImageView" destination="UvZ-W0-l9O" id="GcL-Cf-bKe"/>
<outlet property="creatorDisplayNameLabel" destination="FjU-fb-8u1" id="CnD-hH-yax"/>
<outlet property="creatorInfoTitleLabel" destination="iUc-92-5Iv" id="YB7-M7-v5p"/>
<outlet property="creatorUserIDLabel" destination="Y8T-5r-qPI" id="gB0-wH-0Vg"/>
<outlet property="informationLabel" destination="d3k-sH-pkd" id="LYA-Fi-nkb"/>
<outlet property="scrollView" destination="yPm-GN-iNf" id="c9d-T1-4hN"/>
<outlet property="titleLabel" destination="4jF-pR-0xn" id="6UD-Nz-fic"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="WZQ-Wb-Bbh" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-175" y="125"/>
</scene>
</scenes>
<resources>
<image name="close_button" width="16" height="16"/>
</resources>
</document>

View file

@ -0,0 +1,235 @@
// File created from ScreenTemplate
// $ createScreen.sh Modal/Show ServiceTermsModalScreen
/*
Copyright 2019 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import UIKit
@objc protocol WidgetPermissionViewControllerDelegate: class {
func widgetPermissionViewControllerDidTapCloseButton(_ viewController: WidgetPermissionViewController)
func widgetPermissionViewControllerDidTapContinueButton(_ viewController: WidgetPermissionViewController)
}
@objc
final class WidgetPermissionViewController: UIViewController {
// MARK: - Constants
private enum Constants {
static let continueButtonCornerRadius: CGFloat = 8.0
}
private enum Sizing {
static var viewController: WidgetPermissionViewController?
static var widthConstraint: NSLayoutConstraint?
}
// private static let sizingView = WidgetPermissionView.loadFromNib()
// private static var sizingViewWidthConstraint: NSLayoutConstraint?
// MARK: - Properties
// MARK: Outlets
@IBOutlet private weak var scrollView: UIScrollView!
@IBOutlet private weak var titleLabel: UILabel!
@IBOutlet private weak var closeButton: UIButton!
@IBOutlet private weak var creatorInfoTitleLabel: UILabel!
@IBOutlet private weak var creatorAvatarImageView: MXKImageView!
@IBOutlet private weak var creatorDisplayNameLabel: UILabel!
@IBOutlet private weak var creatorUserIDLabel: UILabel!
@IBOutlet private weak var informationLabel: UILabel!
@IBOutlet private weak var continueButton: UIButton!
// MARK: Private
private var viewModel: WidgetPermissionViewModel! {
didSet {
self.updateViews()
}
}
private var theme: Theme!
// MARK: Public
@objc weak var delegate: WidgetPermissionViewControllerDelegate?
// MARK: - Setup
@objc class func instantiate(with viewModel: WidgetPermissionViewModel) -> WidgetPermissionViewController {
let viewController = StoryboardScene.WidgetPermissionViewController.initialScene.instantiate()
viewController.viewModel = viewModel
viewController.theme = ThemeService.shared().theme
return viewController
}
// MARK: - Life cycle
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.setupViews()
self.updateViews()
self.registerThemeServiceDidChangeThemeNotification()
self.update(theme: self.theme)
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
self.scrollView.flashScrollIndicators()
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
self.creatorAvatarImageView.layer.cornerRadius = self.creatorAvatarImageView.frame.size.width/2
self.continueButton.layer.cornerRadius = Constants.continueButtonCornerRadius
self.closeButton.layer.cornerRadius = self.closeButton.frame.size.width/2
}
override var preferredStatusBarStyle: UIStatusBarStyle {
return self.theme.statusBarStyle
}
// MARK: - Private
private func update(theme: Theme) {
self.theme = theme
self.view.backgroundColor = theme.headerBackgroundColor
self.titleLabel.textColor = theme.textPrimaryColor
self.closeButton.vc_setBackgroundColor(theme.headerTextSecondaryColor, for: .normal)
self.creatorInfoTitleLabel.textColor = theme.textSecondaryColor
self.creatorDisplayNameLabel.textColor = theme.textSecondaryColor
self.creatorUserIDLabel.textColor = theme.textSecondaryColor
self.informationLabel.textColor = theme.textSecondaryColor
self.continueButton.vc_setBackgroundColor(theme.tintColor, for: .normal)
}
private func registerThemeServiceDidChangeThemeNotification() {
NotificationCenter.default.addObserver(self, selector: #selector(themeDidChange), name: .themeServiceDidChangeTheme, object: nil)
}
@objc private func themeDidChange() {
self.update(theme: ThemeService.shared().theme)
}
private func setupViews() {
self.closeButton.layer.masksToBounds = true
self.setupCreatorAvatarImageView()
self.titleLabel.text = VectorL10n.widgetRoomPermissionTitle
self.creatorInfoTitleLabel.text = VectorL10n.widgetRoomPermissionCreatorInfoTitle
self.informationLabel.text = ""
self.setupContinueButton()
}
private func updateViews() {
if let avatarImageView = self.creatorAvatarImageView {
let defaultavatarImage = AvatarGenerator.generateAvatar(forMatrixItem: self.viewModel.creatorUserId, withDisplayName: self.viewModel.creatorDisplayName)
avatarImageView.setImageURI(self.viewModel.creatorAvatarUrl, withType: nil, andImageOrientation: .up, previewImage: defaultavatarImage, mediaManager: self.viewModel.mediaManager)
}
if let creatorDisplayNameLabel = self.creatorDisplayNameLabel {
if let creatorDisplayName = self.viewModel.creatorDisplayName {
creatorDisplayNameLabel.text = creatorDisplayName
} else {
creatorDisplayNameLabel.isHidden = true
}
}
if let creatorUserIDLabel = self.creatorUserIDLabel {
creatorUserIDLabel.text = self.viewModel.creatorUserId
}
if let informationLabel = self.informationLabel {
informationLabel.text = VectorL10n.widgetRoomPermissionInformation(self.viewModel.widgetDomain ?? "")
}
}
private func setupCreatorAvatarImageView() {
self.creatorAvatarImageView.enableInMemoryCache = true
self.creatorAvatarImageView.clipsToBounds = true
}
private func setupContinueButton() {
self.continueButton.layer.masksToBounds = true
self.continueButton.setTitle(VectorL10n.continue, for: .normal)
}
// MARK: - Actions
@IBAction private func closeButtonAction(_ sender: Any) {
self.delegate?.widgetPermissionViewControllerDidTapCloseButton(self)
}
@IBAction private func continueButtonAction(_ sender: Any) {
self.delegate?.widgetPermissionViewControllerDidTapContinueButton(self)
}
}
// MARK: - SlidingModalPresentable
extension WidgetPermissionViewController: SlidingModalPresentable {
func allowsDismissOnBackgroundTap() -> Bool {
return false
}
func layoutHeightFittingWidth(_ width: CGFloat) -> CGFloat {
let sizingViewContoller: WidgetPermissionViewController
if let viewController = WidgetPermissionViewController.Sizing.viewController {
viewController.viewModel = self.viewModel
sizingViewContoller = viewController
} else {
sizingViewContoller = WidgetPermissionViewController.instantiate(with: self.viewModel)
WidgetPermissionViewController.Sizing.viewController = sizingViewContoller
}
let sizingViewContollerView: UIView = sizingViewContoller.view
if let widthConstraint = WidgetPermissionViewController.Sizing.widthConstraint {
widthConstraint.constant = width
} else {
let widthConstraint = sizingViewContollerView.widthAnchor.constraint(equalToConstant: width)
widthConstraint.isActive = true
WidgetPermissionViewController.Sizing.widthConstraint = widthConstraint
sizingViewContollerView.heightAnchor.constraint(equalToConstant: 0)
}
sizingViewContollerView.layoutIfNeeded()
return sizingViewContoller.scrollView.contentSize.height
}
}

View file

@ -0,0 +1,36 @@
/*
Copyright 2019 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import Foundation
/// View model used by `WidgetPermissionViewController`
@objcMembers
final class WidgetPermissionViewModel: NSObject {
let creatorUserId: String
let creatorDisplayName: String?
let creatorAvatarUrl: String?
let widgetDomain: String?
let mediaManager: MXMediaManager
init(creatorUserId: String, creatorDisplayName: String?, creatorAvatarUrl: String?, widgetDomain: String?, mediaManager: MXMediaManager) {
self.creatorUserId = creatorUserId
self.creatorDisplayName = creatorDisplayName
self.creatorAvatarUrl = creatorAvatarUrl
self.widgetDomain = widgetDomain
self.mediaManager = mediaManager
}
}