예제 #1
0
        protected override void OnAppearing()
        {
            base.OnAppearing();
            if (!_connectivity.IsConnected)
            {
                AlertNoConnection();
            }

            NameCell.InitEvents();
            NotesCell.InitEvents();
            FolderCell.InitEvents();

            if (AttachmentsCell != null)
            {
                AttachmentsCell.Tapped += AttachmentsCell_Tapped;
            }
            if (CustomFieldsCell != null)
            {
                CustomFieldsCell.Tapped += CustomFieldsCell_Tapped;
            }
            DeleteCell.Tapped += DeleteCell_Tapped;

            switch (Cipher.Type)
            {
            case CipherType.Login:
                LoginPasswordCell.InitEvents();
                LoginUsernameCell.InitEvents();
                LoginUriCell.InitEvents();
                LoginTotpCell.InitEvents();
                LoginPasswordCell.Button.Clicked += PasswordButton_Clicked;
                LoginGenerateCell.Tapped         += GenerateCell_Tapped;
                if (LoginTotpCell?.Button != null)
                {
                    LoginTotpCell.Button.Clicked += TotpButton_Clicked;
                }
                break;

            case CipherType.Card:
                CardBrandCell.InitEvents();
                CardCodeCell.InitEvents();
                CardExpMonthCell.InitEvents();
                CardExpYearCell.InitEvents();
                CardNameCell.InitEvents();
                CardNumberCell.InitEvents();
                break;

            case CipherType.Identity:
                IdTitleCell.InitEvents();
                IdFirstNameCell.InitEvents();
                IdMiddleNameCell.InitEvents();
                IdLastNameCell.InitEvents();
                IdUsernameCell.InitEvents();
                IdCompanyCell.InitEvents();
                IdSsnCell.InitEvents();
                IdPassportNumberCell.InitEvents();
                IdLicenseNumberCell.InitEvents();
                IdEmailCell.InitEvents();
                IdPhoneCell.InitEvents();
                IdAddress1Cell.InitEvents();
                IdAddress2Cell.InitEvents();
                IdAddress3Cell.InitEvents();
                IdCityCell.InitEvents();
                IdStateCell.InitEvents();
                IdPostalCodeCell.InitEvents();
                IdCountryCell.InitEvents();
                break;

            default:
                break;
            }
        }
예제 #2
0
        protected override void OnAppearing()
        {
            base.OnAppearing();
            if (!_connectivity.IsConnected)
            {
                AlertNoConnection();
            }

            NameCell.InitEvents();
            NotesCell.InitEvents();
            FolderCell.InitEvents();

            switch (_type)
            {
            case CipherType.Login:
                LoginPasswordCell.InitEvents();
                LoginUsernameCell.InitEvents();
                LoginUriCell.InitEvents();
                LoginTotpCell.InitEvents();
                LoginPasswordCell.Button.Clicked += PasswordButton_Clicked;
                LoginGenerateCell.Tapped         += GenerateCell_Tapped;
                if (LoginTotpCell?.Button != null)
                {
                    LoginTotpCell.Button.Clicked += TotpButton_Clicked;
                }
                break;

            case CipherType.Card:
                CardBrandCell.InitEvents();
                CardCodeCell.InitEvents();
                CardExpMonthCell.InitEvents();
                CardExpYearCell.InitEvents();
                CardNameCell.InitEvents();
                CardNumberCell.InitEvents();
                break;

            case CipherType.Identity:
                IdTitleCell.InitEvents();
                IdFirstNameCell.InitEvents();
                IdMiddleNameCell.InitEvents();
                IdLastNameCell.InitEvents();
                IdUsernameCell.InitEvents();
                IdCompanyCell.InitEvents();
                IdSsnCell.InitEvents();
                IdPassportNumberCell.InitEvents();
                IdLicenseNumberCell.InitEvents();
                IdEmailCell.InitEvents();
                IdPhoneCell.InitEvents();
                IdAddress1Cell.InitEvents();
                IdAddress2Cell.InitEvents();
                IdAddress3Cell.InitEvents();
                IdCityCell.InitEvents();
                IdStateCell.InitEvents();
                IdPostalCodeCell.InitEvents();
                IdCountryCell.InitEvents();
                break;

            default:
                break;
            }

            if (_type == CipherType.Login && !_fromAutofill && !_settings.GetValueOrDefault(AddedLoginAlertKey, false))
            {
                _settings.AddOrUpdateValue(AddedLoginAlertKey, true);
                if (Device.RuntimePlatform == Device.iOS)
                {
                    DisplayAlert(AppResources.BitwardenAppExtension, AppResources.BitwardenAppExtensionAlert,
                                 AppResources.Ok);
                }
                else if (Device.RuntimePlatform == Device.Android && !_appInfoService.AutofillAccessibilityServiceEnabled)
                {
                    DisplayAlert(AppResources.BitwardenAutofillService, AppResources.BitwardenAutofillServiceAlert,
                                 AppResources.Ok);
                }
            }

            NameCell?.Entry.FocusWithDelay();
        }