deano2390 / MaterialShowcaseView

A Material Design themed ShowcaseView for Android
Apache License 2.0
2.71k stars 526 forks source link

How to target the menuItem of Navigation Bar #176

Open developerShashwat opened 5 years ago

developerShashwat commented 5 years ago

I have implemented all the classes of this library in my project and its working fine for all the views. But still, I am not able to target the menu item of the Navigation Drawer. Can anyone help me on this as it is too much hampering my task?

some of my general implementations are

In my Menu XML <item android:id="@+id/solved_questions" android:checked="false" android:icon="@drawable/ic_description_black_24dp" android:title="@string/menu_solved_questions" app:showAsAction="ifRoom" app:actionViewClass="android.widget.TextView"/>

In my JAVA class viewsolvedQuestion = (TextView) navigationView.getMenu().findItem(R.id.solved_questions).getActionView(); showcaseView("Tap this to open solved question", "515", viewsolvedQuestion, LessonListActivity.this, new RectangleShape(900,200), null);

And my Method is public static void showcaseView(String text, String id, View view, Activity activity, Shape shape, IShowcaseListener listener) { MaterialShowcaseView.Builder builder = new MaterialShowcaseView.Builder(activity) .setTarget(view) .setTitleText("") .setTargetTouchable(false) .setDismissOnTargetTouch(true) .setShape(shape) .setDismissText("Got It") .setContentText(text) .renderOverNavigationBar() .singleUse(id) .setDelay(70); if (null != listener) builder.setListener(listener); builder.show(); }

aristotle-kdj commented 3 years ago

I too have this same problem, does anyone have solution for this??