コード例 #1
0
        private void Init()
        {
            WebsiteIconsCell = new ExtendedSwitchCell
            {
                Text = AppResources.DisableWebsiteIcons,
                On   = _appSettings.DisableWebsiteIcons
            };

            var websiteIconsTable = new FormTableView(this, true)
            {
                Root = new TableRoot
                {
                    new TableSection(Helpers.GetEmptyTableSectionTitle())
                    {
                        WebsiteIconsCell
                    }
                }
            };

            CopyTotpCell = new ExtendedSwitchCell
            {
                Text = AppResources.DisableAutoTotpCopy,
                On   = _settings.GetValueOrDefault(Constants.SettingDisableTotpCopy, false)
            };

            var totpTable = new FormTableView(this)
            {
                Root = new TableRoot
                {
                    new TableSection(Helpers.GetEmptyTableSectionTitle())
                    {
                        CopyTotpCell
                    }
                }
            };

            CopyTotpLabel = new FormTableLabel(this)
            {
                Text = AppResources.DisableAutoTotpCopyDescription
            };

            WebsiteIconsLabel = new FormTableLabel(this)
            {
                Text = AppResources.DisableWebsiteIconsDescription
            };

            StackLayout = new RedrawableStackLayout
            {
                Children =
                {
                    websiteIconsTable, WebsiteIconsLabel,
                    totpTable,         CopyTotpLabel
                },
                Spacing = 0
            };

            if (Device.RuntimePlatform == Device.Android)
            {
                AutofillAlwaysCell = new ExtendedSwitchCell
                {
                    Text = AppResources.AutofillAlways,
                    On   = !_appSettings.AutofillPersistNotification && !_appSettings.AutofillPasswordField
                };

                var autofillAlwaysTable = new FormTableView(this, true)
                {
                    Root = new TableRoot
                    {
                        new TableSection(AppResources.AutofillAccessibilityService)
                        {
                            AutofillAlwaysCell
                        }
                    }
                };

                AutofillAlwaysLabel = new FormTableLabel(this)
                {
                    Text = AppResources.AutofillAlwaysDescription
                };

                AutofillPersistNotificationCell = new ExtendedSwitchCell
                {
                    Text = AppResources.AutofillPersistNotification,
                    On   = _appSettings.AutofillPersistNotification
                };

                var autofillPersistNotificationTable = new FormTableView(this)
                {
                    Root = new TableRoot
                    {
                        new TableSection(Helpers.GetEmptyTableSectionTitle())
                        {
                            AutofillPersistNotificationCell
                        }
                    }
                };

                AutofillPersistNotificationLabel = new FormTableLabel(this)
                {
                    Text = AppResources.AutofillPersistNotificationDescription
                };

                AutofillPasswordFieldCell = new ExtendedSwitchCell
                {
                    Text = AppResources.AutofillPasswordField,
                    On   = _appSettings.AutofillPasswordField
                };

                var autofillPasswordFieldTable = new FormTableView(this)
                {
                    Root = new TableRoot
                    {
                        new TableSection(Helpers.GetEmptyTableSectionTitle())
                        {
                            AutofillPasswordFieldCell
                        }
                    }
                };

                AutofillPasswordFieldLabel = new FormTableLabel(this)
                {
                    Text = AppResources.AutofillPasswordFieldDescription
                };

                StackLayout.Children.Add(autofillAlwaysTable);
                StackLayout.Children.Add(AutofillAlwaysLabel);
                StackLayout.Children.Add(autofillPasswordFieldTable);
                StackLayout.Children.Add(AutofillPasswordFieldLabel);
                StackLayout.Children.Add(autofillPersistNotificationTable);
                StackLayout.Children.Add(AutofillPersistNotificationLabel);
            }

            var scrollView = new ScrollView
            {
                Content = StackLayout
            };

            if (Device.RuntimePlatform == Device.iOS || Device.RuntimePlatform == Device.UWP)
            {
                ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Close));
            }

            Title   = AppResources.Options;
            Content = scrollView;
        }
