Beispiel #1
0
        private void Init()
        {
            PinCell = new ExtendedSwitchCell
            {
                Text = "Unlock with PIN Code",
                On   = _settings.GetValueOrDefault(Constants.SettingPinUnlockOn, false)
            };
            PinCell.OnChanged += PinCell_Changed;

            LockOptionsCell = new ExtendedTextCell
            {
                Text            = "Lock Options",
                Detail          = GetLockOptionsDetailsText(),
                ShowDisclousure = true
            };
            LockOptionsCell.Tapped += LockOptionsCell_Tapped;

            var twoStepCell = new ExtendedTextCell
            {
                Text            = "Two-step Login",
                ShowDisclousure = true
            };

            twoStepCell.Tapped += TwoStepCell_Tapped;;

            var securitySecion = new TableSection("Security")
            {
                LockOptionsCell,
                PinCell,
                twoStepCell
            };

            if (_fingerprint.IsAvailable)
            {
                var fingerprintName = Device.OnPlatform(iOS: "Touch ID", Android: "Fingerprint", WinPhone: "Fingerprint");
                FingerprintCell = new ExtendedSwitchCell
                {
                    Text      = "Unlock with " + fingerprintName,
                    On        = _settings.GetValueOrDefault(Constants.SettingFingerprintUnlockOn, false),
                    IsEnabled = _fingerprint.IsAvailable
                };
                FingerprintCell.OnChanged += FingerprintCell_Changed;
                securitySecion.Insert(1, FingerprintCell);
            }

            var changeMasterPasswordCell = new ExtendedTextCell
            {
                Text            = "Change Master Password",
                ShowDisclousure = true
            };

            changeMasterPasswordCell.Tapped += ChangeMasterPasswordCell_Tapped;

            var changeEmailCell = new ExtendedTextCell
            {
                Text            = "Change Email",
                ShowDisclousure = true
            };

            changeEmailCell.Tapped += ChangeEmailCell_Tapped;

            var foldersCell = new ExtendedTextCell
            {
                Text            = "Folders",
                ShowDisclousure = true
            };

            foldersCell.Tapped += FoldersCell_Tapped;

            var syncCell = new ExtendedTextCell
            {
                Text            = "Sync",
                ShowDisclousure = true
            };

            syncCell.Tapped += SyncCell_Tapped;

            var lockCell = new ExtendedTextCell
            {
                Text = "Lock"
            };

            lockCell.Tapped += LockCell_Tapped;

            var logOutCell = new ExtendedTextCell
            {
                Text = "Log Out"
            };

            logOutCell.Tapped += LogOutCell_Tapped;

            var aboutCell = new ExtendedTextCell
            {
                Text            = "About",
                ShowDisclousure = true
            };

            aboutCell.Tapped += AboutCell_Tapped;

            var helpCell = new ExtendedTextCell
            {
                Text            = "Help and Feedback",
                ShowDisclousure = true
            };

            helpCell.Tapped += HelpCell_Tapped;

            var otherSection = new TableSection("Other")
            {
                aboutCell,
                helpCell
            };

            if (Device.OS == TargetPlatform.iOS)
            {
                var rateCell = new LongDetailViewCell("Rate the App",
                                                      "App Store ratings are reset with every new version of bitwarden."
                                                      + " Please consider helping us out with a good review!");
                rateCell.Tapped += RateCell_Tapped;
                otherSection.Add(rateCell);
            }
            else
            {
                var rateCell = new ExtendedTextCell
                {
                    Text                = "Rate the App",
                    Detail              = "Please consider helping us out with a good review!",
                    ShowDisclousure     = true,
                    DetailLineBreakMode = LineBreakMode.WordWrap
                };
                rateCell.Tapped += RateCell_Tapped;
                otherSection.Add(rateCell);
            }

            Table = new CustomTable
            {
                Root = new TableRoot
                {
                    securitySecion,
                    new TableSection("Account")
                    {
                        changeMasterPasswordCell,
                        changeEmailCell
                    },
                    new TableSection("Manage")
                    {
                        foldersCell,
                        syncCell
                    },
                    new TableSection("Current Session")
                    {
                        lockCell,
                        logOutCell
                    },
                    otherSection
                }
            };

            Title   = AppResources.Settings;
            Content = Table;
        }
