protected override void OnResume()
        {
            base.OnResume();
            if (prefs.GetBoolean("FirstRun", true))
            {
                var vt_btnTutor = new ViewTarget(Resource.Id.btnTutor, this);
                ShowcaseView.ConfigOptions config = new ShowcaseView.ConfigOptions();
                config.IsOneShot  = false;
                config.ShowcaseId = 0;
                ShowcaseView showcaseView_btnTutor = ShowcaseView.InsertShowcaseView(vt_btnTutor, this,
                                                                                     "Tutorial", "Use this section to train by playing a series of notes.", config);

                var vt_btnTuner = new ViewTarget(Resource.Id.btnTuner, this);
                config.ShowcaseId = 1;
                ShowcaseView showcaseView_btnTuner = ShowcaseView.InsertShowcaseView(vt_btnTuner, this,
                                                                                     "Tuner", "Use this to tune your guitar.", config);

                /*NoneOnShowcaseEventListener nosel = new NoneOnShowcaseEventListener();
                 * nosel.OnShowcaseViewDidHide(showcaseView_btnTuner);
                 * showcaseView_btnTutor.SetOnShowcaseEventListener(nosel);*/


                showcaseView_btnTutor.Show();

                prefs.Edit().PutBoolean("FirstRun", false).Commit();
            }
        }
Exemplo n.º 2
0
        public override void OnActivityCreated(Bundle savedInstanceState)
        {
            base.OnActivityCreated(savedInstanceState);

            //SetContentView() needs to be called in the Activity first.
            //That's why it has to be in OnActivityCreated().
            var configOptions = new ShowcaseView.ConfigOptions();

            configOptions.HideOnClickOutside = true;

            ShowcaseView.InsertShowcaseView(new ViewTarget(Resource.Id.buttonFragments, Activity), Activity, Resource.String.showcase_fragment_title, Resource.String.showcase_fragment_message, configOptions);
        }
Exemplo n.º 3
0
        public static Point GetShowcasePointFromView(View view, ShowcaseView.ConfigOptions options)
        {
            var result = new Point();

            if (options.Insert == ShowcaseView.INSERTTOVIEW)
            {
                result.X = view.Left + view.Width / 2;
                result.Y = view.Top + view.Height / 2;
            }
            else
            {
                var coordinates = new int[2];

                view.GetLocationInWindow(coordinates);
                result.X = coordinates[0] + view.Width / 2;
                result.Y = coordinates[1] + view.Height / 2;
            }
            return(result);
        }
Exemplo n.º 4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);

            var adapter = new HardcodedListAdapter(this);

            listView            = FindViewById <ListView>(Resource.Id.listView);
            listView.Adapter    = adapter;
            listView.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs e)
            {
                switch (e.Position)
                {
                case 0:
                    StartActivity(typeof(ActionItemsSampleActivity));
                    break;

                case 1:
                    StartActivity(typeof(MultipleShowcaseSampleActivity));
                    break;

                case 2:
                    StartActivity(typeof(ShowcaseFragmentActivity));
                    break;

                case 3:
                    StartActivity(typeof(AnimationSampleActivity));
                    break;

                // Not currently used
                case 4:
                    StartActivity(typeof(MemoryManagementTesting));
                    break;
                }
            };

            DimView(listView);

            buttonBlocked        = FindViewById <Button>(Resource.Id.buttonBlocked);
            buttonBlocked.Click += delegate
            {
                showcaseView.AnimateGesture(0, 0, 0, 400);
            };

            var co = new ShowcaseView.ConfigOptions();

            co.HideOnClickOutside = true;


            // The following code will reposition the OK button to the left.
//            var layoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
//            layoutParams.AddRule(LayoutRules.AlignParentBottom);
//            layoutParams.AddRule(LayoutRules.AlignParentLeft);
//            int margin = (int)Resources.DisplayMetrics.Density * 12;
//            layoutParams.SetMargins(margin, margin, margin, margin);
//            co.ButtonLayoutParams = layoutParams;

            var target = new ViewTarget(Resource.Id.buttonBlocked, this);

            showcaseView = ShowcaseView.InsertShowcaseView(target, this, Resource.String.showcase_main_title, Resource.String.showcase_main_message, co);
            showcaseView.SetOnShowcaseEventListener(this);
        }