navigation/ui/src/main/java/androidx/navigation/ui/NavigationUI.java
private static boolean matchDestination(@NonNull NavDestination destination,
            @IdRes int destId) {
        NavDestination currentDestination = destination;
        while (currentDestination.getId() != destId && currentDestination.getParent() != null) {
            currentDestination = currentDestination.getParent();
        }
        return currentDestination.getId() == destId;
    }
/**
     * Determines whether the given <code>destId</code> matches the NavDestination. This handles
     * both the default case (the destination's id matches the given id) and the nested case where
     * the given id is a parent/grandparent/etc of the destination.
     */
Determines whether the given destId matches the NavDestination. This handles
both the default case (the destination's id matches the given id) and the nested case where
the given id is a parent/grandparent/etc of the destination.
Determines whether the given destId matches the NavDestination . This handles both the default case ( the destination ' s id matches the given id ) and the nested case where the given id is a parent / grandparent / etc of the destination .
private static boolean matchDestination(@NonNull NavDestination destination,
            @IdRes int destId) {
        NavDestination currentDestination = destination;
        while (currentDestination.getId() != destId && currentDestination.getParent() != null) {
            currentDestination = currentDestination.getParent();
        }
        return currentDestination.getId() == destId;
    }
private static boolean matchDestination ( @ NonNull NavDestination destination , @ IdRes int destId ) { NavDestination currentDestination = destination ; while ( currentDestination . getId ( ) != destId && currentDestination . getParent ( ) != null ) { currentDestination = currentDestination . getParent ( ) ; } return currentDestination . getId ( ) == destId ; }
Determines whether the given <code>destId</code> matches the NavDestination.
Determines whether the given <code > destId< / code > matches the NavDestination .