public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.
            ConfigureView();

            var saveButton = new UIBarButtonItem(UIBarButtonSystemItem.Done, OnSave)
            {
                AccessibilityLabel = "saveButton"
            };
            var deleteButton = new UIBarButtonItem(UIBarButtonSystemItem.Trash, OnDelete)
            {
                AccessibilityLabel = "deleteButton"
            };

            NavigationItem.RightBarButtonItems = new UIBarButtonItem[] { saveButton, deleteButton };

            TitleTextView.AddTarget(TitleTextViewOnValueChanged, UIControlEvent.EditingChanged);
            NoteDescriptionTextView.Changed  += NoteDescriptionTextViewOnChanged;
            NoteCompletedSwitch.ValueChanged += NoteCompletedSwitchOnValueChanged;
            AddImageButton.TouchUpInside     += AddImageButton_TouchUpInside;
            DeleteImageButton.TouchUpInside  += DeleteImageButton_TouchUpInside;
            if (Note == null)
            {
                TitleTextView.Hidden = NoteCompletedSwitch.Hidden = NoteImageView.Hidden = DeleteImageButton.Hidden = AddImageButton.Hidden = true;
            }
            else
            {
                SetControlsVisibility();
            }
        }
示例#2
0
        public void UpdateCell(AdvancedCell cell)
        {
            StartTextView.Text   = cell.Start;
            EndTextView.Text     = cell.End;
            TitleTextView.Text   = cell.Title;
            BusToTextView.Text   = cell.BusTo;
            BusFromTextView.Text = cell.BusFrom;
            PlaceTextView.Text   = cell.Place;

            Details.Visibility       = cell.IsSelected ? ViewStates.Visible : ViewStates.Gone;
            PlaceTextView.Visibility = cell.IsPlace ? ViewStates.Visible : ViewStates.Gone;
            Bus.Visibility           = cell.IsBus ? ViewStates.Visible : ViewStates.Gone;


            if (Device.Idiom == TargetIdiom.Phone)
            {
                StartTextView.TextSize   =
                    EndTextView.TextSize = DashTextView.TextSize = TitleTextView.TextSize = cell.PhoneMainTextSize;
                BusToTextView.TextSize   = BusFromTextView.TextSize = PlaceTextView.TextSize = cell.PhoneDetailTextSize;
                TitleTextView.SetMaxLines(cell.PhoneMaxLines);
            }
            else
            {
                StartTextView.TextSize   =
                    EndTextView.TextSize = DashTextView.TextSize = TitleTextView.TextSize = cell.TabletMainTextSize;
                BusToTextView.TextSize   = BusFromTextView.TextSize = PlaceTextView.TextSize = cell.TabletDetailTextSize;
                TitleTextView.SetMaxLines(cell.TabletMaxLines);
            }

            BackLayout.SetBackgroundColor(cell.BackgroundColor.ToAndroid());
        }
        private void DismissKeyboard()
        {
            if (TitleTextView.CanResignFirstResponder)
            {
                TitleTextView.ResignFirstResponder();
            }

            if (NoteDescriptionTextView.CanResignFirstResponder)
            {
                NoteDescriptionTextView.ResignFirstResponder();
            }
        }
示例#4
0
 protected override void Rebind()
 {
     TitleTextView.SetText(DataSource.TitleResId);
     DescriptionTextView.SetText(DataSource.DescriptionResId);
     CheckBox.Checked = DataSource.IsChecked;
 }
        void ReleaseDesignerOutlets()
        {
            if (AttachmentContentView != null)
            {
                AttachmentContentView.Dispose();
                AttachmentContentView = null;
            }

            if (checkButton != null)
            {
                checkButton.Dispose();
                checkButton = null;
            }

            if (ConteinerObservationView != null)
            {
                ConteinerObservationView.Dispose();
                ConteinerObservationView = null;
            }

            if (CreateButton != null)
            {
                CreateButton.Dispose();
                CreateButton = null;
            }

            if (DateTextField != null)
            {
                DateTextField.Dispose();
                DateTextField = null;
            }

            if (DetailTextView != null)
            {
                DetailTextView.Dispose();
                DetailTextView = null;
            }

            if (HeightAttachmentContentConstraint != null)
            {
                HeightAttachmentContentConstraint.Dispose();
                HeightAttachmentContentConstraint = null;
            }

            if (ObservationTextView != null)
            {
                ObservationTextView.Dispose();
                ObservationTextView = null;
            }

            if (PlaceTextField != null)
            {
                PlaceTextField.Dispose();
                PlaceTextField = null;
            }

            if (ReferenceTextField != null)
            {
                ReferenceTextField.Dispose();
                ReferenceTextField = null;
            }

            if (SectionEventTextField != null)
            {
                SectionEventTextField.Dispose();
                SectionEventTextField = null;
            }

            if (StatusConteinerView != null)
            {
                StatusConteinerView.Dispose();
                StatusConteinerView = null;
            }

            if (StatusSegmentedControl != null)
            {
                StatusSegmentedControl.Dispose();
                StatusSegmentedControl = null;
            }

            if (TagTextField != null)
            {
                TagTextField.Dispose();
                TagTextField = null;
            }

            if (TitleTextView != null)
            {
                TitleTextView.Dispose();
                TitleTextView = null;
            }

            if (TopAttachmentContentConstraint != null)
            {
                TopAttachmentContentConstraint.Dispose();
                TopAttachmentContentConstraint = null;
            }

            if (TopCreateButtonConstraint != null)
            {
                TopCreateButtonConstraint.Dispose();
                TopCreateButtonConstraint = null;
            }

            if (TopTagConstraint != null)
            {
                TopTagConstraint.Dispose();
                TopTagConstraint = null;
            }

            if (TypeTextField != null)
            {
                TypeTextField.Dispose();
                TypeTextField = null;
            }

            if (UploadFileButton != null)
            {
                UploadFileButton.Dispose();
                UploadFileButton = null;
            }
        }
