diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 02e431629..44ab85466 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -169,7 +169,9 @@ 7BFD1A8A2745C4F000FB91B9 /* Permissions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BFD1A892745C4F000FB91B9 /* Permissions.swift */; }; 7BFD1A8C2747150E00FB91B9 /* TurnServerInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BFD1A8B2747150E00FB91B9 /* TurnServerInfo.swift */; }; 7BFD1A972747689000FB91B9 /* Session-Turn-Server in Resources */ = {isa = PBXBuildFile; fileRef = 7BFD1A962747689000FB91B9 /* Session-Turn-Server */; }; - 946B34472B5DF0B7004CB4A3 /* QRCodeScreem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 946B34462B5DF0B7004CB4A3 /* QRCodeScreem.swift */; }; + 946B34472B5DF0B7004CB4A3 /* QRCodeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 946B34462B5DF0B7004CB4A3 /* QRCodeScreen.swift */; }; + 946B34492B5E04BB004CB4A3 /* CustomTopTabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 946B34482B5E04BB004CB4A3 /* CustomTopTabBar.swift */; }; + 946B344B2B5E08F3004CB4A3 /* ScanQRCodeScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 946B344A2B5E08F3004CB4A3 /* ScanQRCodeScreen.swift */; }; 99978E3F7A80275823CA9014 /* Pods_GlobalDependencies_FrameworkAndExtensionDependencies_SessionNotificationServiceExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29E827FDF6C1032BB985740C /* Pods_GlobalDependencies_FrameworkAndExtensionDependencies_SessionNotificationServiceExtension.framework */; }; A11CD70D17FA230600A2D1B1 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A11CD70C17FA230600A2D1B1 /* QuartzCore.framework */; }; A163E8AB16F3F6AA0094D68B /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A163E8AA16F3F6A90094D68B /* Security.framework */; }; @@ -1306,7 +1308,9 @@ 8E946CB54A221018E23599DE /* Pods-GlobalDependencies-FrameworkAndExtensionDependencies-ExtendedDependencies-SessionUtilitiesKit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GlobalDependencies-FrameworkAndExtensionDependencies-ExtendedDependencies-SessionUtilitiesKit.debug.xcconfig"; path = "Target Support Files/Pods-GlobalDependencies-FrameworkAndExtensionDependencies-ExtendedDependencies-SessionUtilitiesKit/Pods-GlobalDependencies-FrameworkAndExtensionDependencies-ExtendedDependencies-SessionUtilitiesKit.debug.xcconfig"; sourceTree = ""; }; 92E8569C96285EE3CDB5960D /* Pods_GlobalDependencies_FrameworkAndExtensionDependencies_ExtendedDependencies_SignalUtilitiesKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GlobalDependencies_FrameworkAndExtensionDependencies_ExtendedDependencies_SignalUtilitiesKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 93359C81CF2660040B7CD106 /* Pods_GlobalDependencies_FrameworkAndExtensionDependencies_ExtendedDependencies_SessionUtilitiesKit_SessionUtilitiesKitTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GlobalDependencies_FrameworkAndExtensionDependencies_ExtendedDependencies_SessionUtilitiesKit_SessionUtilitiesKitTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 946B34462B5DF0B7004CB4A3 /* QRCodeScreem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRCodeScreem.swift; sourceTree = ""; }; + 946B34462B5DF0B7004CB4A3 /* QRCodeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRCodeScreen.swift; sourceTree = ""; }; + 946B34482B5E04BB004CB4A3 /* CustomTopTabBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTopTabBar.swift; sourceTree = ""; }; + 946B344A2B5E08F3004CB4A3 /* ScanQRCodeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScanQRCodeScreen.swift; sourceTree = ""; }; A11CD70C17FA230600A2D1B1 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; A163E8AA16F3F6A90094D68B /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; A1C32D4D17A0652C000A904E /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; @@ -2725,6 +2729,7 @@ 7B2561C329874851005C086C /* SessionCarouselView+Info.swift */, 7B3A3933298882D6002FE4AC /* SessionCarouselViewDelegate.swift */, 7B8914762A7CAAE200A4C627 /* SessionHostingViewController.swift */, + 946B344A2B5E08F3004CB4A3 /* ScanQRCodeScreen.swift */, ); path = Shared; sourceTree = ""; @@ -3053,7 +3058,7 @@ isa = PBXGroup; children = ( 7B87EF472A8DFBBF002A0E8F /* RecoveryPasswordScreen.swift */, - 946B34462B5DF0B7004CB4A3 /* QRCodeScreem.swift */, + 946B34462B5DF0B7004CB4A3 /* QRCodeScreen.swift */, FD37E9CD28A1E682003AE748 /* Views */, FD71162D28E168C700B47552 /* SettingsViewModel.swift */, B886B4A62398B23E00211ABE /* QRCodeVC.swift */, @@ -4022,6 +4027,7 @@ FD37EA0A28AB12E2003AE748 /* SessionCell.swift */, FD71164728E2CE8700B47552 /* SessionCell+AccessoryView.swift */, FD71164528E2CC1300B47552 /* SessionHighlightingBackgroundLabel.swift */, + 946B34482B5E04BB004CB4A3 /* CustomTopTabBar.swift */, ); path = Views; sourceTree = ""; @@ -6217,6 +6223,7 @@ B86BD08623399CEF000F5AE3 /* SeedModal.swift in Sources */, FDB7400D28EBEC240094D718 /* DateHeaderCell.swift in Sources */, B8D0A26925E4A2C200C1835E /* Onboarding.swift in Sources */, + 946B344B2B5E08F3004CB4A3 /* ScanQRCodeScreen.swift in Sources */, 34D1F0521F7E8EA30066283D /* GiphyDownloader.swift in Sources */, 4CC613362227A00400E21A3A /* ConversationSearch.swift in Sources */, FD87DCFE28B7582C00AF0F98 /* BlockedContactsViewModel.swift in Sources */, @@ -6250,7 +6257,7 @@ FD37EA1928AC5CCA003AE748 /* NotificationSoundViewModel.swift in Sources */, FD71163E28E2C82900B47552 /* SessionCell.swift in Sources */, 4CA485BB2232339F004B9E7D /* PhotoCaptureViewController.swift in Sources */, - 946B34472B5DF0B7004CB4A3 /* QRCodeScreem.swift in Sources */, + 946B34472B5DF0B7004CB4A3 /* QRCodeScreen.swift in Sources */, C328254925CA60E60062D0A7 /* ContextMenuVC+Action.swift in Sources */, FD71164628E2CC1300B47552 /* SessionHighlightingBackgroundLabel.swift in Sources */, 4542DF54208D40AC007B4E76 /* LoadingViewController.swift in Sources */, @@ -6326,6 +6333,7 @@ FD39352C28F382920084DADA /* VersionFooterView.swift in Sources */, FD12A83F2AD63BDF00EEBA0D /* Navigatable.swift in Sources */, 7B9F71D22852EEE2006DFE7B /* Emoji+SkinTones.swift in Sources */, + 946B34492B5E04BB004CB4A3 /* CustomTopTabBar.swift in Sources */, 7B7CB18E270D066F0079FF93 /* IncomingCallBanner.swift in Sources */, B8569AE325CBB19A00DBA3DB /* DocumentView.swift in Sources */, FDF848F529413EEC007DCAE5 /* SessionCell+Styling.swift in Sources */, diff --git a/Session/Meta/Translations/ar.lproj/Localizable.strings b/Session/Meta/Translations/ar.lproj/Localizable.strings index 3f9cc99b8..60271ff2a 100644 --- a/Session/Meta/Translations/ar.lproj/Localizable.strings +++ b/Session/Meta/Translations/ar.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/be.lproj/Localizable.strings b/Session/Meta/Translations/be.lproj/Localizable.strings index e6c43fc13..a9878aa32 100644 --- a/Session/Meta/Translations/be.lproj/Localizable.strings +++ b/Session/Meta/Translations/be.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/bg.lproj/Localizable.strings b/Session/Meta/Translations/bg.lproj/Localizable.strings index 98ea8685e..d5f414dd1 100644 --- a/Session/Meta/Translations/bg.lproj/Localizable.strings +++ b/Session/Meta/Translations/bg.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/bn.lproj/Localizable.strings b/Session/Meta/Translations/bn.lproj/Localizable.strings index 877f1a928..1ccdfab63 100644 --- a/Session/Meta/Translations/bn.lproj/Localizable.strings +++ b/Session/Meta/Translations/bn.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/cs.lproj/Localizable.strings b/Session/Meta/Translations/cs.lproj/Localizable.strings index 851f2140a..9f567b1d6 100644 --- a/Session/Meta/Translations/cs.lproj/Localizable.strings +++ b/Session/Meta/Translations/cs.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/da.lproj/Localizable.strings b/Session/Meta/Translations/da.lproj/Localizable.strings index 8ddca521c..a72f621ed 100644 --- a/Session/Meta/Translations/da.lproj/Localizable.strings +++ b/Session/Meta/Translations/da.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/de.lproj/Localizable.strings b/Session/Meta/Translations/de.lproj/Localizable.strings index 8a21b5cec..fe93f4ef1 100644 --- a/Session/Meta/Translations/de.lproj/Localizable.strings +++ b/Session/Meta/Translations/de.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/el.lproj/Localizable.strings b/Session/Meta/Translations/el.lproj/Localizable.strings index 0a136ea4a..9c8be7f4f 100644 --- a/Session/Meta/Translations/el.lproj/Localizable.strings +++ b/Session/Meta/Translations/el.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/en.lproj/Localizable.strings b/Session/Meta/Translations/en.lproj/Localizable.strings index 7a6848ff7..81c539f5c 100644 --- a/Session/Meta/Translations/en.lproj/Localizable.strings +++ b/Session/Meta/Translations/en.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/eo.lproj/Localizable.strings b/Session/Meta/Translations/eo.lproj/Localizable.strings index a4cb3fd03..00b19b415 100644 --- a/Session/Meta/Translations/eo.lproj/Localizable.strings +++ b/Session/Meta/Translations/eo.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/es-ES.lproj/Localizable.strings b/Session/Meta/Translations/es-ES.lproj/Localizable.strings index 08e0e0bf1..40344af23 100644 --- a/Session/Meta/Translations/es-ES.lproj/Localizable.strings +++ b/Session/Meta/Translations/es-ES.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/fa.lproj/Localizable.strings b/Session/Meta/Translations/fa.lproj/Localizable.strings index 018efb08b..a46f6c182 100644 --- a/Session/Meta/Translations/fa.lproj/Localizable.strings +++ b/Session/Meta/Translations/fa.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/fi.lproj/Localizable.strings b/Session/Meta/Translations/fi.lproj/Localizable.strings index 458785560..6c6f1ee26 100644 --- a/Session/Meta/Translations/fi.lproj/Localizable.strings +++ b/Session/Meta/Translations/fi.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/fil.lproj/Localizable.strings b/Session/Meta/Translations/fil.lproj/Localizable.strings index 73ec4bdba..02a808bfd 100644 --- a/Session/Meta/Translations/fil.lproj/Localizable.strings +++ b/Session/Meta/Translations/fil.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/fr.lproj/Localizable.strings b/Session/Meta/Translations/fr.lproj/Localizable.strings index 019b655ad..f93713ec5 100644 --- a/Session/Meta/Translations/fr.lproj/Localizable.strings +++ b/Session/Meta/Translations/fr.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/hi.lproj/Localizable.strings b/Session/Meta/Translations/hi.lproj/Localizable.strings index fed485b96..718ab63da 100644 --- a/Session/Meta/Translations/hi.lproj/Localizable.strings +++ b/Session/Meta/Translations/hi.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/hr.lproj/Localizable.strings b/Session/Meta/Translations/hr.lproj/Localizable.strings index d28da1ec6..18cba93b2 100644 --- a/Session/Meta/Translations/hr.lproj/Localizable.strings +++ b/Session/Meta/Translations/hr.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/hu.lproj/Localizable.strings b/Session/Meta/Translations/hu.lproj/Localizable.strings index 91fb0e039..c3a5fd21d 100644 --- a/Session/Meta/Translations/hu.lproj/Localizable.strings +++ b/Session/Meta/Translations/hu.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/id.lproj/Localizable.strings b/Session/Meta/Translations/id.lproj/Localizable.strings index 76e6dfb13..e35456a03 100644 --- a/Session/Meta/Translations/id.lproj/Localizable.strings +++ b/Session/Meta/Translations/id.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/it.lproj/Localizable.strings b/Session/Meta/Translations/it.lproj/Localizable.strings index 0ac5fe9c2..d8babe793 100644 --- a/Session/Meta/Translations/it.lproj/Localizable.strings +++ b/Session/Meta/Translations/it.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/ja.lproj/Localizable.strings b/Session/Meta/Translations/ja.lproj/Localizable.strings index 68c0a5046..f5810d829 100644 --- a/Session/Meta/Translations/ja.lproj/Localizable.strings +++ b/Session/Meta/Translations/ja.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/ko.lproj/Localizable.strings b/Session/Meta/Translations/ko.lproj/Localizable.strings index ce3ff4f82..e9d2918a8 100644 --- a/Session/Meta/Translations/ko.lproj/Localizable.strings +++ b/Session/Meta/Translations/ko.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/ku.lproj/Localizable.strings b/Session/Meta/Translations/ku.lproj/Localizable.strings index 6f40ec1c3..ca9ecd027 100644 --- a/Session/Meta/Translations/ku.lproj/Localizable.strings +++ b/Session/Meta/Translations/ku.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/lt.lproj/Localizable.strings b/Session/Meta/Translations/lt.lproj/Localizable.strings index 123df26f4..5b9205cd8 100644 --- a/Session/Meta/Translations/lt.lproj/Localizable.strings +++ b/Session/Meta/Translations/lt.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/lv.lproj/Localizable.strings b/Session/Meta/Translations/lv.lproj/Localizable.strings index bbc486bef..fd2c97972 100644 --- a/Session/Meta/Translations/lv.lproj/Localizable.strings +++ b/Session/Meta/Translations/lv.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/ne-NP.lproj/Localizable.strings b/Session/Meta/Translations/ne-NP.lproj/Localizable.strings index a6bdbcd58..285bef42b 100644 --- a/Session/Meta/Translations/ne-NP.lproj/Localizable.strings +++ b/Session/Meta/Translations/ne-NP.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/nl.lproj/Localizable.strings b/Session/Meta/Translations/nl.lproj/Localizable.strings index a181dc12d..e3c1d36e8 100644 --- a/Session/Meta/Translations/nl.lproj/Localizable.strings +++ b/Session/Meta/Translations/nl.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/no.lproj/Localizable.strings b/Session/Meta/Translations/no.lproj/Localizable.strings index 0f357acb6..031a4aac0 100644 --- a/Session/Meta/Translations/no.lproj/Localizable.strings +++ b/Session/Meta/Translations/no.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/pl.lproj/Localizable.strings b/Session/Meta/Translations/pl.lproj/Localizable.strings index 802e53d86..7a482613a 100644 --- a/Session/Meta/Translations/pl.lproj/Localizable.strings +++ b/Session/Meta/Translations/pl.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/pt-BR.lproj/Localizable.strings b/Session/Meta/Translations/pt-BR.lproj/Localizable.strings index 32e8b3ec6..9d78b429b 100644 --- a/Session/Meta/Translations/pt-BR.lproj/Localizable.strings +++ b/Session/Meta/Translations/pt-BR.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/pt-PT.lproj/Localizable.strings b/Session/Meta/Translations/pt-PT.lproj/Localizable.strings index 21f8e0ef7..8fdc08368 100644 --- a/Session/Meta/Translations/pt-PT.lproj/Localizable.strings +++ b/Session/Meta/Translations/pt-PT.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/ro.lproj/Localizable.strings b/Session/Meta/Translations/ro.lproj/Localizable.strings index c7325f2b8..6581b502b 100644 --- a/Session/Meta/Translations/ro.lproj/Localizable.strings +++ b/Session/Meta/Translations/ro.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/ru.lproj/Localizable.strings b/Session/Meta/Translations/ru.lproj/Localizable.strings index c7906f528..77ee85dcd 100644 --- a/Session/Meta/Translations/ru.lproj/Localizable.strings +++ b/Session/Meta/Translations/ru.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/si-LK.lproj/Localizable.strings b/Session/Meta/Translations/si-LK.lproj/Localizable.strings index 8db4bad3d..279936c5a 100644 --- a/Session/Meta/Translations/si-LK.lproj/Localizable.strings +++ b/Session/Meta/Translations/si-LK.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/sk.lproj/Localizable.strings b/Session/Meta/Translations/sk.lproj/Localizable.strings index e2135dff6..07b8cca5a 100644 --- a/Session/Meta/Translations/sk.lproj/Localizable.strings +++ b/Session/Meta/Translations/sk.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/sl.lproj/Localizable.strings b/Session/Meta/Translations/sl.lproj/Localizable.strings index 4835a23c2..e6fad92e2 100644 --- a/Session/Meta/Translations/sl.lproj/Localizable.strings +++ b/Session/Meta/Translations/sl.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/sv-SE.lproj/Localizable.strings b/Session/Meta/Translations/sv-SE.lproj/Localizable.strings index c1055ecca..7fa25b410 100644 --- a/Session/Meta/Translations/sv-SE.lproj/Localizable.strings +++ b/Session/Meta/Translations/sv-SE.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/th.lproj/Localizable.strings b/Session/Meta/Translations/th.lproj/Localizable.strings index 424d08d85..55346c4ad 100644 --- a/Session/Meta/Translations/th.lproj/Localizable.strings +++ b/Session/Meta/Translations/th.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/tr.lproj/Localizable.strings b/Session/Meta/Translations/tr.lproj/Localizable.strings index ee499dc11..616b7e3ed 100644 --- a/Session/Meta/Translations/tr.lproj/Localizable.strings +++ b/Session/Meta/Translations/tr.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/uk.lproj/Localizable.strings b/Session/Meta/Translations/uk.lproj/Localizable.strings index 8737ff8d4..793d12927 100644 --- a/Session/Meta/Translations/uk.lproj/Localizable.strings +++ b/Session/Meta/Translations/uk.lproj/Localizable.strings @@ -860,3 +860,7 @@ The point that a message will disappear in a disappearing message update message "hide_recovery_password_modal_warning_2" = "We strongly recommend you save your recovery password in a safe and secure place before continuing."; "hide_recovery_password_modal_confirmation" = "Are you sure you want to permanently hide your recovery password on this device? This cannot be undone."; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/vi.lproj/Localizable.strings b/Session/Meta/Translations/vi.lproj/Localizable.strings index fe0c14359..a7a3b771c 100644 --- a/Session/Meta/Translations/vi.lproj/Localizable.strings +++ b/Session/Meta/Translations/vi.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/zh-CN.lproj/Localizable.strings b/Session/Meta/Translations/zh-CN.lproj/Localizable.strings index f72a8bd0d..0d6d02479 100644 --- a/Session/Meta/Translations/zh-CN.lproj/Localizable.strings +++ b/Session/Meta/Translations/zh-CN.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Meta/Translations/zh-TW.lproj/Localizable.strings b/Session/Meta/Translations/zh-TW.lproj/Localizable.strings index 441911c81..e4fddabbc 100644 --- a/Session/Meta/Translations/zh-TW.lproj/Localizable.strings +++ b/Session/Meta/Translations/zh-TW.lproj/Localizable.strings @@ -862,3 +862,7 @@ The point that a message will disappear in a disappearing message update message "view_qr_code_button_title" = "View QR"; "view_mnemonic_button_title" = "View Password"; "yes_button_title" = "Yes"; + +"settings_view_qr_code_tab_title" = "View"; +"settings_scan_qr_code_tab_title" = "Scan"; +"settings_view_my_qr_code_explanation" = "This is your Account ID. Other users can scan it to start a conversation with you."; diff --git a/Session/Onboarding/LoadAccountScreen.swift b/Session/Onboarding/LoadAccountScreen.swift index de2ca4059..9664e7733 100644 --- a/Session/Onboarding/LoadAccountScreen.swift +++ b/Session/Onboarding/LoadAccountScreen.swift @@ -24,21 +24,26 @@ struct LoadAccountScreen: View { VStack( spacing: 0 ){ - CustomTopTabBar(tabIndex: $tabIndex) - .frame(maxWidth: .infinity) + CustomTopTabBar( + tabIndex: $tabIndex, + tabTitles: [ + "onboarding_recovery_password_tab_title".localized(), + "vc_qr_code_view_scan_qr_code_tab_title".localized() + ] + ).frame(maxWidth: .infinity) if tabIndex == 0 { - EnterRecoveryPasswordView( + EnterRecoveryPasswordScreen( $recoveryPassword, error: $errorString, continueWithMnemonic: continueWithMnemonic ) } else { - ScanQRCodeView( + ScanQRCodeScreen( $hexEncodedSeed, error: $errorString, - continueWithhexEncodedSeed: continueWithhexEncodedSeed + continueAction: continueWithhexEncodedSeed ) } } @@ -98,72 +103,7 @@ struct LoadAccountScreen: View { } } -struct TabBarButton: View { - @Binding var isSelected: Bool - - let text: String - - var body: some View { - ZStack( - alignment: .bottom - ) { - Text(text) - .bold() - .font(.system(size: Values.mediumFontSize)) - .foregroundColor(themeColor: .textPrimary) - .padding(.bottom, 5) - .frame( - maxWidth: .infinity, - maxHeight: .infinity - ) - if isSelected { - Rectangle() - .foregroundColor(themeColor: .primary) - .frame( - maxWidth: .infinity, - maxHeight: 5 - ) - .padding(.horizontal, Values.verySmallSpacing) - } - - } - } -} - -struct CustomTopTabBar: View { - @Binding var tabIndex: Int - - private static let height = isIPhone5OrSmaller ? CGFloat(32) : CGFloat(48) - - var body: some View { - HStack(spacing: 0) { - TabBarButton( - isSelected: .constant(tabIndex == 0), - text: "onboarding_recovery_password_tab_title".localized() - ) - .onTapGesture { onButtonTapped(index: 0) } - - TabBarButton( - isSelected: .constant(tabIndex == 1), - text: "vc_qr_code_view_scan_qr_code_tab_title".localized() - ) - .onTapGesture { onButtonTapped(index: 1) } - } - .frame( - maxWidth: .infinity, - maxHeight: Self.height - ) - .border(width: 1, edges: [.bottom], color: .borderSeparator) - } - - private func onButtonTapped(index: Int) { - withAnimation(.easeInOut(duration: 0.2)) { - tabIndex = index - } - } -} - -struct EnterRecoveryPasswordView: View{ +struct EnterRecoveryPasswordScreen: View{ @Binding var recoveryPassword: String @Binding var error: String? @@ -260,73 +200,6 @@ struct EnterRecoveryPasswordView: View{ } } -struct ScanQRCodeView: View { - @Binding var hexEncodedSeed: String - @Binding var error: String? - @State var hasCameraAccess: Bool = (AVCaptureDevice.authorizationStatus(for: .video) == .authorized) - - var continueWithhexEncodedSeed: (((() -> ())?) -> Void)? - - init( - _ hexEncodedSeed: Binding, - error: Binding, - continueWithhexEncodedSeed: (((() -> ())?) -> Void)? - ) { - self._hexEncodedSeed = hexEncodedSeed - self._error = error - self.continueWithhexEncodedSeed = continueWithhexEncodedSeed - } - - var body: some View{ - ZStack{ - if hasCameraAccess { - VStack { - QRCodeScanningVC_SwiftUI { result, onError in - hexEncodedSeed = result - continueWithhexEncodedSeed?(onError) - } - } - .frame( - maxWidth: .infinity, - maxHeight: .infinity - ) - } else { - VStack( - alignment: .center, - spacing: Values.mediumSpacing - ) { - Spacer() - - Text("vc_scan_qr_code_camera_access_explanation".localized()) - .font(.system(size: Values.smallFontSize)) - .foregroundColor(themeColor: .textPrimary) - .multilineTextAlignment(.center) - - Button { - requestCameraAccess() - } label: { - Text("continue_2".localized()) - .bold() - .font(.system(size: Values.mediumFontSize)) - .foregroundColor(themeColor: .primary) - } - - Spacer() - } - .padding(.horizontal, Values.massiveSpacing) - .padding(.bottom, Values.massiveSpacing) - } - } - .toastView(message: $error) - } - - private func requestCameraAccess() { - Permissions.requestCameraPermissionIfNeeded { - hasCameraAccess.toggle() - } - } -} - struct LoadAccountView_Previews: PreviewProvider { static var previews: some View { LoadAccountScreen() diff --git a/Session/Settings/QRCodeScreem.swift b/Session/Settings/QRCodeScreem.swift deleted file mode 100644 index 608069f81..000000000 --- a/Session/Settings/QRCodeScreem.swift +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright © 2024 Rangeproof Pty Ltd. All rights reserved. - -import SwiftUI - -struct QRCodeScreen: View { - var body: some View { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) - } -} - -#Preview { - QRCodeScreen() -} diff --git a/Session/Settings/QRCodeScreen.swift b/Session/Settings/QRCodeScreen.swift new file mode 100644 index 000000000..032a70ec3 --- /dev/null +++ b/Session/Settings/QRCodeScreen.swift @@ -0,0 +1,102 @@ +// Copyright © 2024 Rangeproof Pty Ltd. All rights reserved. + +import SwiftUI +import SessionUIKit +import SignalUtilitiesKit +import SessionUtilitiesKit +import AVFoundation + +struct QRCodeScreen: View { + @EnvironmentObject var host: HostWrapper + + @State var tabIndex = 0 + @State private var accountId: String = "" + @State private var errorString: String? = nil + + var body: some View { + ZStack(alignment: .topLeading) { + if #available(iOS 14.0, *) { + ThemeManager.currentTheme.colorSwiftUI(for: .backgroundPrimary).ignoresSafeArea() + } else { + ThemeManager.currentTheme.colorSwiftUI(for: .backgroundPrimary) + } + VStack( + spacing: 0 + ){ + CustomTopTabBar( + tabIndex: $tabIndex, + tabTitles: [ + "settings_view_qr_code_tab_title".localized(), + "settings_scan_qr_code_tab_title".localized() + ] + ).frame(maxWidth: .infinity) + + if tabIndex == 0 { + MyQRCodeScreen() + } + else { + ScanQRCodeScreen( + $accountId, + error: $errorString, + continueAction: continueWithAccountId + ) + } + } + } + } + + fileprivate func startNewPrivateChatIfPossible(with hexEncodedPublicKey: String, onError: (() -> ())?) { + if !KeyPair.isValidHexEncodedPublicKey(candidate: hexEncodedPublicKey) { + let modal: ConfirmationModal = ConfirmationModal( + info: ConfirmationModal.Info( + title: "invalid_session_id".localized(), + body: .text("INVALID_SESSION_ID_MESSAGE".localized()), + cancelTitle: "BUTTON_OK".localized(), + cancelStyle: .alert_text, + afterClosed: onError + ) + ) + self.host.controller?.present(modal, animated: true) + } + else { + SessionApp.presentConversationCreatingIfNeeded( + for: hexEncodedPublicKey, + variant: .contact, + dismissing: self.host.controller, + animated: false + ) + } + } + + func continueWithAccountId(onError: (() -> ())?) { + let hexEncodedPublicKey = accountId + startNewPrivateChatIfPossible(with: hexEncodedPublicKey, onError: onError) + } +} + +struct MyQRCodeScreen: View { + var body: some View{ + VStack( + spacing: Values.mediumSpacing + ) { + QRCodeView( + string: getUserHexEncodedPublicKey(), + hasBackground: false, + logo: "SessionWhite40", + themeStyle: ThemeManager.currentTheme.interfaceStyle + ) + .aspectRatio(1, contentMode: .fit) + + Text("settings_view_my_qr_code_explanation".localized()) + .font(.system(size: Values.verySmallFontSize)) + .foregroundColor(themeColor: .textSecondary) + .multilineTextAlignment(.center) + } + .padding(.horizontal, Values.mediumSpacing) + .padding(.all, Values.veryLargeSpacing) + } +} + +#Preview { + QRCodeScreen() +} diff --git a/Session/Settings/RecoveryPasswordScreen.swift b/Session/Settings/RecoveryPasswordScreen.swift index e1a68d751..058ba7356 100644 --- a/Session/Settings/RecoveryPasswordScreen.swift +++ b/Session/Settings/RecoveryPasswordScreen.swift @@ -81,7 +81,7 @@ struct RecoveryPasswordScreen: View { QRCodeView( string: mnemonic, hasBackground: false, - hasLogo: true, + logo: "SessionShieldFilled", themeStyle: ThemeManager.currentTheme.interfaceStyle ) .padding(.all, Values.smallSpacing) diff --git a/Session/Settings/SettingsViewModel.swift b/Session/Settings/SettingsViewModel.swift index 2f4407bb4..edcb80721 100644 --- a/Session/Settings/SettingsViewModel.swift +++ b/Session/Settings/SettingsViewModel.swift @@ -160,7 +160,9 @@ class SettingsViewModel: SessionTableViewModel, NavigationItemSource, Navigatabl style: .plain, accessibilityIdentifier: "Show QR code button", action: { [weak self] in - self?.transitionToScreen(QRCodeVC()) + let viewController: SessionHostingViewController = SessionHostingViewController(rootView: QRCodeScreen()) + viewController.setNavBarTitle("vc_qr_code_title".localized()) + self?.transitionToScreen(viewController) } ) ] diff --git a/Session/Shared/ScanQRCodeScreen.swift b/Session/Shared/ScanQRCodeScreen.swift new file mode 100644 index 000000000..e810b25d4 --- /dev/null +++ b/Session/Shared/ScanQRCodeScreen.swift @@ -0,0 +1,71 @@ +// Copyright © 2024 Rangeproof Pty Ltd. All rights reserved. + +import SwiftUI +import SessionUIKit + +struct ScanQRCodeScreen: View { + @Binding var result: String + @Binding var error: String? + @State var hasCameraAccess: Bool = (AVCaptureDevice.authorizationStatus(for: .video) == .authorized) + + var continueAction: (((() -> ())?) -> Void)? + + init( + _ result: Binding, + error: Binding, + continueAction: (((() -> ())?) -> Void)? + ) { + self._result = result + self._error = error + self.continueAction = continueAction + } + + var body: some View{ + ZStack{ + if hasCameraAccess { + VStack { + QRCodeScanningVC_SwiftUI { result, onError in + self.result = result + continueAction?(onError) + } + } + .frame( + maxWidth: .infinity, + maxHeight: .infinity + ) + } else { + VStack( + alignment: .center, + spacing: Values.mediumSpacing + ) { + Spacer() + + Text("vc_scan_qr_code_camera_access_explanation".localized()) + .font(.system(size: Values.smallFontSize)) + .foregroundColor(themeColor: .textPrimary) + .multilineTextAlignment(.center) + + Button { + requestCameraAccess() + } label: { + Text("continue_2".localized()) + .bold() + .font(.system(size: Values.mediumFontSize)) + .foregroundColor(themeColor: .primary) + } + + Spacer() + } + .padding(.horizontal, Values.massiveSpacing) + .padding(.bottom, Values.massiveSpacing) + } + } + .toastView(message: $error) + } + + private func requestCameraAccess() { + Permissions.requestCameraPermissionIfNeeded { + hasCameraAccess.toggle() + } + } +} diff --git a/Session/Shared/Views/CustomTopTabBar.swift b/Session/Shared/Views/CustomTopTabBar.swift new file mode 100644 index 000000000..f84323c81 --- /dev/null +++ b/Session/Shared/Views/CustomTopTabBar.swift @@ -0,0 +1,66 @@ +// Copyright © 2024 Rangeproof Pty Ltd. All rights reserved. + +import SwiftUI +import SessionUIKit + +struct TabBarButton: View { + @Binding var isSelected: Bool + + let text: String + + var body: some View { + ZStack( + alignment: .bottom + ) { + Text(text) + .bold() + .font(.system(size: Values.mediumFontSize)) + .foregroundColor(themeColor: .textPrimary) + .padding(.bottom, 5) + .frame( + maxWidth: .infinity, + maxHeight: .infinity + ) + if isSelected { + Rectangle() + .foregroundColor(themeColor: .primary) + .frame( + maxWidth: .infinity, + maxHeight: 5 + ) + .padding(.horizontal, Values.verySmallSpacing) + } + + } + } +} + +struct CustomTopTabBar: View { + @Binding var tabIndex: Int + let tabTitles: [String] + + private static let height = isIPhone5OrSmaller ? CGFloat(32) : CGFloat(48) + + var body: some View { + HStack(spacing: 0) { + ForEach(0..