question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] How to use TapTarget in Navigation Drawer ?

See original GitHub issue

I tried many hours for making it work with TapTarget.forView but without success… I can’t succeed in getting the view of an item in the drawer. I tried the solution was there https://github.com/KeepSafe/TapTargetView/issues/210 but it doesn’t seem to be the adapted for.

If somebody could give me some suggestions, it would be nice. Thanks in advance.

I tried different things as the following way :

private void setupDrawerContent(NavigationView navigationView) {
        NavigationMenuView  test = ( NavigationMenuView ) navigationView.getChildAt(0);
        Log.e("count", "parent "+ navigationView.getChildCount() + " child" + test.getChildCount());
    }

The result was 1 et 0.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
xiphirxcommented, Jan 24, 2018

You’re going to have to get a reference to the target view somehow. Unfortunately, it seems like this class doesnt expose a public API for doing that. Your next best option is reflection, similar to what I do for the Toolbar here: https://github.com/KeepSafe/TapTargetView/blob/master/taptargetview/src/main/java/com/getkeepsafe/taptargetview/ToolbarTapTarget.java

0reactions
gcantonicommented, Dec 30, 2018

View drawerIcon = toolbar.getChildAt(1); child depends on how your layout has been created

Then following simply the README you can pass it in forView method

TapTarget.forView(drawerIcon, "bla", "blabla")

Done 👯‍♂️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using TapTargetView on Navigation Drawer menu item
Solved this by setting app:contentDescription="name_here" to my <item> inside the <menu> Then just call navigationView.
Read more >
Material Design Onboarding in Android- Quickstart (Tap Target)
In this tutorial, we'll learn about using the Quickstart model using TapTarget library. This is part of the updated Material Design guidelines ...
Read more >
Material 3 Design Kit | Figma Community
The Material 3 Design Kit is built to work with the Material Theme Builder Figma ... Navigation drawers (Dark); Outline-variant color role; Keyboards...
Read more >
Error When Running Taptargetview (Material Design For Help ...
Material Design Onboarding in Android- Quickstart (Tap Target). by ... Bottom navigation drawers are a specialized type of modal drawer for use with...
Read more >
Material Design Android App Onboarding. A Tale From The ...
When a user opens the app for the first time, the drawer is opened with a circular ... that you can use, but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found