Package 

Class Presenter

  • All Implemented Interfaces:

    
    public abstract class Presenter
    
                        

    A Presenter is used to generate Views and bind Objects to them on demand. It is closely related to the concept of an [ ], but is not position-based. The leanback framework implements the adapter concept using AnyAdapter which refers to a Presenter (or PresenterSelector) instance.

    Presenters should be stateless. Presenters typically extend androidx.recyclerview.widget.RecyclerView.ViewHolder to store all necessary view state information, such as references to child views to be used when binding to avoid expensive calls to View.findViewById.

    A trivial Presenter that takes a string and renders it into a [ ]:

    <pre class="prettyprint"> public class StringTextViewPresenter extends Presenter { // This class does not need a custom ViewHolder, since it does not use // a complex layout.
    • Constructor Detail

      • Presenter

        Presenter()