コード例 #2
0
        private void Init()
        {
            MessagingCenter.Send(Application.Current, "ShowStatusBar", true);

            var padding = Device.OnPlatform(
                iOS: new Thickness(15, 20),
                Android: new Thickness(15, 8),
                WinPhone: new Thickness(15, 20));

            PasswordHintCell = new FormEntryCell(AppResources.MasterPasswordHint, useLabelAsPlaceholder: true,
                                                 imageSource: "lightbulb", containerPadding: padding);
            ConfirmPasswordCell = new FormEntryCell(AppResources.RetypeMasterPassword, isPassword: true,
                                                    nextElement: PasswordHintCell.Entry, useLabelAsPlaceholder: true, imageSource: "lock",
                                                    containerPadding: padding);
            PasswordCell = new FormEntryCell(AppResources.MasterPassword, isPassword: true,
                                             nextElement: ConfirmPasswordCell.Entry, useLabelAsPlaceholder: true, imageSource: "lock",
                                             containerPadding: padding);
            EmailCell = new FormEntryCell(AppResources.EmailAddress, nextElement: PasswordCell.Entry,
                                          entryKeyboard: Keyboard.Email, useLabelAsPlaceholder: true, imageSource: "envelope",
                                          containerPadding: padding);

            PasswordHintCell.Entry.ReturnType = Enums.ReturnType.Done;
            PasswordHintCell.Entry.Completed += Entry_Completed;

            var table = new FormTableView
            {
                Root = new TableRoot
                {
                    new TableSection
                    {
                        EmailCell,
                        PasswordCell
                    }
                }
            };

            var passwordLabel = new Label
            {
                Text          = AppResources.MasterPasswordDescription,
                LineBreakMode = LineBreakMode.WordWrap,
                FontSize      = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                Style         = (Style)Application.Current.Resources["text-muted"],
                Margin        = new Thickness(15, (this.IsLandscape() ? 5 : 0), 15, 25)
            };

            var table2 = new FormTableView
            {
                NoHeader = true,
                Root     = new TableRoot
                {
                    new TableSection
                    {
                        ConfirmPasswordCell,
                        PasswordHintCell
                    }
                }
            };

            var hintLabel = new Label
            {
                Text          = AppResources.MasterPasswordHintDescription,
                LineBreakMode = LineBreakMode.WordWrap,
                FontSize      = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                Style         = (Style)Application.Current.Resources["text-muted"],
                Margin        = new Thickness(15, (this.IsLandscape() ? 5 : 0), 15, 25)
            };

            var layout = new StackLayout
            {
                Children = { table, passwordLabel, table2, hintLabel },
                Spacing  = 0
            };

            layout.LayoutChanged += (sender, args) =>
            {
                passwordLabel.WidthRequest = layout.Bounds.Width - passwordLabel.Bounds.Left * 2;
                hintLabel.WidthRequest     = layout.Bounds.Width - hintLabel.Bounds.Left * 2;
            };

            var scrollView = new ScrollView
            {
                Content = layout
            };

            var loginToolbarItem = new ToolbarItem(AppResources.Submit, null, async() =>
            {
                await Register();
            }, ToolbarItemOrder.Default, 0);

            if (Device.OS == TargetPlatform.iOS)
            {
                table.RowHeight          = table2.RowHeight = table2.RowHeight = -1;
                table.EstimatedRowHeight = table2.EstimatedRowHeight = table2.EstimatedRowHeight = 70;
                ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Cancel, () =>
                {
                    MessagingCenter.Send(Application.Current, "ShowStatusBar", false);
                }));
            }

            ToolbarItems.Add(loginToolbarItem);
            Title   = AppResources.CreateAccount;
            Content = scrollView;
        }
