Table Of Contents

The adapter part of the RecycleView which together with the layout is the
view part of the model-view-controller pattern.

The view module handles converting the data to a view using the adapter class
which is then displayed by the layout. A view can be any Widget based class.
However, inheriting from RecycleDataViewBehavior adds methods for converting
the data to a view.

It can be completely in sync with the data, which
occurs when the view is displayed. These are stored in views.

It can be dirty, which occurs when the view is in sync with the data,
except for the size/pos parameters which is controlled by the layout.
This occurs when the view is not currently displayed but the data has
not changed. These views are stored in dirty_views.

Finally the view can be dead which occurs when the data changes and
the view was not updated or when a view is just created. Such views
are typically added to the internal cache.

Typically what happens is that the layout manager lays out the data
and then asks for views, using set_visible_views,() for some specific
data items that it displays.

These views are gotten from the current views, dirty or global cache. Then
depending on the view state refresh_view_attrs() is called to bring
the view up to date with the data (except for sizing parameters). Finally,
the layout manager gets these views, updates their size and displays them.

As opposed to making a view dirty where the view is in sync with the
data except for sizing information, this will completely disconnect the
view from the data, as it is assumed the data has gone out of sync with
the view.

Dirty views are still in sync with the corresponding data. However, the
size information may go out of sync. Therefore a dirty view can be
reused by the same index by just updating the sizing information.

Once the underlying data of this index changes, the view should be
removed from the dirty views and moved to the global cache with
invalidate().

This is typically called when the layout manager needs to re-layout all
the data.

A optional base class for data views (RecycleView.viewclass).
If a view inherits from this class, the class’s functions will be called
when the view needs to be updated due to a data change or layout update.

Called when the view’s size is updated by the layout manager,
RecycleLayoutManagerBehavior.

Parameters:

rv: RecycleView instance

The RecycleView that caused the update.

viewport: 4-tuple

The coordinates of the bottom left and width height in layout
manager coordinates. This may be larger than this view item.

Raises:

LayoutChangeException: If the sizing or data changed during a
call to this method, raising a LayoutChangeException exception
will force a refresh. Useful when data changed and we don’t want
to layout further since it’ll be overwritten again soon.