From 5bd2308d26f8edca7bff4876fc658039e23c845d Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Tue, 4 Feb 2020 21:13:30 +1100 Subject: [PATCH] Implement open group suggestion sheet --- Signal.xcodeproj/project.pbxproj | 10 ++- .../ChatBubbles.imageset/ChatBubbles.pdf | Bin 0 -> 1485 bytes .../ChatBubbles.imageset/Contents.json | 12 +++ Signal/src/Loki/Style Guide/Values.swift | 4 +- .../View Controllers/DeviceNameModal.swift | 2 +- Signal/src/Loki/View Controllers/HomeVC.swift | 7 ++ Signal/src/Loki/View Controllers/Modal.swift | 2 +- .../OpenGroupSuggestionSheet.swift | 77 ++++++++++++++++++ Signal/src/Loki/View Controllers/Sheet.swift | 71 ++++++++++++++++ .../translations/en.lproj/Localizable.strings | 4 + 10 files changed, 184 insertions(+), 5 deletions(-) create mode 100644 Signal/Images.xcassets/Loki V2/ChatBubbles.imageset/ChatBubbles.pdf create mode 100644 Signal/Images.xcassets/Loki V2/ChatBubbles.imageset/Contents.json create mode 100644 Signal/src/Loki/View Controllers/OpenGroupSuggestionSheet.swift create mode 100644 Signal/src/Loki/View Controllers/Sheet.swift diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index 77980091e..20a976c65 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -615,6 +615,8 @@ B9EB5ABD1884C002007CBB57 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B9EB5ABC1884C002007CBB57 /* MessageUI.framework */; }; BFF3FB9730634F37D25903F4 /* Pods_Signal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D17BB5C25D615AB49813100C /* Pods_Signal.framework */; }; C34C8F7423A7830B00D82669 /* SpaceMono-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C34C8F7323A7830A00D82669 /* SpaceMono-Bold.ttf */; }; + C3DFFAC623E96F0D0058DAF8 /* Sheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3DFFAC523E96F0D0058DAF8 /* Sheet.swift */; }; + C3DFFAC823E970080058DAF8 /* OpenGroupSuggestionSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3DFFAC723E970080058DAF8 /* OpenGroupSuggestionSheet.swift */; }; CC875800737563D6891B741D /* Pods_SignalTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 748A5CAEDD7C919FC64C6807 /* Pods_SignalTests.framework */; }; D202868116DBE0E7009068E9 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2AEACDB16C426DA00C364C0 /* CFNetwork.framework */; }; D202868216DBE0F4009068E9 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2179CFD16BB0B480006F3AB /* SystemConfiguration.framework */; }; @@ -1458,6 +1460,8 @@ B97940261832BD2400BD66CB /* UIUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIUtil.m; sourceTree = ""; }; B9EB5ABC1884C002007CBB57 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; C34C8F7323A7830A00D82669 /* SpaceMono-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SpaceMono-Bold.ttf"; sourceTree = ""; }; + C3DFFAC523E96F0D0058DAF8 /* Sheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sheet.swift; sourceTree = ""; }; + C3DFFAC723E970080058DAF8 /* OpenGroupSuggestionSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenGroupSuggestionSheet.swift; sourceTree = ""; }; D17BB5C25D615AB49813100C /* Pods_Signal.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Signal.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D2179CFB16BB0B3A0006F3AB /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; }; D2179CFD16BB0B480006F3AB /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; @@ -2810,6 +2814,7 @@ B80C6B582384C4E700FDBC8B /* DeviceNameModal.swift */, B80C6B5A2384C7F900FDBC8B /* DeviceNameModalDelegate.swift */, B82B408D239DC00D00A248E7 /* DisplayNameVC.swift */, + B88847BB23E10BC6009836D2 /* GroupMembersVC.swift */, B8BB82A4238F627000BA5194 /* HomeVC.swift */, B8CCF63E23975CFB0091D419 /* JoinPublicChatVC.swift */, B82B40872399EB0E00A248E7 /* LandingVC.swift */, @@ -2817,9 +2822,9 @@ B85357C623A1FB5100AAF6CD /* LinkDeviceVCDelegate.swift */, B86BD08323399ACF000F5AE3 /* Modal.swift */, B80A579E23DFF1F300876683 /* NewClosedGroupVC.swift */, - B88847BB23E10BC6009836D2 /* GroupMembersVC.swift */, B8CCF63623961D6D0091D419 /* NewPrivateChatVC.swift */, B894D0742339EDCF00B4D94D /* NukeDataModal.swift */, + C3DFFAC723E970080058DAF8 /* OpenGroupSuggestionSheet.swift */, B886B4A62398B23E00211ABE /* QRCodeVC.swift */, B82B408B239A068800A248E7 /* RegisterVC.swift */, B82B408F239DD75000A248E7 /* RestoreVC.swift */, @@ -2827,6 +2832,7 @@ B86BD08523399CEF000F5AE3 /* SeedModal.swift */, B85357C223A1BD1200AAF6CD /* SeedVC.swift */, B8CCF6422397711F0091D419 /* SettingsVC.swift */, + C3DFFAC523E96F0D0058DAF8 /* Sheet.swift */, ); path = "View Controllers"; sourceTree = ""; @@ -3922,6 +3928,7 @@ 346129991FD1E4DA00532771 /* SignalApp.m in Sources */, 3496957121A301A100DCFE74 /* OWSBackupImportJob.m in Sources */, 34BECE301F7ABCF800D7438D /* GifPickerLayout.swift in Sources */, + C3DFFAC623E96F0D0058DAF8 /* Sheet.swift in Sources */, 343A65951FC47D5E000477A1 /* DebugUISyncMessages.m in Sources */, 45C0DC1E1E69011F00E04C47 /* UIStoryboard+OWS.swift in Sources */, 452ECA4D1E087E7200E2F016 /* MessageFetcherJob.swift in Sources */, @@ -4046,6 +4053,7 @@ B8BB82BE2394D4CE00BA5194 /* Fonts.swift in Sources */, 3496957321A301A100DCFE74 /* OWSBackupJob.m in Sources */, 340FC8B3204DAC8D007AEB0F /* AppSettingsViewController.m in Sources */, + C3DFFAC823E970080058DAF8 /* OpenGroupSuggestionSheet.swift in Sources */, 34C4E2572118957600BEA353 /* OWSWebRTCDataProtos.pb.swift in Sources */, B894D0752339EDCF00B4D94D /* NukeDataModal.swift in Sources */, 346B66311F4E29B200E5122F /* CropScaleImageViewController.swift in Sources */, diff --git a/Signal/Images.xcassets/Loki V2/ChatBubbles.imageset/ChatBubbles.pdf b/Signal/Images.xcassets/Loki V2/ChatBubbles.imageset/ChatBubbles.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e63801c4c0c9c388739f4683ae7a1d0a50df6226 GIT binary patch literal 1485 zcmY!laBQyaXoFT{}N&1cbd{)bcw->B&F3JD!`?9{lR z^seNRSh>g_yT?a&D}a!5WXNgE!1547Zwlx%kwaVtHS$#b*|OTc%Jj zIkNlW^6y{1MK5cgzp^Ow*HoigkJfpYrmt5>{WVXjc1gOH_Ln%pt1a1@Ay+of$rL#k z%H;Pnt##GM3001|#!qB8X7kKCbjw}IRqf!>GfHk+HqVsO*CkKVVv;<2DAt4hb&iSj z?1`azW^*DVma1$zv{{pPLRR^b0MjYH+LB%K{p5O6#g4aiwd-g)7#&!9r(Lbxy6C-* z73bG3tbltc zMyk5_&JW*~DCF^Oj=TNh?XIm~@52Nm0It)5qFhyi;{VjJZaq7@THZD@xphOMvNB!Nvw800jDp20)I2zO$o(p@M#LB9H{8VxR<& z1R|(8MsRZ!^g}8OQWf+A64O%^R22-t<_07drRJ3YwZbxoZ)!?rqEmi_LNrjwK*7>X z&)ihO3{1v?bvWnel>oIAD}eGCBty9u<(C#9ISgVCSQO^gV4&?qiFw5ZAp4RlVZxpY zB}JvFFrG6|l}l<_W^!tfyAwzd;vfB>)Z+ZoqU6+K1yHC2A^8sEZdg7?_^ueFSKm7` zr5NZ7Pyhrez}#L6@+^`8W=IAE6y>LsCId?bjpW44qI?BIJwr1+0|kwYl9GaAD}7)P z14Yw|5(_dilZ*B8i_$eU!4^3K%Z-xE{5%&>^k}$P85tNE0FjA-rICfPMU*Czb>>Lc zLEP({Sdy5NpAI$%6f?!pxIn~UMNw)Rmw|!>mjN6on3I@AmfC&Osuc4tOl6fUXiJ3X6Mc_g=II}7h=wwhl q1m)+KD1bZ;Ni3duY55AEU, with event: UIEvent?) { + let touch = touches.first! + let location = touch.location(in: view) + if contentView.frame.contains(location) { + super.touchesBegan(touches, with: event) + } else { + close() + } + } + + @objc func close() { + dismiss(animated: true, completion: nil) + } +} diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 928ddf32d..f53bfc71c 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -2804,3 +2804,7 @@ "The ability to add members to a closed group is coming soon." = "The ability to add members to a closed group is coming soon."; "A closed group cannot have more than 10 members" = "A closed group cannot have more than 10 members"; "Closed groups are end-to-end encrypted group chats for up to 10 members. They provide the same privacy protections as one-on-one sessions." = "Closed groups are end-to-end encrypted group chats for up to 10 members. They provide the same privacy protections as one-on-one sessions."; +"No messages yet" = "No messages yet"; +"Would you like to join the Session Public Chat?" = "Would you like to join the Session Public Chat?"; +"Join Public Chat" = "Join Public Chat"; +"No, thank you" = "No, thank you";