コード例 #3
0
        private void Init()
        {
            MessagingCenter.Send(Application.Current, "ShowStatusBar", true);

            var padding = Helpers.OnPlatform(
                iOS: new Thickness(15, 20),
                Android: new Thickness(15, 8),
                Windows: new Thickness(10, 8));

            PasswordHintCell = new FormEntryCell(AppResources.MasterPasswordHint, useLabelAsPlaceholder: true,
                                                 imageSource: "lightbulb.png", containerPadding: padding);
            ConfirmPasswordCell = new FormEntryCell(AppResources.RetypeMasterPassword, isPassword: true,
                                                    nextElement: PasswordHintCell.Entry, useLabelAsPlaceholder: true, imageSource: "lock.png",
                                                    containerPadding: padding);
            PasswordCell = new FormEntryCell(AppResources.MasterPassword, isPassword: true,
                                             nextElement: ConfirmPasswordCell.Entry, useLabelAsPlaceholder: true, imageSource: "lock.png",
                                             containerPadding: padding);
            EmailCell = new FormEntryCell(AppResources.EmailAddress, nextElement: PasswordCell.Entry,
                                          entryKeyboard: Keyboard.Email, useLabelAsPlaceholder: true, imageSource: "envelope.png",
                                          containerPadding: padding);

            PasswordHintCell.Entry.ReturnType = Enums.ReturnType.Done;

            var table = new FormTableView(this)
            {
                Root = new TableRoot
                {
                    new TableSection(Helpers.GetEmptyTableSectionTitle())
                    {
                        EmailCell,
                        PasswordCell
                    }
                }
            };

            PasswordLabel = new Label
            {
                Text          = AppResources.MasterPasswordDescription,
                LineBreakMode = LineBreakMode.WordWrap,
                FontSize      = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                Style         = (Style)Application.Current.Resources["text-muted"],
                Margin        = new Thickness(15, (this.IsLandscape() ? 5 : 0), 15, 25)
            };

            var table2 = new FormTableView(this)
            {
                NoHeader = true,
                Root     = new TableRoot
                {
                    new TableSection(Helpers.GetEmptyTableSectionTitle())
                    {
                        ConfirmPasswordCell,
                        PasswordHintCell
                    }
                }
            };

            HintLabel = new Label
            {
                Text          = AppResources.MasterPasswordHintDescription,
                LineBreakMode = LineBreakMode.WordWrap,
                FontSize      = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                Style         = (Style)Application.Current.Resources["text-muted"],
                Margin        = new Thickness(15, (this.IsLandscape() ? 5 : 0), 15, 25)
            };

            StackLayout = new RedrawableStackLayout
            {
                Children = { table, PasswordLabel, table2, HintLabel },
                Spacing  = 0
            };

            var scrollView = new ScrollView
            {
                Content = StackLayout
            };

            var loginToolbarItem = new ToolbarItem(AppResources.Submit, Helpers.ToolbarImage("ion_chevron_right.png"), async() =>
            {
                await Register();
            }, ToolbarItemOrder.Default, 0);

            if (Device.RuntimePlatform == Device.iOS)
            {
                table.RowHeight          = table2.RowHeight = -1;
                table.EstimatedRowHeight = table2.EstimatedRowHeight = 70;
                ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Cancel, () =>
                {
                    MessagingCenter.Send(Application.Current, "ShowStatusBar", false);
                }));
            }

            ToolbarItems.Add(loginToolbarItem);
            Title   = AppResources.CreateAccount;
            Content = scrollView;
        }
コード例 #4
0
        private void Init()
        {
            MessagingCenter.Send(Application.Current, "ShowStatusBar", true);

            IdentityUrlCell            = new FormEntryCell(AppResources.IdentityUrl, entryKeyboard: Keyboard.Url);
            IdentityUrlCell.Entry.Text = _appSettings.IdentityUrl;
            ApiUrlCell                 = new FormEntryCell(AppResources.ApiUrl, nextElement: IdentityUrlCell.Entry, entryKeyboard: Keyboard.Url);
            ApiUrlCell.Entry.Text      = _appSettings.ApiUrl;
            WebVaultUrlCell            = new FormEntryCell(AppResources.WebVaultUrl, nextElement: ApiUrlCell.Entry, entryKeyboard: Keyboard.Url);
            WebVaultUrlCell.Entry.Text = _appSettings.WebVaultUrl;
            BaseUrlCell                = new FormEntryCell(AppResources.ServerUrl, nextElement: WebVaultUrlCell.Entry, entryKeyboard: Keyboard.Url);
            BaseUrlCell.Entry.Text     = _appSettings.BaseUrl;

            var table = new FormTableView
            {
                Root = new TableRoot
                {
                    new TableSection(AppResources.SelfHostedEnvironment)
                    {
                        BaseUrlCell
                    }
                }
            };

            SelfHostLabel = new Label
            {
                Text          = AppResources.SelfHostedEnvironmentFooter,
                LineBreakMode = LineBreakMode.WordWrap,
                FontSize      = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                Style         = (Style)Application.Current.Resources["text-muted"],
                Margin        = new Thickness(15, (this.IsLandscape() ? 5 : 0), 15, 25)
            };

            var table2 = new FormTableView
            {
                Root = new TableRoot
                {
                    new TableSection(AppResources.CustomEnvironment)
                    {
                        WebVaultUrlCell,
                        ApiUrlCell,
                        IdentityUrlCell
                    }
                }
            };

            CustomLabel = new Label
            {
                Text          = AppResources.CustomEnvironmentFooter,
                LineBreakMode = LineBreakMode.WordWrap,
                FontSize      = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                Style         = (Style)Application.Current.Resources["text-muted"],
                Margin        = new Thickness(15, (this.IsLandscape() ? 5 : 0), 15, 25)
            };

            StackLayout = new StackLayout
            {
                Children = { table, SelfHostLabel, table2, CustomLabel },
                Spacing  = 0
            };

            var scrollView = new ScrollView
            {
                Content = StackLayout
            };

            var toolbarItem = new ToolbarItem(AppResources.Save, null, async() => await SaveAsync(),
                                              ToolbarItemOrder.Default, 0);

            if (Device.RuntimePlatform == Device.iOS || Device.RuntimePlatform == Device.Windows)
            {
                table.RowHeight          = table2.RowHeight = -1;
                table.EstimatedRowHeight = table2.EstimatedRowHeight = 70;
                ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Close, () =>
                {
                    MessagingCenter.Send(Application.Current, "ShowStatusBar", false);
                }));
            }

            ToolbarItems.Add(toolbarItem);
            Title   = AppResources.Settings;
            Content = scrollView;
        }
