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(MultipleShowcaseSampleActivity));
                        break;

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

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

                // Not currently used
                    case 3:
                        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);
        }
Example #2
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);
        }