Exemplo n.º 1
0
        public void Show()
        {
            if (views.Count == 0)
            {
                return;
            }

            ShowcaseView view = views[0];

            bool hasShot = activity.GetSharedPreferences(ShowcaseView.PREFSSHOWCASEINTERNAL, FileCreationMode.Private).GetBoolean("hasShot" + view.ConfigurationOptions.ShowcaseId, false);

            if (hasShot && view.ConfigurationOptions.IsOneShot)
            {
                // The showcase has already been shot once, so we don't need to do show it again.
                view.Visibility = ViewStates.Gone;
                views.RemoveAt(0);
                animations.RemoveAt(0);

                view.ConfigurationOptions.FadeOutDuration = 0;
                view.PerformButtonClick();
                return;
            }

            view.Visibility = ViewStates.Invisible;
            ((ViewGroup)activity.Window.DecorView).AddView(view);
            view.Show();

            float[] animation = animations[0];
            if (animation != null)
            {
                view.AnimateGesture(animation[1], animation[2], animation[3], animation[4], animation[0] == ABSOLUTE_COORDINATES);
            }

            views.RemoveAt(0);
            animations.RemoveAt(0);
        }
 public ShowcaseViewBuilder AnimateGesture(float offsetStartX, float offsetStartY, float offsetEndX, float offsetEndY)
 {
     showcaseView.AnimateGesture(offsetStartX, offsetStartY, offsetEndX, offsetEndY);
     return(this);
 }