Example #1
0
 public override void OnViewModelChanged(object sender, PropertyChangedEventArgs e)
 {
     base.OnViewModelChanged(sender, e);
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.NeedShowSendMenu))
     {
         if (ViewModel.NeedShowSendMenu)
         {
             inviteService.ShowMenu(imageButton);
             //inviteService.ShareLink("What kind of message?", ViewModel.GetInviteText);
             ViewModel.NeedShowSendMenu = false;
         }
     }
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.SubmitButtonAnimated))
     {
         if (ViewModel.SubmitButtonAnimated)
         {
             AnimateButton(imageButton, Resource.Drawable.ic_loadingIndicator);
         }
         if (!ViewModel.SubmitButtonAnimated)
         {
             imageButton.SetImageResource(Resource.Drawable.challenge_invite_btn);
             imageButton.ClearAnimation();
         }
     }
 }
Example #2
0
 public override void OnViewModelChanged(object sender, PropertyChangedEventArgs e)
 {
     base.OnViewModelChanged(sender, e);
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => (ViewModel as BaseChallengesViewModel).Challenge))
     {
         if ((ViewModel as BaseChallengesViewModel).Challenge != null && (ViewModel as BaseChallengesViewModel).Challenge.LocationLat != null && (ViewModel as BaseChallengesViewModel).Challenge.LocationLong != null && _map != null)
         {
             //ViewModel.RequiredLocation = true;
             GoogleMapHelper.UpdateMapZoom(_map, ViewModel.Challenge.LocationLat.Value, ViewModel.Challenge.LocationLong.Value, ViewModel.Challenge.RadiusMeters);
         }
         //else
         //    ViewModel.RequiredLocation = false;
     }
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.SubmitButtonAnimated))
     {
         if (ViewModel.SubmitButtonAnimated)
         {
             AnimateButton(button, Resource.Drawable.ic_loadingIndicator);
         }
         if (!ViewModel.SubmitButtonAnimated)
         {
             button.SetImageResource(Resource.Drawable.challenges_postering_btn);
             button.ClearAnimation();
         }
     }
 }
Example #3
0
        public override void OnViewModelChanged(object sender, PropertyChangedEventArgs e)
        {
            base.OnViewModelChanged(sender, e);
            if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.SubmitButtonAnimated))
            {
                if (ViewModel.SubmitButtonAnimated)
                {
                    AnimateButton(button, Resource.Drawable.ic_loadingIndicator);
                }
                if (!ViewModel.SubmitButtonAnimated)
                {
                    button.SetImageResource(Resource.Drawable.challenge_docsubmit_btn);
                    button.ClearAnimation();
                }
            }

            if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.Challenge))
            {
                if (ViewModel.Challenge != null && !string.IsNullOrEmpty(ViewModel.Challenge.Status) && ViewModel.Challenge.Status == ChallengesConstants.ChallengeStatusPending || ViewModel.Challenge.Status == ChallengesConstants.ChallengeStatusComplete)
                {
                    ViewModel.SubmitButtonHidden = true;
                }
                else
                {
                    ViewModel.SubmitButtonHidden = false;
                }
            }
        }
Example #4
0
 public override void OnViewModelChanged(object sender, PropertyChangedEventArgs e)
 {
     base.OnViewModelChanged(sender, e);
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.IsBusy))
     {
         if (ViewModel.IsBusy)
         {
             ViewModel.SetRefreshImage();
             userPhoto.ImageUrl = string.Empty;
             AnimateImage(userPhoto);
         }
         if (!ViewModel.IsBusy)
         {
             userPhoto.ImageUrl = ViewModel.Profile.ProfilePictureURL;
             userPhoto.ClearAnimation();
         }
     }
     //if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.ItemSelected))
     //{
     //    if (!ViewModel.ItemSelected)
     //    {
     //        adapter.SetUserPhotoUrl();
     //    }
     //}
 }
Example #5
0
 public override void OnViewModelChanged(object sender, PropertyChangedEventArgs e)
 {
     base.OnViewModelChanged(sender, e);
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => (ViewModel as BaseChallengesViewModel).Challenge))
     {
         if ((ViewModel as BaseChallengesViewModel).Challenge != null && (ViewModel as BaseChallengesViewModel).Challenge.LocationLat != null && (ViewModel as BaseChallengesViewModel).Challenge.LocationLong != null && _map != null)
         {
             GoogleMapHelper.UpdateMapZoom(_map, ViewModel.Challenge.LocationLat.Value, ViewModel.Challenge.LocationLong.Value, ViewModel.Challenge.RadiusMeters);
         }
     }
 }
