Package 

Class ViewUtils


  • @ApiStatus.Internal() 
    public final class ViewUtils
    
                        
    • Method Summary

      Modifier and Type Method Description
      static String getResourceIdOrNull(@NotNull() View view) Retrieves the human-readable view id based on {@code view.getContext().getResources()}, or {@code null} when the view has no resource-backed id.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getResourceIdOrNull

        @Nullable() static String getResourceIdOrNull(@NotNull() View view)

        Retrieves the human-readable view id based on {@code view.getContext().getResources()}, or {@code null} when the view has no resource-backed id. Returning {@code null} rather thanthrowing avoids exception-driven control flow on hot, main-thread paths such as view-hierarchysnapshots and gesture target resolution.

        Parameters:
        view - - the view whose id is being retrieved