public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            BackButton.TintColor = UIColor.White;

            var soundsList = (from Constants.NotificationSounds suit in Enum.GetValues(typeof(Constants.NotificationSounds)) select suit.Humanize(LetterCasing.Title)).ToList();

            _notificationSoundPicker = MirroredPicker.Create(new PickerModel(soundsList), NotificationSoundPicker, doneAction: NotificationSoundPicker_SaveData, changeAction: NotificationSoundPicker_ValueChanged);
        }
Exemple #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _schedule = Data.GetExerciseSchedule();

            _schedulePicker = MirroredPicker.Create(new PickerModel(PickerListHelper.GetExercisePeriods()),
                                                    ReminderPeriod, doneAction: null);

            _startTimePicker = MirroredPicker.Create(new PickerModel(_availableTimes), StartTime, HandleTimeSet, doneAction: null);

            _endTimePicker = MirroredPicker.Create(new PickerModel(_availableTimes), EndTime, HandleTimeSet, doneAction: null);

            AddButtons();
            PopulateData();

            var pickerTextFields = View.Subviews.OfType <PickerUITextField>().ToArray();

            Colors.SetTextPrimaryColor(pickerTextFields);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var exercisePickerModel = new PickerModel(PickerListHelper.GetExerciseTypeStrings());

            _exerciseTypePicker = MirroredPicker.Create(exercisePickerModel, ExerciseType, doneAction: ShowHideCustomName);

            var repetitionsPickerModel = new PickerModel(Enumerable.Range(1, 100).Select(n => n.ToString()).ToList());

            _repetitionTypePicker = MirroredPicker.Create(repetitionsPickerModel, NumberOfRepetitions, doneAction: ShowHideCustomName);

            if (SelectedExerciseId.HasValue)
            {
                _selectedExercise = Data.GetExerciseById(SelectedExerciseId.Value);

                ExerciseType.Text = _selectedExercise.Type.Humanize();
                _exerciseTypePicker.Select((int)_selectedExercise.Type, 0, false);
                NumberOfRepetitions.Text = _selectedExercise.Quantity.ToString();
                _repetitionTypePicker.Select(_selectedExercise.Quantity - 1, 0, false);
                CustomExerciseName.Text = _selectedExercise.CombinedName;
            }
            else
            {
                ExerciseType.Text = PickerListHelper.GetExerciseTypeStrings()[0];
                _exerciseTypePicker.Select(0, 0, false);
                NumberOfRepetitions.Text = "10";
                _repetitionTypePicker.Select(9, 0, false);
                CustomExerciseName.Text = string.Empty;
            }

            ShowHideCustomName();
            AddButtons();

            var pickerTextFields = View.Subviews.OfType <PickerUITextField>().ToArray();

            Colors.SetTextPrimaryColor(pickerTextFields);
            CustomExerciseName.BackgroundColor = Colors.MainBackgroundColor;
            CustomExerciseName.TextColor       = Colors.PrimaryColor;
        }