Exemple #1
0
        public virtual void SubmitChallengeComplete(UIButton button, ResponseModel response)
        {
            RemoveOverlay();
            Platform.AnimateRotationComplete(button);

            if (SubmitButtonImage != null)
            {
                button.SetBackgroundImage(SubmitButtonImage, UIControlState.Normal);
            }

            if (response != null)
            {
                UIView overlay = Platform.AddOverlay(response.ResponseCode > 0);
                if (overlay != null)
                {
                    ChallengeCompleteView challengeComplete = ChallengeCompleteView.Create();
                    overlay.AddSubview(challengeComplete);
                    if (response is ChallengeResponseModel)
                    {
                        challengeComplete.Update(overlay, response as ChallengeResponseModel, Challenge, this);
                    }
                    else if (response is ShareResponseModel)
                    {
                        challengeComplete.Update(overlay, response as ShareResponseModel, Challenge, this);
                    }

                    challengeComplete.TranslatesAutoresizingMaskIntoConstraints = false;
                    overlay.AddConstraint(ChallengesConstraints.ChallengesCollectionCellCenterXConstraint(challengeComplete, overlay));
                    overlay.AddConstraint(ChallengesConstraints.ChallengesConstantTopConstraint(challengeComplete, overlay, 0f));
                    overlay.AddConstraint(ChallengesConstraints.ChallengesCollectionCellWidthConstraint(challengeComplete, overlay, 0.94f));
                    overlay.AddConstraint(ChallengesConstraints.ChallengesCollectionCellHeightConstraint(challengeComplete, overlay, 0.81f));
                }
            }
        }
        public static ChallengeCompleteView Create()
        {
            var arr = NSBundle.MainBundle.LoadNib("ChallengeCompleteView", null, null);
            ChallengeCompleteView view = arr.Count > 0 ? arr.GetItem <ChallengeCompleteView>(0) : null;

            view.TableView.AllowsSelection = false;
            view.TableView.ScrollEnabled   = true;
            view.TableView.RegisterNibForCellReuse(FeedTableViewCell.Nib, FeedTableViewCell.ClassName);
            //view.TableView.RegisterNibForCellReuse(MasterFeedTableViewCell.Nib, MasterFeedTableViewCell.ClassName);

            view.FeedTableSource              = new FeedTableSource(view.TableView);
            view.TableView.Source             = view.FeedTableSource;
            view.TableView.RowHeight          = UITableView.AutomaticDimension;
            view.TableView.EstimatedRowHeight = 130.0f;

            view.TableView.ReloadData();

            view.vWhiteBackground.Layer.CornerRadius = 4.0f;//view.Layer.CornerRadius = 4.0f;

            //view.TableHeightConstraint.Constant = view.FeedTableSource.GetFirstItemHeigth(view.TableView);

            //var tableViewFrame = view.TableView.Frame;
            //view.TableView.Frame = new CGRect(tableViewFrame.X, tableViewFrame.Y, tableViewFrame.Width, 5000);
            return(view);
        }
Exemple #3
0
        public void PostShareResponse(ShareResponseModel shareResponse)
        {
            UIView overlay = Platform.AddOverlay(UIColor.FromRGBA(36, 209, 180, 153));  //from spec

            if (overlay != null)
            {
                ChallengeCompleteView challengeComplete = ChallengeCompleteView.Create();
                overlay.AddSubview(challengeComplete);
                challengeComplete.Update(overlay, shareResponse, Challenge, this);
            }
        }