Beispiel #2
0
        private async void Init()
        {
            PinCell = new ExtendedSwitchCell
            {
                Text = AppResources.UnlockWithPIN,
                On   = _settings.GetValueOrDefault(Constants.SettingPinUnlockOn, false)
            };

            LockOptionsCell = new ExtendedTextCell
            {
                Text            = AppResources.LockOptions,
                Detail          = GetLockOptionsDetailsText(),
                ShowDisclousure = true
            };

            TwoStepCell = new ExtendedTextCell
            {
                Text            = AppResources.TwoStepLogin,
                ShowDisclousure = true
            };

            LockCell = new ExtendedTextCell
            {
                Text = AppResources.Lock
            };

            var securitySecion = new TableSection(AppResources.Security)
            {
                LockOptionsCell,
                PinCell,
                LockCell,
                TwoStepCell
            };

            if ((await _fingerprint.GetAvailabilityAsync()) == FingerprintAvailability.Available)
            {
                var fingerprintName = Helpers.OnPlatform(
                    iOS: _deviceInfoService.HasFaceIdSupport ? AppResources.FaceID : AppResources.TouchID,
                    Android: AppResources.Fingerprint,
                    Windows: AppResources.WindowsHello);
                FingerprintCell = new ExtendedSwitchCell
                {
                    Text      = string.Format(AppResources.UnlockWith, fingerprintName),
                    On        = _settings.GetValueOrDefault(Constants.SettingFingerprintUnlockOn, false),
                    IsEnabled = true
                };
                securitySecion.Insert(1, FingerprintCell);
            }

            ChangeMasterPasswordCell = new ExtendedTextCell
            {
                Text            = AppResources.ChangeMasterPassword,
                ShowDisclousure = true
            };

            ChangeEmailCell = new ExtendedTextCell
            {
                Text            = AppResources.ChangeEmail,
                ShowDisclousure = true
            };

            FoldersCell = new ExtendedTextCell
            {
                Text            = AppResources.Folders,
                ShowDisclousure = true
            };

            SyncCell = new ExtendedTextCell
            {
                Text            = AppResources.Sync,
                ShowDisclousure = true
            };

            LogOutCell = new ExtendedTextCell
            {
                Text = AppResources.LogOut
            };

            AboutCell = new ExtendedTextCell
            {
                Text            = AppResources.About,
                ShowDisclousure = true
            };

            HelpCell = new ExtendedTextCell
            {
                Text            = AppResources.HelpAndFeedback,
                ShowDisclousure = true
            };

            OptionsCell = new ExtendedTextCell
            {
                Text            = AppResources.Options,
                ShowDisclousure = true
            };

            var otherSection = new TableSection(AppResources.Other)
            {
                OptionsCell,
                AboutCell,
                HelpCell
            };

            if (Device.RuntimePlatform == Device.iOS)
            {
                RateCellLong = new LongDetailViewCell(AppResources.RateTheApp, AppResources.RateTheAppDescriptionAppStore);
                otherSection.Add(RateCellLong);
            }
            else
            {
                RateCell = new ExtendedTextCell
                {
                    Text                = AppResources.RateTheApp,
                    Detail              = AppResources.RateTheAppDescription,
                    ShowDisclousure     = true,
                    DetailLineBreakMode = LineBreakMode.WordWrap
                };
                otherSection.Add(RateCell);
            }

            Table = new CustomTable
            {
                Root = new TableRoot
                {
                    securitySecion,
                    new TableSection(AppResources.Account)
                    {
                        ChangeMasterPasswordCell,
                        ChangeEmailCell,
                        LogOutCell
                    },
                    new TableSection(AppResources.Manage)
                    {
                        FoldersCell,
                        SyncCell
                    },
                    otherSection
                }
            };

            Title   = AppResources.Settings;
            Content = Table;
        }