Example #6
0
 public override void OnViewModelChanged(object sender, PropertyChangedEventArgs e)
 {
     base.OnViewModelChanged(sender, e);
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.FBLoaderImage))
     {
         if (ViewModel.IsBusy)
         {
             AnimateImage(twitterNetworkLoader);
             var auth          = new FacebookAuthenticator(Configuration.FbClientId, Configuration.Scope, ViewModel);
             var authenticator = auth.GetAuthenticator();
             var intent        = authenticator.GetUI(this.Activity);
             this.StartActivity(intent);
             AnimateImage(fbNetworkLoader);
         }
         if (!ViewModel.IsBusy)
         {
             fbNetworkLoader.ClearAnimation();
         }
         ChangeSocialNetworkTextColor();
     }
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.TwitterLoaderImage))
     {
         if (ViewModel.IsBusy)
         {
             var auth          = new TwitterAuthentificator(Configuration.ConsumerKeyTwitter, Configuration.ConsumerSecretTwitter, Configuration.Scope, ViewModel);
             var authenticator = auth.GetAuthenticator();
             var intent        = authenticator.GetUI(this.Activity);
             this.StartActivity(intent);
             AnimateImage(twitterNetworkLoader);
         }
         if (!ViewModel.IsBusy)
         {
             twitterNetworkLoader.ClearAnimation();
         }
         ChangeSocialNetworkTextColor();
     }
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.InstaLoaderImage))
     {
         if (ViewModel.IsBusy)
         {
             var auth          = new InstagramAuthenticator(Configuration.ConsumerKeyInsta, string.Empty, Configuration.InstaScope, ViewModel);
             var authenticator = auth.GetAuthenticator();
             var intent        = authenticator.GetUI(this.Activity);
             this.StartActivity(intent);
             AnimateImage(instaNetworkLoader);
         }
         if (!ViewModel.IsBusy)
         {
             instaNetworkLoader.ClearAnimation();
         }
         ChangeSocialNetworkTextColor();
     }
 }
 public override void OnViewModelChanged(object sender, PropertyChangedEventArgs e)
 {
     base.OnViewModelChanged(sender, e);
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.SubmitButtonImage))
     {
         if (ViewModel.GetSubmitButtonImageNormalName() != ViewModel.SubmitButtonImage)
         {
             AnimateImage(submitButton);
         }
         if (ViewModel.GetSubmitButtonImageNormalName() == ViewModel.SubmitButtonImage)
         {
             submitButton.ClearAnimation();
         }
     }
 }
Example #8
0
 public override void OnViewModelChanged(object sender, PropertyChangedEventArgs e)
 {
     base.OnViewModelChanged(sender, e);
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.PlaceholderHidden))
     {
         if (ViewModel.PlaceholderHidden)
         {
             gifImageView.StartAnimation();
         }
         if (!ViewModel.PlaceholderHidden)
         {
             gifImageView.StopAnimation();
         }
     }
 }
        public async override void OnViewModelChanged(object sender, PropertyChangedEventArgs e)
        {
            base.OnViewModelChanged(sender, e);
            if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.NeedGetContacts))
            {
                if (ViewModel.NeedGetContacts)
                {
                    var contacts = await inviteService.GetContacts();

                    ViewModel.SetContactsCollectionFromPlatform(contacts);
                    //contactsAdapter.ItemsSource = ViewModel.Contacts;
                    ViewModel.NeedGetContacts = false;
                }
            }
        }
 public override void OnViewModelChanged(object sender, PropertyChangedEventArgs e)
 {
     base.OnViewModelChanged(sender, e);
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.SubmitButtonAnimated))
     {
         if (ViewModel.SubmitButtonAnimated)
         {
             AnimateButton(submitButton, Resource.Drawable.ic_loadingIndicator);
         }
         if (!ViewModel.SubmitButtonAnimated)
         {
             submitButton.SetImageResource(Resource.Drawable.challenges_fb_btn);
             submitButton.ClearAnimation();
         }
     }
 }
 public override void OnViewModelChanged(object sender, PropertyChangedEventArgs e)
 {
     base.OnViewModelChanged(sender, e);
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.IsBusy))
     {
         if (ViewModel.IsBusy)
         {
             ViewModel.SetRefreshImage();
             AnimateImage(scoreImage);
         }
         if (!ViewModel.IsBusy)
         {
             scoreImage.ClearAnimation();
         }
     }
 }
Example #12
0
 public override void OnViewModelChanged(object sender, PropertyChangedEventArgs e)
 {
     base.OnViewModelChanged(sender, e);
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.SelectedArea))
     {
         if (ViewModel.SelectedArea != null && !string.IsNullOrEmpty(ViewModel.SelectedArea.areaPrimaryColor))
         {
             //areasDetailsIndicatorImage.SetColorFilter(Android.Graphics.Color.ParseColor(ViewModel.SelectedArea.areaPrimaryColor));
             if (!ViewModel.SelectedArea.IsSuggestedArea)
             {
                 areasDetailsIndicatorImage.SetColorFilter(Android.Graphics.Color.ParseColor("#22F3D1"));
             }
             if (ViewModel.SelectedArea.IsSuggestedArea)
             {
                 areasDetailsIndicatorImage.SetColorFilter(Android.Graphics.Color.ParseColor("#F2FA98"));
             }
         }
     }
 }
Example #13
0
 public override void OnViewModelChanged(object sender, PropertyChangedEventArgs e)
 {
     base.OnViewModelChanged(sender, e);
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.IsBusy))
     {
         if (ViewModel.IsBusy)
         {
             ViewModel.SetRefreshImage();
             AnimateImage(scoreImage);
         }
         if (!ViewModel.IsBusy)
         {
             scoreImage.ClearAnimation();
         }
     }
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.DetailsViewHidden))
     {
         (Activity as MainActivity).ChangeShieldViewsVisibility(ViewModel.DetailsViewHidden);
     }
 }
Example #14
0
 public override void OnViewModelChanged(object sender, PropertyChangedEventArgs e)
 {
     base.OnViewModelChanged(sender, e);
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.IsBusy))
     {
         if (ViewModel.Challenge.IsFixedContent && !ViewModel.IsBusy)
         {
             photoGalleryService.UserImageWasAdded = true;
         }
     }
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.SubmitButtonAnimated))
     {
         if (ViewModel.SubmitButtonAnimated)
         {
             AnimateButton(button, Resource.Drawable.ic_loadingIndicator);
         }
         if (!ViewModel.SubmitButtonAnimated)
         {
             button.SetImageResource(Resource.Drawable.challenges_photo_btn);
             button.ClearAnimation();
         }
     }
 }