コード例 #1
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);
        }
コード例 #2
0
ファイル: ShowcaseViews.cs プロジェクト: andyci/ShowcaseView
        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
ファイル: ShowcaseViews.cs プロジェクト: andyci/ShowcaseView
 static bool ShowcaseActionBar(ItemViewProperties properties)
 {
     return properties.ItemType != ItemViewProperties.ItemViewType.NotInActionbar;
 }
コード例 #4
0
 static bool ShowcaseActionBar(ItemViewProperties properties)
 {
     return(properties.ItemType != ItemViewProperties.ItemViewType.NotInActionbar);
 }