Beispiel #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));
                }
            }
        }
Beispiel #2
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);
            }
        }