Ejemplo n.º 1
0
        public void ShowHelpScreen()
        {
            ShowCaseView showcase = new ShowCaseView.Builder()
                                    .Context(this)
                                    .FocusOn(fab)
                                    .CloseOnTouch(true)
                                    .CustomView(Resource.Layout.CustomShowcaseView, this)
                                    .BackgroundColor(Android.Graphics.Color.ParseColor("#F2204060"))
                                    .FocusBorderColor(Color.White)
                                    .FocusBorderSize(10)
                                    //.TitleGravity((int)GravityFlags.CenterHorizontal)
                                    .FocusCircleRadiusFactor(0.8)
                                    .Build();

            showcase.Show();
        }
        public void Flow(List <View> focuses, TimeSpan autoDelaySpan)
        {
            focusViews = focuses;

            // initialise a showcase queue
            Queue = new ShowCaseQueue();

            int count = 0;

            foreach (var item in focusViews)
            {
                ShowCaseView showcase = new ShowCaseView.Builder()
                                        .Context(context as Activity)
                                        .FocusOn(item)
                                        .CloseOnTouch(false)
                                        .BackgroundColor(Color.DarkRed)
                                        .FocusBorderColor(Color.White)
                                        .FocusBorderSize(15)
                                        .Title(count.ToString())
                                        .TitleGravity((int)(GravityFlags.Top | GravityFlags.Right))
                                        .FocusCircleRadiusFactor(1.5)
                                        .Build();

                Queue.Add(showcase);

                count++;
            }

            // set auto run delay of ten seconds if required
            Queue.AutoRunDelay = autoDelaySpan;

            // set an action once the queue completes.
            Queue.QueueCompleted += ShowCaseQueue_QueueCompleted;

            // Start the queue
            Queue.Show();
        }
        private void SetupShowcases()
        {
            ButtonNoFocus.Click += (s, e) => {
                ShowCaseView showcase = new ShowCaseView.Builder()
                                        .Context(this)
                                        .CloseOnTouch(true)
                                        .BackgroundColor(Color.DarkRed)
                                        .FocusBorderColor(Color.White)
                                        .FocusBorderSize(15)
                                        .Title("No Focus")
                                        .FocusCircleRadiusFactor(1.5)
                                        .Build();

                showcase.Show();
            };

            ButtonCircle.Click += (s, e) => {
                ShowCaseView showcase = new ShowCaseView.Builder()
                                        .Context(this)
                                        .FocusOn(ButtonCircle)
                                        .CloseOnTouch(true)
                                        .BackgroundColor(Color.DarkBlue)
                                        .FocusBorderColor(Color.White)
                                        .FocusBorderSize(15)
                                        .Title("Circle Focus")
                                        .FocusCircleRadiusFactor(1.5)
                                        .Build();

                showcase.Show();
            };

            ButtonRoundedRect.Click += (s, e) => {
                ShowCaseView showcase = new ShowCaseView.Builder()
                                        .Context(this)
                                        .FocusOn(ButtonRoundedRect)
                                        .FocusShape(ShowcaseView.Models.FocusShape.RoundedRectangle)
                                        .CloseOnTouch(true)
                                        .BackgroundColor(Color.DarkGreen)
                                        .FocusBorderColor(Color.White)
                                        .Title("Rounded Rectangle")
                                        .Build();

                showcase.Show();
            };

            ButtonLargerCircle.Click += (s, e) => {
                ShowCaseView showcase = new ShowCaseView.Builder()
                                        .Context(this)
                                        .FocusOn(ButtonLargerCircle)
                                        .CloseOnTouch(true)
                                        .BackgroundColor(Color.DarkMagenta)
                                        .FocusBorderColor(Color.White)
                                        .FocusBorderSize(15)
                                        .Title("Larger Circle")
                                        .TitleGravity((int)GravityFlags.Top)
                                        .FocusCircleRadiusFactor(2.5)
                                        .Build();

                showcase.Show();
            };

            ButtonLongerText.Click += (s, e) => {
                Color color = Color.DarkOrchid;
                color.A = 80;

                ShowCaseView showcase = new ShowCaseView.Builder()
                                        .Context(this)
                                        .FocusOn(ButtonLongerText)
                                        .CloseOnTouch(true)
                                        .BackgroundColor(color)
                                        .FocusBorderColor(Color.White)
                                        .FocusBorderSize(15)
                                        .Title("Longer Text")
                                        .TitleGravity((int)GravityFlags.Top)
                                        .FocusCircleRadiusFactor(1.5)
                                        .Build();

                showcase.Show();
            };

            ButtonWithColour.Click += (s, e) => {
                ShowCaseView showcase = new ShowCaseView.Builder()
                                        .Context(this)
                                        .FocusOn(ButtonWithColour)
                                        .CloseOnTouch(true)
                                        .BackgroundColor(Color.DarkTurquoise)
                                        .FocusBorderColor(Color.White)
                                        .FocusBorderSize(15)
                                        .Title("Color Focus")
                                        .TitleGravity((int)GravityFlags.Top)
                                        .FocusCircleRadiusFactor(1.5)
                                        .Build();

                showcase.Show();
            };

            ButtonCustomAnimation.Click += (s, e) => {
                var enterAnim = AnimationUtils.LoadAnimation(this, Resource.Animation.abc_slide_in_bottom);
                var exitAnim  = AnimationUtils.LoadAnimation(this, Resource.Animation.abc_slide_in_top);

                ShowCaseView showcase = new ShowCaseView.Builder()
                                        .Context(this)
                                        .FocusOn(ButtonCustomAnimation)
                                        .CloseOnTouch(true)
                                        .SetEnterAnimation(enterAnim)
                                        .BackgroundColor(Color.DarkViolet)
                                        .FocusBorderColor(Color.White)
                                        .FocusBorderSize(15)
                                        .TitleGravity((int)GravityFlags.Top)
                                        .Title("Custom Animation")
                                        .FocusCircleRadiusFactor(1.5)
                                        .Build();

                showcase.Show();
            };

            ButtonCustomView.Click += (s, e) => {
                ShowCaseView showcase = new ShowCaseView.Builder()
                                        .Context(this)
                                        .FocusOn(ButtonCustomView)
                                        .CloseOnTouch(true)
                                        .CustomView(Resource.Layout.CustomShowcaseView, this)
                                        .BackgroundColor(Color.DarkBlue)
                                        .FocusBorderColor(Color.White)
                                        .FocusBorderSize(15)
                                        .TitleGravity((int)GravityFlags.Top)
                                        .FocusCircleRadiusFactor(1.5)
                                        .Build();

                showcase.Show();
            };

            ButtonActivity.Click += (s, e) => {
                ShowCaseView showcase = new ShowCaseView.Builder()
                                        .Context(this)
                                        .FocusOn(ButtonActivity)
                                        .CloseOnTouch(true)
                                        .BackgroundColor(Color.DarkBlue)
                                        .FocusBorderColor(Color.White)
                                        .FocusBorderSize(15)
                                        .Title("Show Activity")
                                        .TitleGravity((int)GravityFlags.Top)
                                        .FocusCircleRadiusFactor(1.5)
                                        .Build();

                showcase.Show();
            };

            ShowcaseFlow showcaseFlow = new ShowcaseFlow(this);
            List <View>  list         = new List <View>()
            {
                ButtonAutoQueue,
                ButtonNoFocus,
                ButtonCircle,
                ButtonLongerText,
                ButtonWithColour
            };

            ButtonAutoQueue.Click += (s, e) => {
                showcaseFlow.Flow(list, new TimeSpan(0, 0, 0, 3, 0));
            };
        }