The website www.fmxexpress.com has an article with some really detailed information about the ModernListView Library. Lets check what they are saying.
“Developer rzaripov1990 has a custom ListView component over on Github for Firemonkey in Delphi 10 Berlin. The ListView is the central component for every mobile application, and as a developer you should always choose the one that can be heavily customizable and very easy to use/implement. This modern ListView component is available for Delphi 10 Berlin with FireMonkey on Android, IOS, OSX, and Windows”.
Table of Contents
What are the features of the ModernListView Library?
One nice feature is that it has both horizontal and vertical mode. Thus, using
[crayon-67371b1ccea2d742679252/]enables the list to display the cells (items) in a horizontal perspective, while
[crayon-67371b1ccea36123106552/]displays the items vertically. If you are an artist when designing your look and feel of the application, this component can customize every graphic aspect such with available events such as: SetColorItemSelected, SetColorItemFill, SetColorBackground, SetColorItemSeparator, SetColorText, SetColorTextSelected, SetColorTextDetail, SetColorHeader, SetColorTextHeader, and many other properties.
The properties are self-explanatory, no need to cover them here. With the AutoColumns and ColumnWidth properties, the component will automatically calculate the best fit appearance and position for the items when populating the list (very useful when dealing with large number of items).
Apart form the standard behavior events, you have OnColumnClick listener for the ListView. You also have the option to hide/show the scroll bars (ListView.ShowScrollBar), set indent for items separators (ListView.SeparatorLeftOffset and ListView.SeparatorRightOffset).
How much does the ModernListView Library cost?
The component is free and has some nice demos with it as well. For the moment it is available only for Delphi Berlin using FireMonkey, very useful too if you build multi-device applications.
Using ModernListView Library
Let’s get a better view of what is this all about. We will now go through some of the components, their design and what they do.
Colorizer
- ListView1.SetColorItemSelected(TAlphaColorRec.Orangered);
- ListView1.SetColorItemFill(TAlphaColorRec.Whitesmoke);
- ListView1.SetColorItemFillAlt(TAlphaColorRec.Lightgrey);
- ListView1.SetColorBackground(TAlphaColorRec.Whitesmoke);
- ListView1.SetColorItemSeparator(TAlphaColorRec.Red);
- ListView1.SetColorText(TAlphaColorRec.Darkmagenta);
- ListView1.SetColorTextSelected(TAlphaColorRec.Blueviolet);
- ListView1.SetColorTextDetail(TAlphaColorRec.Darksalmon);
- ListView1.SetColorHeader(TAlphaColorRec.Crimson);
- ListView1.SetColorTextHeader(TAlphaColorRec.Whitesmoke);
- ListView1.SetColorTextHeaderShadow(TAlphaColorRec.grey);
- ListView1.SetColorPullRefresh(TAlphaColorRec.Lime);
- ListView1.SetColorPullRefreshIndicator(TAlphaColorRec.Limegreen);
- ListView1.SetColorStretchGlow(TAlphaColorRec.Limegreen);
set custom color for item
[crayon-67371b1ccea38168011899/]Horizontal Mode
- ListView1.Horizontal := true;
Columns Mode (only vertical)
- ListView1.ColumnWidth := 160;
- ListView1.AutoColumns := true;
Events
event for AutoColumn mode
[crayon-67371b1ccea3b599759035/]called when end of list
[crayon-67371b1ccea3c399350135/]Methods
- Style for ListView Columns Mode
- ListView1.ShowScrollBar – hide/show scrollbar
- ListView1.ItemsClearTrue – correct delete items
- ListView1.OffsetTop – indent of the first element
- ListView1.OffsetBottom – indent of the last element
- ListView1.getFirstVisibleItemIndex – first visible ItemIndex
- ListView1.getVisibleCount – amount of visible items
- ListView1.getLastVisibleItemindex – first visible ItemIndex + amount of visible items
- ListView1.SeparatorLeftOffset – indent for separator line
- ListView1.SeparatorRightOffset – indent for separator line
- ListView1.EnableTouchAnimation – enable/disable touch animation
The list is long, so if you want to see all of it and try the library, just go to Github, download and test this package: https://github.com/rzaripov1990/ModernListView
Note that the screen shots and some of the text in this article are drawn from the above GitHub repository.