29jitender / Spotlight

Spotlight is an Android library used to onboard users by showcasing specific features in the app.
Apache License 2.0
1.27k stars 163 forks source link

Add showcase on navigation drawer menu items #47

Closed sajjadG closed 7 years ago

sajjadG commented 7 years ago

Hi navigation drawer items are not views. how can we add showcase for them?

dhavalwooplr commented 7 years ago

Can you please share a screenshot where exactly you want to show it in the navigation drawer?

sajjadG commented 7 years ago

image

I want to open showcase on navigation drawer menu item and it's not a View. it's a MenuItem so I'm using PointTarget for now but I think there should be better way to do that. This is the code I'm using:

Button closeButton = new Button(this);
        closeButton.setBackgroundColor(200);
        closeButton.setEnabled(false);

        showcaseView = new ShowcaseView.Builder(this)
                .setTarget(new PointTarget(330, 570))
//                .setTarget(new ViewTarget(((Toolbar) findViewById(R.id.toolbar)).getChildAt(0)))//works
                .setContentTitle("Add a new device")
                .setContentText("You need to add a new device to be able to use this app")
//                .hideOnTouchOutside()
                .setStyle(R.style.CustomShowcaseTheme2)
                .replaceEndButton(closeButton)
                .build();
dhavalwooplr commented 7 years ago

Please check #35 , You can get a view from menu item, refer to the given links.