Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip option #129

Open
amarsaurabh opened this issue Feb 12, 2018 · 2 comments
Open

Skip option #129

amarsaurabh opened this issue Feb 12, 2018 · 2 comments

Comments

@amarsaurabh
Copy link

It is not an issue, it's my suggestion that, There should be one skip button so that user can skip the tutorial any time instead of going one by one at the last and finish the tutorial.

@ugochirico
Copy link

I agree with @amarsaurabh. How can we add a skip button to allos the user to skip the tutorial at any time?

@insessor
Copy link

You can add Skip button or any other ui on overlay, like I added Skip button,

FrameLayout frameLayout = tourGuideHandler.getOverlay();

                if (frameLayout != null) {
                    //set the properties for button
                    Button btnTag = new Button(context);
                    final FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);

                    params.gravity = Gravity.TOP | Gravity.RIGHT;

                    Rect rectangle = new Rect();
                    Window window = context.getWindow();
                    window.getDecorView().getWindowVisibleDisplayFrame(rectangle);
                    int statusBarHeight = rectangle.top;

                    int marginTop = 10 + statusBarHeight;
                    int marginBottom = 10 + statusBarHeight*2;
                    int marginRight = 10;
                    int marginLeft = 10;

                    params.setMargins(marginLeft, marginTop, marginRight, marginBottom);
                    btnTag.setLayoutParams(params);
                    btnTag.setText("Skip");
                    btnTag.setId((int) System.currentTimeMillis());

                    //add button to the layout
                    frameLayout.addView(btnTag);

                    btnTag.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {

                        }
                    });
                }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants