Exemplo n.º 1
0
        /// <summary>
        /// if the user started a new Record while the Animation is running
        /// then we want to stop the current animation and revert views back to default state
        /// </summary>
        public void ResetBasketAnimation()
        {
            try
            {
                if (IsBasketAnimating)
                {
                    TranslateAnimation1?.Reset();
                    TranslateAnimation1?.Cancel();

                    TranslateAnimation2?.Reset();
                    TranslateAnimation2?.Cancel();

                    MicAnimation.Cancel();

                    SmallBlinkingMic.ClearAnimation();
                    BasketImg.ClearAnimation();

                    Handler1?.RemoveCallbacksAndMessages(null);
                    Handler2?.RemoveCallbacksAndMessages(null);

                    BasketImg.Visibility = ViewStates.Invisible;
                    SmallBlinkingMic.SetX(MicX);
                    SmallBlinkingMic.SetY(MicY);
                    SmallBlinkingMic.Visibility = ViewStates.Gone;

                    IsBasketAnimating = false;
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
 public override void OnStartAnim()
 {
     Title.Text           = MainContext.GetText(Resource.String.Lbl_Refreshing);
     ImageIcon.Visibility = ViewStates.Invisible;
     ImageIcon.ClearAnimation();
     ProgressBarView.Visibility = ViewStates.Visible;
 }
Exemplo n.º 3
0
        private void LoadAnimation()
        {
            var loadingAnimation = AnimationUtils.LoadAnimation(this, Resource.Animation.loading_rotate);

            loadingAnimation.RepeatCount = Animation.Infinite;
            loadingAnimation.RepeatMode  = RepeatMode.Restart;

            this.WhenAnyValue(v => v.ViewModel.IsLoading)
            .Subscribe(isLoading =>
            {
                if (_loadingItem != null)
                {
                    if (isLoading)
                    {
                        _loadingView.StartAnimation(loadingAnimation);
                    }
                    else
                    {
                        _loadingView.ClearAnimation();
                    }

                    _loadingItem.SetVisible(isLoading);
                }
            });
        }
Exemplo n.º 4
0
        public void refreshState()
        {
            switch (currentState)
            {
            case PULL_REFRESH:
                iv_arrow.Visibility    = ViewStates.Visible;
                tv_title.Text          = "Drag down to refresh";
                pb_progress.Visibility = ViewStates.Invisible;
                iv_arrow.StartAnimation(animDown);
                break;

            case RELEASE_REFRESH:
                iv_arrow.Visibility    = ViewStates.Visible;
                tv_title.Text          = "Release to refresh";
                pb_progress.Visibility = ViewStates.Invisible;
                iv_arrow.StartAnimation(animUp);
                break;

            case REFRESHING:
                iv_arrow.ClearAnimation();
                iv_arrow.Visibility    = ViewStates.Invisible;
                tv_title.Text          = "Now refreshing...";
                pb_progress.Visibility = ViewStates.Visible;
                if (listner != null)
                {
                    listner.onRefresh();
                }
                break;

            default:
                break;
            }
        }
        private void StopButtonsClick(object sender, EventArgs e)
        {
            _calendarImageView.ClearAnimation();
            _heartImageView.ClearAnimation();
            _buddiesImageView.ClearAnimation();

            _animation?.Stop();
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            var service = new FlickrImageService();

            ViewModel = new FlickrSearchViewModel(service);

            // Load views
            SearchText   = FindViewById <EditText> (Resource.Id.searchText);
            SearchButton = FindViewById <Button>(Resource.Id.searchButton);
            ImagesList   = FindViewById <ListView> (Resource.Id.imagesList);

            // Set up bindings
            this.Bind(ViewModel, vm => vm.SearchText, v => v.SearchText.Text);
            this.OneWayBind(ViewModel, vm => vm.CanEnterSearchText, v => v.SearchText.Enabled);
            this.BindCommand(ViewModel, vm => vm.Search, v => v.SearchButton);

            // Configure list adapter
            var adapter = new ReactiveListAdapter <SearchResultViewModel>(
                ViewModel.Images,
                (viewModel, parent) => new ImageItemView(viewModel, this, parent));

            ImagesList.Adapter = adapter;

            // Set up animations
            var loadingAnimation = AnimationUtils.LoadAnimation(this, Resource.Animation.loading_rotate);

            loadingAnimation.RepeatCount = Animation.Infinite;
            loadingAnimation.RepeatMode  = RepeatMode.Restart;

            this.WhenAnyValue(v => v.ViewModel.IsLoading)
            .Subscribe(isLoading => {
                if (loadingItem != null)
                {
                    if (isLoading)
                    {
                        loadingView.StartAnimation(loadingAnimation);
                    }
                    else
                    {
                        loadingView.ClearAnimation();
                    }

                    loadingItem.SetVisible(isLoading);
                }
            });

            this.WhenAnyValue(v => v.ViewModel.ShowError)
            .Where(x => x)
            .Subscribe(showError => {
                Toast.MakeText(this, "Could not load image data", ToastLength.Long)
                .Show();
            });
        }
Exemplo n.º 7
0
        public bool OnDown(MotionEvent e)
        {
            if (_isAnimationInProgress)
            {
                _deleteButton.Visibility = ViewStates.Invisible;
                _xamagonImage.ClearAnimation();
                _isAnimationInProgress = false;
            }
            else
            {
                _deleteButton.Visibility = ViewStates.Visible;
                _isAnimationInProgress   = true;

                var wiggleAnimation = AnimationUtils.LoadAnimation(this, Resource.Animation.WiggleAnimation);
                _xamagonImage.StartAnimation(wiggleAnimation);
            }

            return(true);
        }
Exemplo n.º 8
0
        /// <summary>
        /// We have entered the stopped state. Run actions and update flags.
        /// </summary>
        private void Stopped()
        {
            imageView.ClearAnimation();

            foreach (Action a in _stopActions)
            {
                a();
            }

            _stopActions.Clear();

            IsRunning = false;
        }
 /// <summary>
 /// 释放动画资源
 /// </summary>
 public void ClearAnimation()
 {
     imageView.ClearAnimation();
     if (imageView.Animation != null)
     {
         imageView.Animation.Dispose();
         imageView.Animation = null;
     }
     if (animation != null)
     {
         animation.Dispose();
         animation = null;
     }
 }
 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();
         }
     }
 }
        //int count = 1;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);


            // Get our button from the layout resource,
            // and attach an event to it
            Button start = FindViewById <Button> (Resource.Id.Start);
            Button stop  = FindViewById <Button> (Resource.Id.Stop);

            ImageView iv = FindViewById <ImageView>(Resource.Id.imageView1);

            stop.Click += (sender, e) => { iv.ClearAnimation();
                                           stop.Enabled  = false;
                                           start.Enabled = true; };
            iv.SetImageResource(Resource.Drawable.left);
            start.Click += (object sender, EventArgs e) => {
                Animation lAnimation = AnimationUtils.LoadAnimation(this, Resource.Animation.RotateLeft);
                //Animation rAnimation=AnimationUtils.LoadAnimation(this,Resource.Animation.RotateRight);
                //lAnimation.RepeatCount=10;
                //lAnimation.RepeatMode=RepeatMode.Reverse;

                start.Enabled            = false;
                stop.Enabled             = true;
                lAnimation.AnimationEnd += (object s, Animation.AnimationEndEventArgs ep) => {
                    //iv.StartAnimation(lAnimation);

                    //iv.StartAnimation(rAnimation);

                    //iv.SetImageResource(Resource.Drawable.right);
                };



                //rAnimation.AnimationEnd+=(object s, Animation.AnimationEndEventArgs ep) => {
                //	iv.StartAnimation(lAnimation);
                //iv.SetImageResource(Resource.Drawable.left);


                //};

                iv.StartAnimation(lAnimation);
            };
        }