コード例 #5
0
        private void Init()
        {
            CopyTotpCell = new ExtendedSwitchCell
            {
                Text = AppResources.DisableAutoTotpCopy,
                On   = _settings.GetValueOrDefault(Constants.SettingDisableTotpCopy, false)
            };

            var totpTable = new FormTableView(true)
            {
                Root = new TableRoot
                {
                    new TableSection(" ")
                    {
                        CopyTotpCell
                    }
                }
            };

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

            var analyticsTable = new FormTableView
            {
                Root = new TableRoot
                {
                    new TableSection(" ")
                    {
                        AnalyticsCell
                    }
                }
            };

            CopyTotpLabel = new FormTableLabel(this)
            {
                Text = AppResources.DisableAutoTotpCopyDescription
            };

            AnalyticsLabel = new FormTableLabel(this)
            {
                Text = AppResources.DisableGADescription
            };

            StackLayout = new StackLayout
            {
                Children = { totpTable, CopyTotpLabel, analyticsTable, AnalyticsLabel },
                Spacing  = 0
            };

            if (Device.RuntimePlatform == Device.Android)
            {
                AutofillAlwaysCell = new ExtendedSwitchCell
                {
                    Text = AppResources.AutofillAlways,
                    On   = !_appSettings.AutofillPersistNotification && !_appSettings.AutofillPasswordField
                };

                var autofillAlwaysTable = new FormTableView(true)
                {
                    Root = new TableRoot
                    {
                        new TableSection(AppResources.AutofillService)
                        {
                            AutofillAlwaysCell
                        }
                    }
                };

                AutofillAlwaysLabel = new FormTableLabel(this)
                {
                    Text = AppResources.AutofillAlwaysDescription
                };

                AutofillPersistNotificationCell = new ExtendedSwitchCell
                {
                    Text = AppResources.AutofillPersistNotification,
                    On   = _appSettings.AutofillPersistNotification
                };

                var autofillPersistNotificationTable = new FormTableView
                {
                    Root = new TableRoot
                    {
                        new TableSection(" ")
                        {
                            AutofillPersistNotificationCell
                        }
                    }
                };

                AutofillPersistNotificationLabel = new FormTableLabel(this)
                {
                    Text = AppResources.AutofillPersistNotificationDescription
                };

                AutofillPasswordFieldCell = new ExtendedSwitchCell
                {
                    Text = AppResources.AutofillPasswordField,
                    On   = _appSettings.AutofillPasswordField
                };

                var autofillPasswordFieldTable = new FormTableView
                {
                    Root = new TableRoot
                    {
                        new TableSection(" ")
                        {
                            AutofillPasswordFieldCell
                        }
                    }
                };

                AutofillPasswordFieldLabel = new FormTableLabel(this)
                {
                    Text = AppResources.AutofillPasswordFieldDescription
                };

                StackLayout.Children.Add(autofillAlwaysTable);
                StackLayout.Children.Add(AutofillAlwaysLabel);
                StackLayout.Children.Add(autofillPasswordFieldTable);
                StackLayout.Children.Add(AutofillPasswordFieldLabel);
                StackLayout.Children.Add(autofillPersistNotificationTable);
                StackLayout.Children.Add(AutofillPersistNotificationLabel);
            }

            var scrollView = new ScrollView
            {
                Content = StackLayout
            };

            if (Device.RuntimePlatform == Device.iOS || Device.RuntimePlatform == Device.Windows)
            {
                analyticsTable.RowHeight          = -1;
                analyticsTable.EstimatedRowHeight = 70;
                ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Close));
            }

            Title   = AppResources.Features;
            Content = scrollView;
        }
