Class · aurore

aurore::RecyclerFrame

On this page
aurore/views/recycler.hpp
#include <aurore/views/recycler.hpp>

class aurore::RecyclerFrame : public aurore::ScrollingFrame

Description

A list that makes only the cells on screen, and reuses them as it scrolls: a long list at the cost of a short one. Its rows come from a RecyclerDataSource; its cells are registered by a reuse identifier (registerCell) and taken back with dequeueReusableCell().

Constructors 2

RecyclerFrame()

An empty list; give it a data source and register its cells.

recycler.hpp:202
~RecyclerFrame()

Functions 18

View * getNextCellFocus(FocusDirection direction, View *currentView)

The cell the focus goes to from currentView (cells off screen included).

recycler.hpp:206
virtual void draw(NVGcontext *vg,float x,float y,float width,float height,Style style,FrameContext *ctx) override

Called by frame() to draw the view onscreen. Views should not draw outside of their bounds (they may be clipped if they do so).

Overrides aurore::Box::draw

recycler.hpp:207
virtual void onLayout() override

Called when a layout pass ends on that view.

Overrides aurore::View::onLayout

recycler.hpp:208
virtual void onThemeChanged() override

Called on every view of the screens when the theme changes (Application::getThemeChangedEvent): the colours given by key (setThemeColor) take their new values, the state styles read their "@theme/" values again. A view that keeps other colours of its own looks them up again here, then calls the base. A Box goes on to its children.

Overrides aurore::Box::onThemeChanged

recycler.hpp:209
virtual void setPadding(float padding) override

Sets the padding of the view, aka the internal space to give between this view boundaries and its children.

Only does one layout pass instead of four when using the four methods separately.

Overrides aurore::Box::setPadding

recycler.hpp:210
virtual void setPadding(float top,float right,float bottom,float left) override

Sets the padding of the view, aka the internal space to give between this view boundaries and its children.

Only does one layout pass instead of four when using the four methods separately.

Overrides aurore::Box::setPadding

recycler.hpp:211
virtual void setPaddingTop(float top) override

Sets the padding of the view, aka the internal space to give between this view boundaries and its children.

Overrides aurore::Box::setPaddingTop

recycler.hpp:212
virtual void setPaddingRight(float right) override

Sets the padding of the view, aka the internal space to give between this view boundaries and its children.

Overrides aurore::Box::setPaddingRight

recycler.hpp:213
virtual void setPaddingBottom(float bottom) override

Sets the padding of the view, aka the internal space to give between this view boundaries and its children.

Overrides aurore::Box::setPaddingBottom

recycler.hpp:214
virtual void setPaddingLeft(float left) override

Sets the padding of the view, aka the internal space to give between this view boundaries and its children.

Overrides aurore::Box::setPaddingLeft

recycler.hpp:215
void setDataSource(RecyclerDataSource *source,bool deleteDataSource = true)

Set an object that acts as the data source of the recycler frame.

deleteDataSource: set to false if source object deletion should NOT be handled by the RecyclerFrame.

recycler.hpp:223
RecyclerDataSource * getDataSource() const

Get an object that acts as the data source of the recycler frame.

recycler.hpp:228
void reloadData()

Reloads the rows of the recycler frame.

recycler.hpp:233
void registerCell(std::string identifier,std::function< RecyclerCell *(void)> allocation)

Registers a class for use in creating new recycler cells.

recycler.hpp:238
RecyclerCell * dequeueReusableCell(std::string identifier)

Returns a reusable recycler-frame cell object for the specified reuse identifier

recycler.hpp:243
void selectRowAt(IndexPath indexPath, bool animated)

Selects a row in the recycler frame identified by index path.

recycler.hpp:248
IndexPath getDefaultCellFocus()

The cell that takes the focus first.

recycler.hpp:257
void setDefaultCellFocus(IndexPath indexPath)

Also the functions of aurore::ScrollingFrame (24), aurore::Box (53), aurore::View (221).

Static functions 1

static View * create()

Makes a list for XML (<aurore:RecyclerFrame>).

recycler.hpp:269

Attributes 1

float estimatedRowHeight = 44

Used for initial recycler's frame calculation if rows autoscaling selected. To provide more accurate height implement RecyclerDataSource::heightForRow().

recycler.hpp:254

Read from Aurore's headers by Doxygen at each build · library/include