marinofaggiana 4 years ago
parent
commit
aea12895c9

+ 21 - 7
iOSClient/AppDelegate.m

@@ -231,13 +231,8 @@
     }
     
     // Passcode
-    if ([[CCUtility getBlockCode] length] > 0) {
-        TOPasscodeViewController *passcodeViewController = [[TOPasscodeViewController alloc] initWithStyle:TOPasscodeViewStyleTranslucentDark passcodeType:TOPasscodeTypeSixDigits];
-        passcodeViewController.delegate = self;
-        passcodeViewController.allowCancel = false;
-        [self.window.rootViewController presentViewController:passcodeViewController animated:YES completion:nil];
-    }
-    
+    [self passcode];
+   
     // verify task (download/upload) lost
     [self verifyTaskLost];
     
@@ -1676,6 +1671,25 @@
 #pragma mark ===== Passcode Delegate =====
 #pragma --------------------------------------------------------------------------------------------
 
+- (void)passcode
+{
+    if ([[CCUtility getBlockCode] length] > 0) {
+        
+        TOPasscodeViewController *passcodeViewController = [[TOPasscodeViewController alloc] initWithStyle:TOPasscodeViewStyleTranslucentLight passcodeType:TOPasscodeTypeSixDigits];
+        if (@available(iOS 13.0, *)) {
+            if ([[UITraitCollection currentTraitCollection] userInterfaceStyle] == UIUserInterfaceStyleDark) {
+                passcodeViewController.style = TOPasscodeViewStyleTranslucentDark;
+            }
+        }
+    
+        passcodeViewController.delegate = self;
+        passcodeViewController.allowCancel = false;
+        passcodeViewController.keypadButtonShowLettering = false;
+        
+        [self.window.rootViewController presentViewController:passcodeViewController animated:YES completion:nil];
+    }
+}
+
 - (void)didTapCancelInPasscodeViewController:(TOPasscodeViewController *)passcodeViewController
 {
     [passcodeViewController dismissViewControllerAnimated:YES completion:nil];

+ 16 - 3
iOSClient/Settings/CCSettings.m

@@ -349,6 +349,12 @@
     if ([[CCUtility getBlockCode] length] == 0) {
         
         TOPasscodeSettingsViewController *settingsController = [[TOPasscodeSettingsViewController alloc] init];
+        if (@available(iOS 13.0, *)) {
+            if ([[UITraitCollection currentTraitCollection] userInterfaceStyle] == UIUserInterfaceStyleDark) {
+                settingsController.style = TOPasscodeSettingsViewStyleDark;
+            }
+        }
+        
         settingsController.requireCurrentPasscode = NO;
         settingsController.passcodeType = TOPasscodeTypeSixDigits;
         settingsController.delegate = self;
@@ -357,10 +363,17 @@
         
     } else {
      
-        TOPasscodeViewController *passcodeViewController = [[TOPasscodeViewController alloc] initWithStyle:TOPasscodeViewStyleTranslucentDark passcodeType:TOPasscodeTypeSixDigits];
-        passcodeViewController.delegate = self;
-        passcodeViewController.allowCancel = true;
+        TOPasscodeViewController *passcodeViewController = [[TOPasscodeViewController alloc] initWithStyle:TOPasscodeViewStyleTranslucentLight passcodeType:TOPasscodeTypeSixDigits];
+        if (@available(iOS 13.0, *)) {
+            if ([[UITraitCollection currentTraitCollection] userInterfaceStyle] == UIUserInterfaceStyleDark) {
+                passcodeViewController.style = TOPasscodeViewStyleTranslucentDark;
+            }
+        }
         
+        passcodeViewController.allowCancel = true;
+        passcodeViewController.delegate = self;
+        passcodeViewController.keypadButtonShowLettering = false;
+
         [self presentViewController:passcodeViewController animated:YES completion:nil];
     }
 }

+ 9 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -786,6 +786,15 @@
 "_voice_memo_filename_"     = "Voice memo";
 "_voice_memo_title_"        = "Upload voice memo";
 
+// Passcode
+
+"Enter Passcode"            = "Enter Passcode";
+"Enter a new passcode"      = "Enter a new passcode";
+"Confirm new passcode"      = "Confirm new passcode";
+"Passcodes didn't match. Try again." = "Passcodes didn't match. Try again.";
+"Delete"                    = "Delete";
+"Cancel"                    = "Cancel";
+
 // IM
 
 "_textnote_"                = "Text note";