ui: refactor QR code screen with SwiftUI and update QR code style

pull/891/head
Ryan ZHAO 1 year ago
parent 5eca31aaa2
commit 9faf835617

@ -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 = "<group>"; };
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 = "<group>"; };
946B34462B5DF0B7004CB4A3 /* QRCodeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRCodeScreen.swift; sourceTree = "<group>"; };
946B34482B5E04BB004CB4A3 /* CustomTopTabBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTopTabBar.swift; sourceTree = "<group>"; };
946B344A2B5E08F3004CB4A3 /* ScanQRCodeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScanQRCodeScreen.swift; sourceTree = "<group>"; };
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 = "<group>";
@ -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 = "<group>";
@ -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 */,

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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.";

@ -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<String>,
error: Binding<String?>,
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()

@ -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()
}

@ -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()
}

@ -81,7 +81,7 @@ struct RecoveryPasswordScreen: View {
QRCodeView(
string: mnemonic,
hasBackground: false,
hasLogo: true,
logo: "SessionShieldFilled",
themeStyle: ThemeManager.currentTheme.interfaceStyle
)
.padding(.all, Values.smallSpacing)

@ -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)
}
)
]

@ -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<String>,
error: Binding<String?>,
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()
}
}
}

@ -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..<tabTitles.count, id: \.self) { index in
TabBarButton(
isSelected: .constant(tabIndex == index),
text: tabTitles[index]
)
.onTapGesture { onButtonTapped(index: index) }
}
}
.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
}
}
}

@ -49,7 +49,7 @@ import SessionUIKit
struct QRCodeView: View {
let string: String
let hasBackground: Bool
let hasLogo: Bool
let logo: String?
let themeStyle: UIUserInterfaceStyle
var backgroundThemeColor: ThemeValue {
switch themeStyle {
@ -87,12 +87,12 @@ struct QRCodeView: View {
)
.padding(.vertical, Values.smallSpacing)
if hasLogo {
if let logo = logo {
ZStack(alignment: .center) {
Rectangle()
.fill(themeColor: backgroundThemeColor)
Image("SessionShieldFilled")
Image(logo)
.resizable()
.renderingMode(.template)
.foregroundColor(themeColor: qrCodeThemeColor)

Loading…
Cancel
Save