@ SafeVarargs @ NonNull public final Pair < View , Boolean > inflate ( @ NonNull final ItemType item , @ Nullable final ViewGroup parent , final boolean useCache , @ NonNull final ParamType ... params ) { Condition . INSTANCE . ensureNotNull ( params , "The array may not be null" ) ; Condition . INSTANCE . ensureNotNull ( getAdapter ( ) , "No adapter has been set" , IllegalStateException . class ) ; View view = getView ( item ) ; boolean inflated = false ; if ( view == null ) { int viewType = getAdapter ( ) . getViewType ( item ) ; if ( useCache ) { view = pollUnusedView ( viewType ) ; } if ( view == null ) { view = getAdapter ( ) . onInflateView ( getLayoutInflater ( ) , parent , item , viewType , params ) ; inflated = true ; getLogger ( ) . logInfo ( getClass ( ) , "Inflated view to visualize item " + item + " using view type " + viewType ) ; } else { getLogger ( ) . logInfo ( getClass ( ) , "Reusing view to visualize item " + item + " using view type " + viewType ) ; } getActiveViews ( ) . put ( item , view ) ; } getAdapter ( ) . onShowView ( getContext ( ) , view , item , inflated , params ) ; getLogger ( ) . logDebug ( getClass ( ) , "Updated view of item " + item ) ; return Pair . create ( view , inflated ) ; }
Inflates the view which is used to visualize a specific item .