private void SetUpViewPager()
        {
            if (viewPager == null)
            {
                return;
            }
            _navigationService = Mvx.Resolve <IMvxNavigationService>();
            var _locationService = Mvx.Resolve <ILocationService>();

            _assetService             = Mvx.Resolve <IPlatformAssetService>();
            _alertService             = Mvx.Resolve <IAlertService>();
            _messenger                = Mvx.Resolve <IMvxMessenger>();
            _localNotificationService = Mvx.Resolve <ILocalNotificationService>();
            fragments = new List <MvxViewPagerFragmentInfo>();
            fragments.Add(new MvxViewPagerFragmentInfo("", typeof(Intro1Fragment), new Intro1ViewModel(_navigationService, _alertService, _assetService, _localNotificationService)));
            fragments.Add(new MvxViewPagerFragmentInfo("", typeof(Intro2Fragment), new Intro2ViewModel(_navigationService, _alertService, _assetService, _localNotificationService)));
            fragments.Add(new MvxViewPagerFragmentInfo("", typeof(Intro3Fragment), new Intro3ViewModel(_navigationService, _alertService, _assetService, _localNotificationService)));
            fragments.Add(new MvxViewPagerFragmentInfo("", typeof(Intro4Fragment), new Intro4ViewModel(_navigationService, _alertService, _assetService, _localNotificationService)));
            fragments.Add(new MvxViewPagerFragmentInfo("", typeof(NetworksFragment), new NetworksViewModel(_navigationService, _locationService, _alertService, _assetService, _localNotificationService, _messenger)));
            viewPager.AddOnPageChangeListener(this);
            _adapter          = new MvxCachingFragmentStatePagerAdapter(this, SupportFragmentManager, fragments);
            viewPager.Adapter = _adapter;
        }
        public static LocalChallengeModel ItemToLocalItem(ChallengeModel item, string sectionName, bool sectionHidden, IPlatformAssetService assetService)
        {
            LocalChallengeModel localItem = new LocalChallengeModel()
            {
                AllowUserCompletion = item.AllowUserCompletion,
                AnswerList          = item.AnswerList,
                AutoUnlockDate      = item.AutoUnlockDate,
                AvailabilityDate    = item.AvailabilityDate,
                ChallengeDetailsURL = item.ChallengeDetailsURL,
                CollateralReview    = item.CollateralReview,
                CompletedCount      = item.CompletedCount,
                CompPointValue      = item.CompPointValue,
                Desc               = item.Desc,
                DisallowSharing    = item.DisallowSharing,
                EffectiveEndDate   = item.EffectiveEndDate,
                EffectiveStartDate = item.EffectiveStartDate,
                FBShareType        = item.FBShareType,
                Group              = item.Group,
                IconImageURL       = item.IconImageURL,
                ID           = item.ID,
                Image        = item.Image,
                ImageLowRes  = item.ImageLowRes,
                InstaCaption = item.InstaCaption,
                InstaURL     = item.InstaURL,
                InviteToChallengeTemplateURL = item.InviteToChallengeTemplateURL,
                IsCommentReq          = item.IsCommentReq,
                IsEventAttendReq      = item.IsEventAttendReq,
                IsFixedContent        = item.IsFixedContent,
                IsGuestList           = item.IsGuestList,
                IsLikeReq             = item.IsLikeReq,
                IsReshareReq          = item.IsReshareReq,
                IsReviewReq           = item.IsReviewReq,
                IsSurvey              = item.IsSurvey,
                LeaderBoardList       = item.LeaderBoardList,
                LocationLat           = item.LocationLat,
                LocationLong          = item.LocationLong,
                LockIndicatorImageURL = item.LockIndicatorImageURL,
                LockReason            = item.LockReason,
                LockStatus            = item.LockStatus,
                MinStars              = item.MinStars,
                MinTags                = item.MinTags,
                MulipleShops           = item.MulipleShops,
                Name                   = item.Name,
                PointIconURL           = item.PointIconURL,
                PointsPerDollar        = item.PointsPerDollar,
                PointsPerInstance      = item.PointsPerInstance,
                PointValue             = item.PointValue,
                Question               = item.Question,
                RadiusMeters           = item.RadiusMeters,
                SecondsUntilExpire     = item.SecondsUntilExpire,
                SecondsUntilUnlock     = item.SecondsUntilUnlock,
                SelectAnswerID         = item.SelectAnswerID,
                Sequence               = item.Sequence,
                ShareImage             = item.ShareImage,
                ShareTemplateURL       = item.ShareTemplateURL,
                SmallImageURL          = item.SmallImageURL,
                Status                 = item.Status,
                Subtitle               = item.Subtitle,
                TargetCount            = item.TargetCount,
                TargetObjectId         = item.TargetObjectId,
                TargetObjectURL        = item.TargetObjectURL,
                templateDiscountAmount = item.templateDiscountAmount,
                templateDiscountNum    = item.templateDiscountNum,
                templateDiscountType   = item.templateDiscountType,
                templateDiscountUse    = item.templateDiscountUse,
                templateEndOffset      = item.templateEndOffset,
                templateName           = item.templateName,
                templateStartOffset    = item.templateStartOffset,
                TypeCode               = item.TypeCode,
                TypeCodeDisplayName    = item.TypeCodeDisplayName,
                UpdateAll              = item.UpdateAll,
                UseDefaultCodes        = item.UseDefaultCodes,
                UsePointsPerDollar     = item.UsePointsPerDollar,
                UseTeamCodes           = item.UseTeamCodes
            };

            localItem.Color         = "#" + ChallengeModel.GetTypeCodeColor(item.TypeCode, item.TypeCodeDisplayName);
            localItem.PointsText    = "+" + item.PointValue.ToString() + " pts";
            localItem.SectionHidden = sectionHidden;
            localItem.SectionName   = sectionName;
            localItem.Icon          = new ChallengeIcon {
                Icon = ChallengesIconHelper.LoadImages(item.TypeCode, item.TypeCodeDisplayName, assetService), IconUrl = localItem.IconImageURL
            };
            return(localItem);
        }
