public ShowcaseViews AddView(ItemViewProperties properties)
        {
            ShowcaseViewBuilder builder = new ShowcaseViewBuilder(activity)
                                          .SetText(properties.TitleResId, properties.MessageResId)
                                          .SetShowcaseIndicatorScale(properties.Scale)
                                          .SetConfigOptions(properties.ConfigurationOptions);

            if (ShowcaseActionBar(properties))
            {
                builder.SetShowcaseItem((int)properties.ItemType, properties.Id, activity);
            }
            else if (properties.Id == (int)ItemViewProperties.ItemViewType.NoShowcase)
            {
                builder.SetShowcaseNoView();
            }
            else
            {
                builder.SetShowcaseView(activity.FindViewById(properties.Id));
            }

            ShowcaseView showcaseView = builder.Build();

            showcaseView.OverrideButtonClick((s, e) =>
            {
                showcaseView.OnClick(showcaseView); //Needed for TYPE_ONE_SHOT

                int fadeOutTime = showcaseView.ConfigurationOptions.FadeOutDuration;

                if (fadeOutTime > 0)
                {
                    var handler = new Handler();
                    handler.PostDelayed(() =>
                    {
                        ShowNextView(showcaseView);
                    }, fadeOutTime);
                }
                else
                {
                    ShowNextView(showcaseView);
                }
            });

            views.Add(showcaseView);

            animations.Add(null);

            return(this);
        }
示例#2
0
        public ShowcaseViews AddView(ItemViewProperties properties)
        {
            ShowcaseViewBuilder builder = new ShowcaseViewBuilder(activity)
                .SetText(properties.TitleResId, properties.MessageResId)
                .SetShowcaseIndicatorScale(properties.Scale)
                .SetConfigOptions(properties.ConfigurationOptions);

            if (ShowcaseActionBar(properties))
            {
                builder.SetShowcaseItem((int)properties.ItemType, properties.Id, activity);
            }
            else if (properties.Id == (int)ItemViewProperties.ItemViewType.NoShowcase)
            {
                builder.SetShowcaseNoView();
            }
            else
            {
                builder.SetShowcaseView(activity.FindViewById(properties.Id));
            }

            ShowcaseView showcaseView = builder.Build();
            showcaseView.OverrideButtonClick((s,e) =>
            {
                showcaseView.OnClick(showcaseView); //Needed for TYPE_ONE_SHOT

                int fadeOutTime = showcaseView.ConfigurationOptions.FadeOutDuration;

                if (fadeOutTime > 0)
                {
                    var handler = new Handler();
                    handler.PostDelayed(() =>
                    {
                        ShowNextView(showcaseView);
                    }, fadeOutTime);
                }
                else
                {
                    ShowNextView(showcaseView);
                }
            });

            views.Add(showcaseView);

            animations.Add(null);

            return this;
        }
示例#3
0
 static bool ShowcaseActionBar(ItemViewProperties properties)
 {
     return properties.ItemType != ItemViewProperties.ItemViewType.NotInActionbar;
 }
 static bool ShowcaseActionBar(ItemViewProperties properties)
 {
     return(properties.ItemType != ItemViewProperties.ItemViewType.NotInActionbar);
 }