コード例 #6
0
        private void Init()
        {
            AnalyticsCell = new ExtendedSwitchCell
            {
                Text = AppResources.DisableGA,
                On   = _settings.GetValueOrDefault(Constants.SettingGaOptOut, false)
            };

            var analyticsTable = new FormTableView
            {
                Root = new TableRoot
                {
                    new TableSection(" ")
                    {
                        AnalyticsCell
                    }
                }
            };

            AnalyticsLabel = new Label
            {
                Text          = AppResources.DisbaleGADescription,
                LineBreakMode = LineBreakMode.WordWrap,
                FontSize      = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                Style         = (Style)Application.Current.Resources["text-muted"],
                Margin        = new Thickness(15, (this.IsLandscape() ? 5 : 0), 15, 25)
            };

            StackLayout = new StackLayout
            {
                Children = { analyticsTable, AnalyticsLabel },
                Spacing  = 0
            };

            if (Device.RuntimePlatform == Device.Android)
            {
                AutofillAlwaysCell = new ExtendedSwitchCell
                {
                    Text = AppResources.AutofillAlways,
                    On   = !_appSettings.AutofillPersistNotification && !_appSettings.AutofillPasswordField
                };

                var autofillAlwaysTable = new FormTableView
                {
                    Root = new TableRoot
                    {
                        new TableSection(AppResources.AutofillService)
                        {
                            AutofillAlwaysCell
                        }
                    }
                };

                AutofillAlwaysLabel = new FormTableLabel(this)
                {
                    Text = AppResources.AutofillAlwaysDescription
                };

                AutofillPersistNotificationCell = new ExtendedSwitchCell
                {
                    Text = AppResources.AutofillPersistNotification,
                    On   = _appSettings.AutofillPersistNotification
                };

                var autofillPersistNotificationTable = new FormTableView
                {
                    NoHeader = true,
                    Root     = new TableRoot
                    {
                        new TableSection(" ")
                        {
                            AutofillPersistNotificationCell
                        }
                    }
                };

                AutofillPersistNotificationLabel = new FormTableLabel(this)
                {
                    Text = AppResources.AutofillPersistNotificationDescription
                };

                AutofillPasswordFieldCell = new ExtendedSwitchCell
                {
                    Text = AppResources.AutofillPasswordField,
                    On   = _appSettings.AutofillPasswordField
                };

                var autofillPasswordFieldTable = new FormTableView
                {
                    NoHeader = true,
                    Root     = new TableRoot
                    {
                        new TableSection(" ")
                        {
                            AutofillPasswordFieldCell
                        }
                    }
                };

                AutofillPasswordFieldLabel = new FormTableLabel(this)
                {
                    Text = AppResources.AutofillPasswordFieldDescription
                };

                StackLayout.Children.Add(autofillAlwaysTable);
                StackLayout.Children.Add(AutofillAlwaysLabel);
                StackLayout.Children.Add(autofillPasswordFieldTable);
                StackLayout.Children.Add(AutofillPasswordFieldLabel);
                StackLayout.Children.Add(autofillPersistNotificationTable);
                StackLayout.Children.Add(AutofillPersistNotificationLabel);
            }

            var scrollView = new ScrollView
            {
                Content = StackLayout
            };

            if (Device.RuntimePlatform == Device.iOS)
            {
                analyticsTable.RowHeight          = -1;
                analyticsTable.EstimatedRowHeight = 70;
                ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Cancel));
            }

            Title   = AppResources.Features;
            Content = scrollView;
        }