Exemple #3
0
 public Intro1ViewModel(IMvxNavigationService navigationService, IAlertService alertService, IPlatformAssetService assetService, ILocalNotificationService localNotificationService) : base(navigationService, alertService, assetService, localNotificationService)
 {
 }
Exemple #4
0
 public PointsContainerViewModel(IMvxNavigationService navigationService, IAlertService alertService, IPlatformAssetService assetService, ILocalNotificationService localNotificationService, IMvxMessenger messanger) : base(navigationService, alertService, assetService, localNotificationService, messanger)
 {
 }
 public IntroContainerViewModel(IMvxNavigationService navigationService, IAlertService alertService, IPlatformAssetService assetService, ILocalNotificationService localNotificationService) : base(navigationService, alertService, assetService, localNotificationService)
 {
     NavigationHelper.ShowWebViewFromIntroVM = true;
 }
Exemple #6
0
 public FBEngagementViewModel(IMvxNavigationService navigationService, IAlertService alertService, IPlatformAssetService assetService, ILocalNotificationService localNotificationService, IMvxMessenger messanger, IFacebookShareService facebookService) : base(navigationService, alertService, assetService, localNotificationService, messanger)
 {
     _facebookService = facebookService;
     IsBusy           = true;
 }
Exemple #7
0
 public PhotoPickerViewModel(IMvxNavigationService navigationService, IAlertService alertService, IPlatformAssetService assetService, ILocalNotificationService localNotificationService, IMvxMessenger messanger, ILocationService locationService) : base(navigationService, alertService, assetService, localNotificationService, messanger)
 {
     _token           = _messenger.Subscribe <MessangerChallengeModel>(OnChallengeReceived);
     _locationService = locationService;
 }
Exemple #8
0
 public LocationSettingsViewModel(IMvxNavigationService navigationService, IAlertService alertService, IPlatformAssetService assetService, ILocalNotificationService localNotificationService, IMvxMessenger messanger) : base(navigationService, alertService, assetService, localNotificationService, messanger)
 {
     CurrentVM = this;
 }
 public FeedViewModel(IMvxNavigationService navigationService, IAlertService alertService, IPlatformAssetService assetService, ILocalNotificationService localNotificationService, IMvxMessenger messanger) : base(navigationService, alertService, assetService, localNotificationService, messanger)
 {
     LastTabVM = this;
 }
Exemple #10
0
 public BaseFeedViewModel(IMvxNavigationService navigationService, IAlertService alertService, IPlatformAssetService assetService, ILocalNotificationService localNotificationService, IMvxMessenger messanger) : base(navigationService, alertService, assetService, localNotificationService, messanger)
 {
     _actionHandlerService = Mvx.Resolve <IActionHandlerService>();
     FeedItems             = new MvxObservableCollection <FeedItemModel>();
     FeedLoaderHidden      = false;
 }
        public static string LoadImages(string typeCode, string displayName, IPlatformAssetService assetService)
        {
            string icon = string.Empty;

            if (typeCode == ChallengesConstants.ChallengeCheckin || typeCode == ChallengesConstants.ChallengeCollateralTracking)
            {
                icon = assetService.PinIconWhite;
            }
            if (typeCode == ChallengesConstants.ChallengeFacebook)
            {
                icon = assetService.FBLogoIconWhite;
            }
            if (typeCode == ChallengesConstants.ChallengeFBEngagement)
            {
                icon = assetService.FBLogoIconWhite;
            }
            if (typeCode == ChallengesConstants.ChallengeInsta)
            {
                icon = assetService.InstaIconWhite;
            }
            if (typeCode == ChallengesConstants.ChallengeInvite && displayName == ChallengesConstants.ChallengeInviteToBuyDisplayNames)
            {
                icon = assetService.TicketIconWhite;
            }
            if (typeCode == ChallengesConstants.ChallengeInvite && displayName == ChallengesConstants.ChallengeInviteToJoinDisplayNames)
            {
                icon = assetService.InviteIconWhite;
            }
            if (typeCode == ChallengesConstants.ChallengeShare)
            {
                icon = assetService.BulhornIconWhite;
            }
            if (typeCode == ChallengesConstants.ChallengePostering)
            {
                icon = assetService.PosteringIconWhite;
            }
            if (typeCode == ChallengesConstants.ChallengeFlyering)
            {
                icon = assetService.FlyeringIconWhite;
            }
            if (typeCode == ChallengesConstants.ChallengeManual)
            {
                icon = assetService.ManualIconWhite;
            }
            if (typeCode == ChallengesConstants.ChallengeMC)
            {
                icon = assetService.QuizIconWhite;
            }
            if (typeCode == ChallengesConstants.ChallengeSignUp)
            {
                icon = assetService.SignupIconWhite;
            }
            if (typeCode == ChallengesConstants.ChallengeDocsubmit)
            {
                icon = assetService.DocsubmitIconWhite;
            }
            if (typeCode == ChallengesConstants.ChallengeSubmit || typeCode == ChallengesConstants.ChallengeVerify)
            {
                icon = string.Empty;
            }
            return(icon);
        }
