RView is a custom-built, ultra-lightweight alternative to standard list views. While standard lists often struggle with memory overhead when handling thousands of entries, RView uses a View Recycling strategy. It maintains only the strictly necessary number of views in memory, "rebinding" them with new data as they scroll into view.
Designed on a "Celeron budget," this view prioritizes raw performance, smooth 60fps scrolling, and a tiny memory footprint.
Key Performance Features:
True View Recycling: Uses a Cache mechanism to store "dead" views and revive them, preventing OutOfMemory errors regardless of list size.
Asynchronous Image Binding: Images are downloaded and processed in the background, ensuring the UI thread never stutters.
Custom Kinetic Engine: Implements manual touch handling with inertia, friction, and iOS-style elastic overscroll (rubber banding).
Quirurgical Updates: Includes UpdateItemBitmap to update specific elements (like a downloaded avatar) without refreshing the entire list.
Why use this over xCustomListView?
While xCLV is excellent for many cases, RView is built for scale. If you need to display 10,000+ items with complex layouts on low-end hardware, RView's memory consumption remains constant, whereas standard lists grow linearly with the number of items.
Basic Usage Example:
Dim it As RView_ItemData
it.Initialize
it.Id = 1
it.ItemType = 1 ' You can handle multiple layouts
Dim m As Map
m.Initialize
m.Put("name", "John Doe")
m.Put("status", "Coding at 40kb/s...")
it.Data = m
Initialize and Populate:
' In Activity_Create
rv.Initialize(pnlList, Me, "rv")
rv.ColorNormal = Colors.RGB(11, 20, 26)
rv.ColorPressed = Colors.RGB(32, 44, 51)
' Add to your list and submit
dataList.Add(it)
rv.SubmitList(dataList)
3. Handle Events
VB.Net
Sub rv_ItemClick (Index As Int, Value As RView_ItemData)
Dim m As Map = Value.Data
Log("Selected: " & m.Get("name"))
End Sub
Author's Note
This project was developed under extreme hardware and connectivity constraints (Celeron processor and a 40kb/s connection). Because of this, I haven't packaged it as a .b4xlib—I've kept the source code raw and accessible. This is "old school" optimization for modern B4A development. Feel free to grab the classes and drop them directly into your project!
Included Classes:
RView: The core rendering and physics engine.
UserBuilder: Where you define your UI layout (XML-free).
UserBinder: The bridge that connects your raw data to the UI elements.
Types: Defines the data structure.