/*
         * public override void LoadChallengeData()
         * {
         *  base.LoadChallengeData();
         *
         *  SL.Manager.RefreshChallengeDetail(Challenge.ChallengeDetailsURL, Refresh);
         * }
         */

        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            //LoadChallengeData();

            CheckInCollectionView.TranslatesAutoresizingMaskIntoConstraints = false;
            CheckInCollectionView.RemoveConstraint(CheckInCollectionViewAspect);
            CheckInCollectionView.AddConstraint(ChallengesConstraints.ChallengesConstantHeightConstraint(CheckInCollectionView, 0f));

            //   CollectionViewsDescription.Font = PointText.Font = UIFont.FromName("ProximaNova-Regular", SizeConstants.Screen.Width * 0.035f);
            //Overlay = Platform.AddCover(View);

            /*
             * Overlay = Platform.AddOverlay(View.Frame, UIColor.White, true);
             * if (Overlay != null)
             * {
             *  nfloat w = Overlay.Frame.Width;//View.Frame.Width;//UIScreen.MainScreen.Bounds.Width;
             *  nfloat h = Overlay.Frame.Height;//View.Frame.Height;//UIScreen.MainScreen.Bounds.Height;
             *  nfloat s = w * 0.2f;
             *  UIImageView progress = new UIImageView(new CGRect((w - s) / 2.0f, ((h - s) / 2.0f), s, s));
             *  progress.Image = UIImage.FromBundle("loading-indicator");
             *  Overlay.AddSubview(progress);
             *  Platform.AnimateRotation(progress);
             * }
             */
            //SL.Manager.RefreshChallengeDetail(Challenge.ChallengeDetailsURL, Refresh);
        }
 public override void ViewWillAppear(bool animated)
 {
     base.ViewWillAppear(animated);
     InstaCollectionView.TranslatesAutoresizingMaskIntoConstraints = false;
     InstaCollectionView.RemoveConstraint(InstaCollectionViewAspect);
     InstaCollectionView.AddConstraint(ChallengesConstraints.ChallengesConstantHeightConstraint(InstaCollectionView, 0f));
     PointsImage.Image = null;
     PointsText.Text   = string.Empty;
 }
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            SL.Manager.RefreshShareTemplate(Challenge.ShareTemplateURL, ShareTemplateRefreshed);

            //LoadChallengeData();

            FBCollectionView.TranslatesAutoresizingMaskIntoConstraints = false;
            FBCollectionView.RemoveConstraint(FBCollectionViewAspect);
            FBCollectionView.AddConstraint(ChallengesConstraints.ChallengesConstantHeightConstraint(FBCollectionView, 0f));
        }
Пример #4
0
        public override void ViewDidLoad()
        {
            Crashlytics.Instance.Log("Challenges_ChallengeDetailViewController_ViewDidLoad()");

            base.ViewDidLoad();

            Reset();
            SetupFonts();
            _messageService = new PlatformServices.SmsService();
            ImageService.Instance.LoadUrl(Challenge.Image).Into(ChallengeImage);
            ChallengeTextLbl.Text = Challenge.Name;
            TimeText.Text         = Challenge.NextEventCountDown;

            if (Challenge.TypeCode == "SHARE")
            {
                SubmitButton.SetBackgroundImage(UIImage.FromBundle("challenge-btn_share"), UIControlState.Normal);
            }
            else if (Challenge.TypeCode == "INVITE")
            {
                SubmitButton.SetBackgroundImage(UIImage.FromBundle("challenge-btn_itb"), UIControlState.Normal);
            }
            else if (new List <string> {
                "POSTERING", "COLLATERAL TRACKING", "FLYERING", "MANUAL"
            }.Contains(Challenge.TypeCode))                                                                                     //else if (Challenge.TypeCode == "COLLATERAL TRACKING" && Challenge.TypeCodeDisplayName == "Postering")
            {
                SubmitButton.SetBackgroundImage(UIImage.FromBundle("challenge-btn_photo"), UIControlState.Normal);
                SetupCollateral();
            }
            else if (Challenge.TypeCode == "FB ENGAGEMENT")
            {
                SubmitButton.SetBackgroundImage(UIImage.FromBundle("challenge-btn_fb"), UIControlState.Normal);
            }

            DetailCollectionView.TranslatesAutoresizingMaskIntoConstraints = false;
            DetailCollectionView.RemoveConstraint(DetailCollectionViewAspect);
            DetailCollectionView.AddConstraint(ChallengesConstraints.ChallengesConstantHeightConstraint(DetailCollectionView, 0f));

            NSString viewportScriptString = (NSString)"var meta = document.createElement('meta'); meta.setAttribute('name', 'viewport'); meta.setAttribute('content', 'width=500'); meta.setAttribute('initial-scale', '1.0'); meta.setAttribute('maximum-scale', '1.0'); meta.setAttribute('minimum-scale', '1.0'); meta.setAttribute('user-scalable', 'no'); document.getElementsByTagName('head')[0].appendChild(meta);";

            WebView.Configuration.UserContentController.AddUserScript(new WKUserScript(source: viewportScriptString, injectionTime: WKUserScriptInjectionTime.AtDocumentEnd, isForMainFrameOnly: true));

            WebView.ScrollView.ScrollEnabled            = false;
            WebView.ScrollView.Bounces                  = false;
            WebView.AllowsBackForwardNavigationGestures = false;
            Platform.ClearBrowserCache();
        }