Exemple #12
0
 public FacebookViewModel(IMvxNavigationService navigationService, IAlertService alertService, IPlatformAssetService assetService, ILocalNotificationService localNotificationService, IMvxMessenger messanger, IFacebookShareService facebookService) : base(navigationService, alertService, assetService, localNotificationService, messanger)
 {
     _facebookService        = facebookService;
     SubmitButtonImage       = _assetService.ChallengesFacebookButton;
     TopMarginToCompleteView = true;
     IsBusy = true;
 }
 public TwitterViewModel(IMvxNavigationService navigationService, IAlertService alertService, IPlatformAssetService assetService, ILocalNotificationService localNotificationService, IMvxMessenger messanger = null) : base(navigationService, alertService, assetService, localNotificationService, messanger)
 {
     SubmitButtonImage = _assetService.ChallengesShareButton;
     IsBusy            = true;
 }
Exemple #14
0
        public static LocalChallengeTypeModel ItemToLocalItem(ChallengeTypeModel item, IPlatformAssetService assetService, bool isSelected = false)
        {
            LocalChallengeTypeModel localItem = new LocalChallengeTypeModel()
            {
                Color         = item.Color,
                DisplayName   = item.DisplayName,
                Group         = item.Group,
                ImageUrl      = item.ImageUrl,
                Total         = item.Total,
                TotalComplete = item.TotalComplete,
                TypeCode      = item.TypeCode
            };

            localItem.ItemState         = isSelected ? Enums.ChallengesCollectionItemState.Selected : Enums.ChallengesCollectionItemState.Default;
            localItem.TotalCompleteText = item.TotalComplete + " of " + item.Total;
            localItem.Progress          = (int)Math.Round(((double)item.TotalComplete / (double)item.Total) * 100);
            localItem.Color             = "#" + ChallengeModel.GetTypeCodeColor(item.TypeCode, item.DisplayName);
            //localItem.Icon = LoadImages(item.TypeCode, item.DisplayName, assetService);
            localItem.Icon = new ChallengeIcon {
                Icon = ChallengesIconHelper.LoadImages(item.TypeCode, item.DisplayName, assetService), IconUrl = localItem.ImageUrl
            };
            return(localItem);
        }
 public FlyeringViewModel(IMvxNavigationService navigationService, IAlertService alertService, IPlatformAssetService assetService, ILocalNotificationService localNotificationService, IMvxMessenger messanger, ILocationService locationService) : base(navigationService, alertService, assetService, localNotificationService, messanger)
 {
     _locationService = locationService;
 }
 public BasePointsViewModel(IMvxNavigationService navigationService, IAlertService alertService, IPlatformAssetService assetService, ILocalNotificationService localNotificationService, IMvxMessenger messanger = null) : base(navigationService, alertService, assetService, localNotificationService, messanger)
 {
     InitVM();
     Refresh();
     ScoreImage      = _assetService.IconScoreTransactions;
     FirstInitialize = true;
 }
 public CollateralTrackingViewModel(IMvxNavigationService navigationService, IAlertService alertService, IPlatformAssetService assetService, ILocalNotificationService localNotificationService, IMvxMessenger messanger, ILocationService locationService) : base(navigationService, alertService, assetService, localNotificationService, messanger)
 {
     _locationService = locationService;
     IsBusy           = true;
 }
Exemple #18
0
 public RewardCategoriesViewModel(IMvxNavigationService navigationService, IAlertService alertService, IPlatformAssetService assetService, ILocalNotificationService localNotificationService, IMvxMessenger messanger) : base(navigationService, alertService, assetService, localNotificationService, messanger)
 {
     BackButtonHidden = false;
     _refreshCommand  = new MvxAsyncCommand(Refresh);
     _onRewardCategorySelectedCommand = new MvxAsyncCommand <RewardItemModel>(OnRewardCategorySelected);
     PlaceholderModel = LocalPlaceholderHelper.GetRewardsPlacehplder();
 }