Example #1
0
        public UserSettingsSource(UITableView tableView, SettingsPhoneModel phoneModel, SettingsAllowCallsModel allowCallsModel,
                                  DescriptionTypeEventModel passwordTypeModel, List <DescriptionAndBoolEventModel> switchModel,
                                  List <DescriptionTypeEventModel> typeModelInformation, List <DescriptionTypeEventModel> typeModelDanger,
                                  Dictionary <string, string> locationResources)
        {
            _phoneModel           = phoneModel;
            _allowCallsModel      = allowCallsModel;
            _passwordTypeModel    = passwordTypeModel;
            _typeModelInformation = typeModelInformation;
            _typeModelDanger      = typeModelDanger;
            _switchModel          = switchModel;
            _locationResources    = locationResources;

            tableView.RegisterNibForCellReuse(LabelWithArrowCell.Nib, LabelWithArrowCell.Key);
            tableView.RegisterNibForCellReuse(SwitchCell.Nib, SwitchCell.Key);
            tableView.RegisterNibForCellReuse(AllowPhoneCallsCell.Nib, AllowPhoneCallsCell.Key);
            tableView.RegisterNibForCellReuse(PhoneNumberCell.Nib, PhoneNumberCell.Key);
        }
Example #2
0
        public void Configure(SettingsPhoneModel phone)
        {
            if (phone == null)
            {
                return;
            }

            _changeNumberCommand = phone.ChangeNumber;

            UILabelExtensions.SetupLabelAppearance(_label, phone.PhoneDescription, Colors.Black, 15f);
            UITextFieldExtensions.SetupTextFieldAppearance(_textField, Colors.GrayIndicator, 14f, "#", Colors.GrayIndicator, Colors.GrayIndicator, Colors.White.ColorWithAlpha(0f));
            _textField.Text = phone.PhoneNumber;

            _textField.ShouldChangeCharacters = OnDescriptionField_ShouldChangeCharacters;

            UITextFieldExtensions.AddDoneButtonToNumericKeyboard(_textField);
            _textField.KeyboardType = UIKeyboardType.PhonePad;

            _textField.EditingDidEnd -= OnTextField_EditingDidEnd;
            _textField.EditingDidEnd += OnTextField_EditingDidEnd;
        }