How iyouthy/godot-recycler-view works
godot-recycler-view is a Godot 4 GDExtension providing Android-style virtualized lists. A GDScript client configures a RecyclerView with an Adapter and LayoutManager; visible items are obtained and bound through the recycling system, laid out, and displayed in the Godot viewport. Data updates can use incremental notifications or ListAdapter diffing. The README documents animation, touch, snapping, decoration, scroll, and multiple layout capabilities. Wiring for these documented features is represented at subsystem level because their implementations were not sampled.
Main entry points: recycler_view.cpp RecyclerView · recycler.cpp Recycler · adapter.cpp Adapter · diff_util.cpp DiffUtil
Components 20
List Core
- RecyclerView
src/recycler_view.cpp - Adapter
src/adapter.cpp - ViewHolder
src/view_holder.cpp - Recycler
src/recycler.cpp - Recycled Pool
src/recycled_view_pool.h - List State
src/state.cpp
Layout Strategies
- Layout Manager
src/layout_manager.cpp - Linear Layout
src/linear_layout_manager.cpp - Grid Layout
src/grid_layout_manager.cpp - Staggered Layout
src/staggered_grid_layout_manager.cpp - Span Lookup
src/span_size_lookup.cpp
Data Updates
- ListAdapter
src/list_adapter.cpp - DiffUtil
src/diff_util.cpp - Diff Algorithm
src/diff_algo.cpp
Interaction Effects
- Item Animator
src/default_item_animator.cpp - Touch Helper
src/item_touch_helper.cpp - Snap Helper
src/snap_helper.cpp - Item Decoration
src/item_decoration.cpp - Scroll Support
src/fling_scroller.cpp
Other components
- GDScript Client
Connections 20
- GDScript Client → RecyclerView: configures
- GDScript Client → Adapter: supplies
- GDScript Client → Layout Manager: selects
- RecyclerView → Adapter: queries data
- RecyclerView → Layout Manager: dispatches layout
- RecyclerView → List State: updates
- RecyclerView → Recycler: obtains views
- Recycler → Adapter: creates and binds
- Recycler → Recycled Pool: reuses holders
- Recycler → ViewHolder: manages
- Linear Layout → RecyclerView: positions views
- Grid Layout → Span Lookup: queries spans
- ListAdapter → DiffUtil: submits lists
- DiffUtil → Diff Algorithm: computes edits
- Adapter → RecyclerView: notifies updates
- RecyclerView → Item Animator: animates changes
- RecyclerView → Touch Helper: handles gestures
- RecyclerView → Snap Helper: settles scrolling
- RecyclerView → Item Decoration: draws insets
- RecyclerView → Scroll Support: drives fling