Recycler List View
An extension for rendering larger data sets efficiently using RecyclerView for AppInventor & Distros.
Documentation
Events
Event raised to create UI. Don’t bind any data to the UI here.
Parameters
root : AndroidViewComponent
Event raised to bind data to UI.
Parameters
root : AndroidViewComponent
position: Current position.
Functions
Initialize
RecyclerListinside a layout.
Create component inside a layout. For more details see: Dynamic Components
Create components inside a layout using JSON template. See Creating Templates
Set properties of a component.
Returns the root AndroidViewComponent of a child component.
Find a component using tag inside a root component. Returns AndroidViewComponent.
Set unique id of a component.
Get unique id of a component.
Returns true if the given component is dynamic.
Scroll to position.
Properties
Get / Set data count.
Recycler layout managers.
Recycler snap helpers.
Use these blocks to define layout orientation of recycler list.
Get position of first and last partially and fully visible items.
Sample
We will create a simple project that renders buttons inside card. When a button is clicked, it shows snackbar with the id of the button.
Preview

UI
Blocks
- Lets start by initializing the recycler view inside ListContainer. We will use
GridLayoutManagerbecause we want to create multiple columns. If you want to create single coulmn lists, useLinearLayoutManagerinstead. To create a Masonry Layout, useStaggeredLayoutManager. Next we will useNoSnapHelperas we don’t wan’t any snapping. Moreover, snapping only works withLinearLayoutManager. UseLinearSnapHelperto snap items to center &PagerSnapHelperto create a ViewPager snap effect. Next set reverse to false and set spanCount (Number of columns) to 3. Next set the count to 90.
-
We need to inflate our UI inside
OnCreateView. Remember: only create UI, don’t bind any data here. The parameterrootis actually aVerticalArrangement. You can style root view just as you would style a vertical arrangement. Now we will create components usingCreateComponentblock. It takes a layout in which you want to create view, the name of the component, a tag to identify the component inside root view and properties in either a dictionary block or a json string.To get a component reference using the root view, use
GetComponentblock and pass itrootview and tag of the desired component.
-
Inside
OnBindViewevent, we will bind data to the UI. Here we have access to therootview andposition. Here we will set the position as text of the button by usingSetPropertiesblock.To handle click events on a component, it is recommended to set a unique id by joining component name with the position to that component using
SetUniqueIdblock so that you can access thepositionlater inOnClickevent.
- Now we can handle click events using
Any Button.OnClickevent fromAnyComponentsection. First we will verify whether the click event was not already handled and the component is dynamic usingIsDynamicblock. Next we will save the uique id of button toidvariable by usingGetUniqueIdblock. We will also create a position variable. To extract the position from unique id, we will replace the wordbuttonfrom unique id. Now we can use this position to show a snackbar.
Project Files
- APK File : RecyclerListView.apk (5.2 MB)
- AIA File: RecyclerListView.aia (82.4 KB)
Download Extension
1.0.0
- AIX File: com.dreamers.recyclerlist.aix (78.5 KB)
Latest Version
- AIX File : Github

























