public override void Refresh(ChallengeResponseModel response)
        {
            base.Refresh(response);

            if (response == null)
            {
                return;
            }

            CheckStatus(response.Challenge);
            Challenge          = response.Challenge;
            ChallengeText.Text = Challenge.Name;
            TimeText.Text      = Challenge.NextEventCountDown;
            HashText.Text      = Challenge.InstaCaption;

            var navigationDelegate = new ChallengeDetailWebViewNavigationDelegate();

            navigationDelegate.NavigationFinished += SetupConstraint;
            this.WebView.NavigationDelegate        = navigationDelegate;

            WebView.LoadHtmlString(Challenge.Desc, null);
            ImageService.Instance.LoadUrl(Challenge.Image).Into(ChallengeImage);

            HashText.Hidden       = false;
            HashBottomText.Hidden = false;
            HashText.Hidden       = false;
        }
        public override void Refresh(ChallengeResponseModel response)
        {
            base.Refresh(response);

            if (response == null)
            {
                return;
            }

            Challenge          = response.Challenge;
            TimeText.Text      = Challenge.NextEventCountDown;
            PointsText.Text    = "+" + Challenge.PointValue.ToString() + " pts";
            ChallengeText.Text = Challenge.Name;
            ImageService.Instance.LoadUrl(Challenge.Image).Into(ChallengeImage);

            var navigationDelegate = new ChallengeDetailWebViewNavigationDelegate();

            navigationDelegate.NavigationFinished += SetupConstraint;
            this.WebView.NavigationDelegate        = navigationDelegate;
            WebView.LoadHtmlString(Challenge.Desc, null);

            TableView.ReloadData();

            if (response.Challenge.IsSurvey)
            {
                SelectAllThatApply.Text = "Select all that apply";
            }
            else
            {
                SelectAllThatApply.Text = "Select an answer below!";
            }
        }
예제 #3
0
        public override void Refresh(ChallengeResponseModel challengeResponse)
        {
            Crashlytics.Instance.Log("ChallengeDetailViewController_Refresh()");
            base.Refresh(challengeResponse);

            if (challengeResponse == null)
            {
                return;
            }

            Challenge             = challengeResponse.Challenge;
            TimeText.Text         = Challenge.NextEventCountDown;
            PointsText.Text       = "+" + Challenge.PointValue.ToString() + " pts";
            ChallengeTextLbl.Text = Challenge.Name;

            var navigationDelegate = new ChallengeDetailWebViewNavigationDelegate();

            navigationDelegate.NavigationFinished += SetupConstraint;
            this.WebView.NavigationDelegate        = navigationDelegate;
            WebView.LoadHtmlString(Challenge.Desc, null);
            ImageService.Instance.LoadUrl(Challenge.Image).Into(ChallengeImage);

            if (!DidSetupMap && Challenge.LocationLat != null && Challenge.LocationLong != null)
            {
                ChallengeImage.Hidden = true;
                vImagePlaceholder.RemoveConstraint(cnImagePlaceholderAspect);
                vImagePlaceholder.AddConstraint(cnImagePlaceholderAspect = NSLayoutConstraint.Create(vImagePlaceholder, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1, 0));

                double radius = Challenge.RadiusMeters ?? 100.0;
                if (radius > 6000000)
                {
                    radius = 6000000;
                }
                double mapRegion = radius * 2.5;

                CLLocationCoordinate2D mapCoordinate = new CLLocationCoordinate2D(Challenge.LocationLat.Value, Challenge.LocationLong.Value);
                MapViewBase.SetRegion(MKCoordinateRegion.FromDistance(mapCoordinate, mapRegion, mapRegion), true);

                MKCircle circle = MKCircle.Circle(mapCoordinate, radius);
                MapViewBase.AddOverlay(circle);

                MKPointAnnotation annotation = new MKPointAnnotation();
                annotation.Coordinate = new CLLocationCoordinate2D(Challenge.LocationLat.Value, Challenge.LocationLong.Value);
                MapViewBase.AddAnnotation(annotation);

                DidSetupMap = true;
            }
            else
            {
                MapViewBase.Hidden = true;
                paddingMap.RemoveConstraint(cnMapPlaceholderAspect);
                paddingMap.AddConstraint(cnMapPlaceholderAspect = NSLayoutConstraint.Create(paddingMap, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1, 0));
            }

            CheckStatus();
        }
        public override void Refresh(ChallengeResponseModel challengeResponce)
        {
            base.Refresh(challengeResponce);

            if (challengeResponce == null)
            {
                return;
            }

            Challenge      = challengeResponce.Challenge;
            HeaderLbl.Text = Challenge.Name;
            //MainTextLable.Text = Challenge.Desc;
            TimeDisLbl.Text = Challenge.NextEventCountDown;

            var navigationDelegate = new ChallengeDetailWebViewNavigationDelegate();

            navigationDelegate.NavigationFinished += SetupConstraint;
            this.WebView.NavigationDelegate        = navigationDelegate;
            WebView.LoadHtmlString(Challenge.Desc, null);

            if (!DidSetupMap && Challenge.LocationLat != null && Challenge.LocationLong != null)
            {
                double radius = Challenge.RadiusMeters ?? 100.0;
                if (radius > 6000000)
                {
                    radius = 6000000;
                }
                double mapRegion = radius * 2.5;

                CLLocationCoordinate2D mapCoordinate = new CLLocationCoordinate2D(Challenge.LocationLat.Value, Challenge.LocationLong.Value);
                MapView.SetRegion(MKCoordinateRegion.FromDistance(mapCoordinate, mapRegion, mapRegion), true);

                MKCircle circle = MKCircle.Circle(mapCoordinate, radius);
                MapView.AddOverlay(circle);

                MKPointAnnotation annotation = new MKPointAnnotation();
                annotation.Coordinate = new CLLocationCoordinate2D(Challenge.LocationLat.Value, Challenge.LocationLong.Value);
                MapView.AddAnnotation(annotation);

                DidSetupMap = true;
            }
        }
        public override void Refresh(ChallengeResponseModel challengeResponse)
        {
            base.Refresh(challengeResponse);

            if (challengeResponse == null)
            {
                return;
            }

            Challenge           = challengeResponse.Challenge;
            TimeLastLbl.Text    = Challenge.NextEventCountDown;
            CountPeopleLbl.Text = "+" + Challenge.PointValue.ToString() + " pts";
            HeaderTextLbl.Text  = Challenge.Name;

            var navigationDelegate = new ChallengeDetailWebViewNavigationDelegate();

            navigationDelegate.NavigationFinished += SetupConstraint;
            this.WebView.NavigationDelegate        = navigationDelegate;
            WebView.LoadHtmlString(Challenge.Desc, null);
            ImageService.Instance.LoadUrl(Challenge.Image).Into(ChallengesImage);
        }