Beispiel #3
0
        private void Init()
        {
            PinCell = new ExtendedSwitchCell
            {
                Text = AppResources.UnlockWithPIN,
                On   = _settings.GetValueOrDefault(Constants.SettingPinUnlockOn, false)
            };

            LockOptionsCell = new ExtendedTextCell
            {
                Text            = AppResources.LockOptions,
                Detail          = GetLockOptionsDetailsText(),
                ShowDisclousure = true
            };

            TwoStepCell = new ExtendedTextCell
            {
                Text            = AppResources.TwoStepLogin,
                ShowDisclousure = true
            };

            var securitySecion = new TableSection(AppResources.Security)
            {
                LockOptionsCell,
                PinCell,
                TwoStepCell
            };

            if (_fingerprint.IsAvailable)
            {
                var fingerprintName = Device.OnPlatform(iOS: AppResources.TouchID, Android: AppResources.Fingerprint,
                                                        WinPhone: AppResources.Fingerprint);
                FingerprintCell = new ExtendedSwitchCell
                {
                    Text      = string.Format(AppResources.UnlockWith, fingerprintName),
                    On        = _settings.GetValueOrDefault(Constants.SettingFingerprintUnlockOn, false),
                    IsEnabled = _fingerprint.IsAvailable
                };
                securitySecion.Insert(1, FingerprintCell);
            }

            ChangeMasterPasswordCell = new ExtendedTextCell
            {
                Text            = AppResources.ChangeMasterPassword,
                ShowDisclousure = true
            };

            ChangeEmailCell = new ExtendedTextCell
            {
                Text            = AppResources.ChangeEmail,
                ShowDisclousure = true
            };

            AnalyticsCell = new ExtendedSwitchCell
            {
                Text = AppResources.DisableGA,
                On   = _settings.GetValueOrDefault(Constants.SettingGaOptOut, false)
            };

            FoldersCell = new ExtendedTextCell
            {
                Text            = AppResources.Folders,
                ShowDisclousure = true
            };

            SyncCell = new ExtendedTextCell
            {
                Text            = AppResources.Sync,
                ShowDisclousure = true
            };

            LockCell = new ExtendedTextCell
            {
                Text = AppResources.Lock
            };

            LogOutCell = new ExtendedTextCell
            {
                Text = AppResources.LogOut
            };

            AboutCell = new ExtendedTextCell
            {
                Text            = AppResources.About,
                ShowDisclousure = true
            };

            HelpCell = new ExtendedTextCell
            {
                Text            = AppResources.HelpAndFeedback,
                ShowDisclousure = true
            };

            var otherSection = new TableSection(AppResources.Other)
            {
                AnalyticsCell,
                AboutCell,
                HelpCell
            };

            if (Device.OS == TargetPlatform.iOS)
            {
                RateCellLong = new LongDetailViewCell(AppResources.RateTheApp, AppResources.RateTheAppDescriptionAppStore);
                otherSection.Add(RateCellLong);
            }
            else
            {
                RateCell = new ExtendedTextCell
                {
                    Text                = AppResources.RateTheApp,
                    Detail              = AppResources.RateTheAppDescription,
                    ShowDisclousure     = true,
                    DetailLineBreakMode = LineBreakMode.WordWrap
                };
                otherSection.Add(RateCell);
            }

            Table = new CustomTable
            {
                Root = new TableRoot
                {
                    securitySecion,
                    new TableSection(AppResources.Account)
                    {
                        ChangeMasterPasswordCell,
                        ChangeEmailCell
                    },
                    new TableSection(AppResources.Manage)
                    {
                        FoldersCell,
                        SyncCell
                    },
                    new TableSection(AppResources.CurrentSession)
                    {
                        LockCell,
                        LogOutCell
                    },
                    otherSection
                }
            };

            Title   = AppResources.Settings;
            Content = Table;
        }
