示例#1
0
        public void ShowBar(Action flashBarCallback, bool immediate = false, string withMessage = null, int withMessageId = -1)
        {
            if (withMessage != null)
            {
                this.message     = withMessage;
                messageView.Text = message;
            }
            if (withMessageId != -1)
            {
                this.message     = barView.Resources.GetString(withMessageId);
                messageView.Text = message;
            }

            this.flashBarCallback = flashBarCallback;
            hideHandler.RemoveCallbacks(hideRunnable);
            hideHandler.PostDelayed(hideRunnable, DefaultHideTime);

            barView.Visibility = ViewStates.Visible;
            if (immediate)
            {
                barView.Alpha = 1;
            }
            else
            {
                barAnimator.Cancel();
                barAnimator.Alpha(1);
                barAnimator.SetDuration(barView.Resources.GetInteger(Android.Resource.Integer.ConfigShortAnimTime));
                barAnimator.SetListener(null);
            }
        }
示例#2
0
            public void ShowBar(string message)
            {
                messageView.Text = message;

                barView.Visibility = ViewStates.Visible;

                barAnimator.Cancel();
                barAnimator.Alpha(1);
                barAnimator.SetDuration(300);
                barAnimator.SetListener(null);
            }
        private void Overshoot()
        {
            try
            {
                if (_animatedView != null)
                {
                    var interpolator = new OvershootInterpolator();

                    _animator.TranslationY(DeltaXY.YDelta);
                    _animator.SetDuration(GetResourceAnimationTimeValue()); //duration
                    _animator.SetInterpolator(interpolator);

                    _animator.Start();
                }
            }
            catch (Exception e)
            {
                Log.Error(TAG, "Overshoot: Exception - " + e.Message);
            }
        }