Exemplo n.º 12
0
        public void iniciarAnimacion()
        {
            Animation animacion = AnimationUtils.LoadAnimation(this, Resource.Animation.AnimacionAlpha);

            animacion.Reset();

            LinearLayout layout = FindViewById <LinearLayout> (Resource.Id.layout);

            layout.ClearAnimation();
            layout.StartAnimation(animacion);

            animacion = AnimationUtils.LoadAnimation(this, Resource.Animation.AnimacionTranslate);
            animacion.Reset();

            ImageView img = FindViewById <ImageView> (Resource.Id.imageView);

            img.ClearAnimation();
            img.StartAnimation(animacion);
        }
Exemplo n.º 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);
     }
 }
 private void StopAnim()
 {
     LoaderCircle.Visibility = ViewStates.Gone;
     LoaderCircle.ClearAnimation();
 }
Exemplo n.º 15
0
 protected override void OnPause()
 {
     base.OnPause();
     spImage.ClearAnimation();
 }
Exemplo n.º 16
0
 protected override void OnPause()
 {
     base.OnPause();
     _imageView.ClearAnimation();
 }
Exemplo n.º 17
0
 public virtual void show()
 {
     mArrowImageView.ClearAnimation();
     StartAnimation(mInAnim);
 }
Exemplo n.º 18
0
 public override void OnDestroyView()
 {
     base.OnDestroyView();
     _ivCashCircleTop.ClearAnimation();
     _ivCashCircleBottom.ClearAnimation();
 }