Beispiel #4
0
        private void Init()
        {
            PinCell = new ExtendedSwitchCell
            {
                Text = AppResources.UnlockWithPIN,
                On   = _settings.GetValueOrDefault(Constants.SettingPinUnlockOn, false)
            };
            PinCell.OnChanged += PinCell_Changed;

            LockOptionsCell = new ExtendedTextCell
            {
                Text            = AppResources.LockOptions,
                Detail          = GetLockOptionsDetailsText(),
                ShowDisclousure = true
            };
            LockOptionsCell.Tapped += LockOptionsCell_Tapped;

            var twoStepCell = new ExtendedTextCell
            {
                Text            = AppResources.TwoStepLogin,
                ShowDisclousure = true
            };

            twoStepCell.Tapped += TwoStepCell_Tapped;;

            var securitySecion = new TableSection(AppResources.Security)
            {
                LockOptionsCell,
                PinCell,
                twoStepCell
            };

            if (_fingerprint.IsAvailable)
            {
                var fingerprintName = Device.OnPlatform(iOS: AppResources.TouchID, Android: AppResources.Fingerprint,
                                                        WinPhone: AppResources.Fingerprint);
                FingerprintCell = new ExtendedSwitchCell
                {
                    Text      = string.Format(AppResources.UnlockWith, fingerprintName),
                    On        = _settings.GetValueOrDefault(Constants.SettingFingerprintUnlockOn, false),
                    IsEnabled = _fingerprint.IsAvailable
                };
                FingerprintCell.OnChanged += FingerprintCell_Changed;
                securitySecion.Insert(1, FingerprintCell);
            }

            var changeMasterPasswordCell = new ExtendedTextCell
            {
                Text            = AppResources.ChangeMasterPassword,
                ShowDisclousure = true
            };

            changeMasterPasswordCell.Tapped += ChangeMasterPasswordCell_Tapped;

            var changeEmailCell = new ExtendedTextCell
            {
                Text            = AppResources.ChangeEmail,
                ShowDisclousure = true
            };

            changeEmailCell.Tapped += ChangeEmailCell_Tapped;

            var foldersCell = new ExtendedTextCell
            {
                Text            = AppResources.Folders,
                ShowDisclousure = true
            };

            foldersCell.Tapped += FoldersCell_Tapped;

            var syncCell = new ExtendedTextCell
            {
                Text            = AppResources.Sync,
                ShowDisclousure = true
            };

            syncCell.Tapped += SyncCell_Tapped;

            var lockCell = new ExtendedTextCell
            {
                Text = AppResources.Lock
            };

            lockCell.Tapped += LockCell_Tapped;

            var logOutCell = new ExtendedTextCell
            {
                Text = AppResources.LogOut
            };

            logOutCell.Tapped += LogOutCell_Tapped;

            var aboutCell = new ExtendedTextCell
            {
                Text            = AppResources.About,
                ShowDisclousure = true
            };

            aboutCell.Tapped += AboutCell_Tapped;

            var helpCell = new ExtendedTextCell
            {
                Text            = AppResources.HelpAndFeedback,
                ShowDisclousure = true
            };

            helpCell.Tapped += HelpCell_Tapped;

            var otherSection = new TableSection(AppResources.Other)
            {
                aboutCell,
                helpCell
            };

            if (Device.OS == TargetPlatform.iOS)
            {
                var rateCell = new LongDetailViewCell(AppResources.RateTheApp, AppResources.RateTheAppDescriptionAppStore);
                rateCell.Tapped += RateCell_Tapped;
                otherSection.Add(rateCell);
            }
            else
            {
                var rateCell = new ExtendedTextCell
                {
                    Text                = AppResources.RateTheApp,
                    Detail              = AppResources.RateTheAppDescription,
                    ShowDisclousure     = true,
                    DetailLineBreakMode = LineBreakMode.WordWrap
                };
                rateCell.Tapped += RateCell_Tapped;
                otherSection.Add(rateCell);
            }

            Table = new CustomTable
            {
                Root = new TableRoot
                {
                    securitySecion,
                    new TableSection(AppResources.Account)
                    {
                        changeMasterPasswordCell,
                        changeEmailCell
                    },
                    new TableSection(AppResources.Manage)
                    {
                        foldersCell,
                        syncCell
                    },
                    new TableSection(AppResources.CurrentSession)
                    {
                        lockCell,
                        logOutCell
                    },
                    otherSection
                }
            };

            Title   = AppResources.Settings;
            Content = Table;
        }