Exemple #1
0
        /// <summary>
        /// Updates the Final Punch cell.
        /// </summary>
        /// <param name="parentController">Parent controller.</param>
        /// <param name="itemTableView">Item table view.</param>
        /// <param name="indexPath">Index path.</param>
        /// <param name="checkLstItem">Check lst item.</param>
        public void UpdateCell(InspectionViewController parentController, UITableView itemTableView, NSIndexPath indexPath, CheckList checkLstItem)
        {
            ResetUIView();
            UpdateUIContent(checkLstItem);
            weakUITableView = new WeakReference(itemTableView);
            Parent          = new WeakReference(parentController);


            var textDelegate = new FinalPunchTextViewDelegate(this, itemTableView);

            CommentsTextView.WeakDelegate = textDelegate;

            takePictureBtn.TouchUpInside     -= takePictureBtn_TouchUpInside;
            takePictureBtn.TouchUpInside     += takePictureBtn_TouchUpInside;
            punchSegmentControl.ValueChanged -= PunchSegmentControl_ValueChanged;
            punchSegmentControl.ValueChanged += PunchSegmentControl_ValueChanged;
            LoadPunchItemImages();

            if (checkLstItem.Result == ResultType.PASS || checkLstItem.Result == ResultType.FAIL)
            {
                takePictureBtn.Enabled         = true;
                takePictureBtn.BackgroundColor = UIColor.FromRGB(19, 95, 160);
                takePictureBtn.SetTitleColor(UIColor.White, UIControlState.Disabled);
            }
            else
            {
                takePictureBtn.Enabled         = false;
                takePictureBtn.BackgroundColor = UIColor.LightGray;
                takePictureBtn.SetTitleColor(UIColor.Black, UIControlState.Disabled);
            }
            parentController.buttonStyleRefresh(null);
        }
Exemple #2
0
        public void UpdateCell(InspectionViewController parentController, UITableView checkListTableView, NSIndexPath indexPath, CheckList checkListItem)
        {
            this.checkListTableView = checkListTableView;
            this.parentController   = parentController;
            if (this.parentController != null)
            {
                IsCheckListItemActive = this.parentController.GetCheckListCommentsActive(indexPath.Row);
            }
            ResetUIView();
            UpdateUIContent(checkListItem);



            var textDelegate = new ItemTextViewDelegate(this);

            commentsTextView.WeakDelegate     = textDelegate;
            ChecklistSegControl.ValueChanged -= ChecklistSegControl_ValueChanged;
            ChecklistSegControl.ValueChanged += ChecklistSegControl_ValueChanged;
            parentController.buttonStyleRefresh(null);



            if (IsCheckListItemActive)
            {
                commentsTextView.Hidden = false;
                commentsLabel.Hidden    = false;
                htLabel.Constant        = 21;
                htTextView.Constant     = 87;
                wdTextView.Constant     = 300;
                htViewComment.Constant  = 107;

                //commentsTextView.ShouldBeginEditing ();

                //commentsTextView.BecomeFirstResponder();
            }
            else
            {
                htLabel.Constant        = 0;
                htTextView.Constant     = 0;
                htViewComment.Constant  = 0;
                commentsTextView.Hidden = true;
                commentsLabel.Hidden    = true;
            }
        }
Exemple #3
0
        /// <summary>
        /// Updates the guided photo cells.
        /// </summary>
        /// <param name="checkListItem">Check list item.</param>
        /// <param name="GuidedTableView">Guided table view.</param>
        /// <param name="parentController">Parent controller.</param>
        public async void UpdateGuidedPhotoCell(CheckList checkListItem, UITableView GuidedTableView, InspectionViewController parentController)
        {
            try {
                ResetUIView();
                this.ParentController = new WeakReference(parentController);
                this.GuidedTableView  = new WeakReference(GuidedTableView);
                this.CheckListItem    = new WeakReference(checkListItem);
                LoadGuidedView();

                guidedPhotoTkPicBtn.TouchUpInside -= guidedPhotoTkPicBtn_TouchUpInside;
                guidedPhotoTkPicBtn.TouchUpInside += guidedPhotoTkPicBtn_TouchUpInside;

                guidedPhotoTkPicBtn.SetTitleColor(UIColor.White, UIControlState.Normal);
                guidedPhotoTkPicBtn.Layer.CornerRadius = 5f;
                guidedPhotoTkPicBtn.Layer.BorderColor  = UIColor.FromRGB(18, 74, 143).CGColor;
                guidedPhotoTkPicBtn.Layer.BorderWidth  = 0.5f;
                guidedPhotoTkPicBtn.BackgroundColor    = UIColor.FromRGB(19, 95, 160);

                parentController.buttonStyleRefresh(null);
            } catch (Exception ex) {
                Debug.WriteLine("Exception Occured in UpdateCell method due to " + ex.Message);
            }
        }
Exemple #4
0
 public void UpdateCollectionImageView(List <UIImage> images)
 {
     try {
         this.ImageLst = images;
         if (checkListItem != null)
         {
             checkListItem.photos = new List <byte[]> ();
             List <byte[]> cameraImages = new List <byte[]> ();
             foreach (var img in images)
             {
                 byte[] task   = ImageToByteArray(img);
                 var    imgArr = task;
                 cameraImages.Add(imgArr);
             }
             foreach (var img in cameraImages)
             {
                 checkListItem.photos.Add(img);
             }
         }
         if (Source == null)
         {
             Source = new PunchDataSource(images, this);
         }
         else
         {
             Source.itemsList = images;
         }
         imagesCollectionView.DataSource = Source;
         imagesCollectionView.ReloadData();
         if (parentController != null)
         {
             parentController.buttonStyleRefresh(null);
         }
     } catch (Exception ex) {
         Debug.WriteLine("Exception Occured in UpdateCollectionImageView method due to " + ex.Message);
     }
 }
Exemple #5
0
        void ChecklistSegControl_ValueChanged(object sender, EventArgs e)
        {
            UISegmentedControl checkListSegResult = sender as UISegmentedControl;

            switch (checkListSegResult.SelectedSegment)
            {
            case 0:
                checkListItem.Result = ResultType.NA;
                break;

            case 1:
                checkListItem.Result = ResultType.PASS;
                break;

            case 2:
                checkListItem.Result = ResultType.FAIL;
                break;

            default:
                checkListItem.Result = ResultType.OTHER;
                break;
            }
            parentController.buttonStyleRefresh(null);
        }