示例#6
0
        void ReleaseDesignerOutlets()
        {
            if (AttachmentContentView != null)
            {
                AttachmentContentView.Dispose();
                AttachmentContentView = null;
            }

            if (AutorTextField != null)
            {
                AutorTextField.Dispose();
                AutorTextField = null;
            }

            if (CreateButton != null)
            {
                CreateButton.Dispose();
                CreateButton = null;
            }

            if (DateTextField != null)
            {
                DateTextField.Dispose();
                DateTextField = null;
            }

            if (HeightAttachmentContentConstraint != null)
            {
                HeightAttachmentContentConstraint.Dispose();
                HeightAttachmentContentConstraint = null;
            }

            if (SectionEventTextField != null)
            {
                SectionEventTextField.Dispose();
                SectionEventTextField = null;
            }

            if (TitleTextView != null)
            {
                TitleTextView.Dispose();
                TitleTextView = null;
            }

            if (TopAttachmentContentConstraint != null)
            {
                TopAttachmentContentConstraint.Dispose();
                TopAttachmentContentConstraint = null;
            }

            if (TopCreateButtonConstraint != null)
            {
                TopCreateButtonConstraint.Dispose();
                TopCreateButtonConstraint = null;
            }

            if (UploadFileButton != null)
            {
                UploadFileButton.Dispose();
                UploadFileButton = null;
            }
        }
示例#7
0
        private void ClientOnStatusUpdated(object sender, VlcStatus vlcStatus)
        {
            var time = new TimeSpan(0, 0, 0, vlcStatus.Time);

            Task.Factory.StartNew(() =>
            {
                var currentLeaf = GetCurrentLeaf().Result;
                if (currentLeaf != null)
                {
                    RunOnUiThread(() => TimeTextView2.Text = TimeSpan.FromSeconds(currentLeaf.Duration).ToString());
                }
                else
                {
                    RunOnUiThread(() => TimeTextView2.SetText(Resource.String.app_unknown_duration));
                }
            });

            RunOnUiThread(() =>
            {
                TimeTextView.Text = time.ToString();

                var value = (int)Math.Round((decimal)(125.0 * vlcStatus.Volume / 320.0));

                if (CanProgressBeSet)
                {
                    VolumeSeekbar.SetProgress(value, true);
                }

                string title;
                try
                {
                    title = Path.GetFileNameWithoutExtension(vlcStatus.Information.Category.First().Info
                                                             .First(i => i.Name == "filename").Text);
                }
                catch
                {
                    try
                    {
                        title = Path.GetFileNameWithoutExtension(vlcStatus.Information.Category.First().Info
                                                                 .First(i => i.Name == "name").Text);
                    }
                    catch
                    {
                        title = "";
                    }
                }

                if (title != "")
                {
                    TitleTextView.Text = title;
                }
                else
                {
                    TitleTextView.SetText(Resource.String.app_unknown_title);
                }

                if (vlcStatus.State == VlcPlaybackState.Playing)
                {
                    if (PlayPauseButton.State != MorphButton.MorphState.Start)
                    {
                        PlayPauseButton.SetState(MorphButton.MorphState.Start, true);
                    }
                }
                else
                {
                    if (PlayPauseButton.State != MorphButton.MorphState.End)
                    {
                        PlayPauseButton.SetState(MorphButton.MorphState.End, true);
                    }
                }
            });
        }