Refactoring of the List View Control in 1.17
Go Up to What's New
The Appmethod 1.17 list view API was refactored. The list view and list view item components where divided into different layers to provide a list view API that is more flexible and easier to extend than in 1.16.
These changes should barely affect projects that simply use the TListView component. However, these changes may notably affect projects that subclass a list view or list view item class.
TCustomListView Has Been Divided into Five Classes
TCustomListView was split into the following classes that inherit each other:
As a result of this refactoring, many members were moved away from
TCustomListView, and new members were added to the new list view classes:
- Two new interfaces were created, IAppearanceItemOwner and IPublishedAppearanceOwner, which TAppearanceListView implements.
- The new implementation of the
Resizeprocedure made the
ResizeObjectsprocedures unnecessary, and they have been removed.
EndAppearanceUpdatehave been replaced by BeginUpdate and EndUpdate respectively.
TListViewItems Has Been Divided into Four Classes
TListViewItems was moved into a new unit, FMX.ListView.Adapters.Base, and split into the following classes that inherit each other:
As a result of this refactoring, the following members were moved away from
|Class or Unit||Members from
This refactoring also resulted in the creation of the following new interfaces that these classes of list view items implement:
Object Appearance Classes Have Been Moved to FMX.ListView.Appearances
The following classes have been moved to the FMX.ListView.Appearances unit:
TListItemObject Has Been Renamed and Changed
TListItemDrawable has undergone the following changes:
FLocalRectfield has become the LocalRect property.
- It provides a new function: InLocalRect.
- The visibility of CalculateLocalRect has changed from protected to public.
TListItemView has undergone the following changes:
ItemListproperty has been renamed as ViewList. Also, its visibility has changed from protected to public.
Objectsproperty has been renamed as Drawables.
- The FindObject function is now deprecated, use the new FindDrawable function instead.
- The ObjectByName function is not deprecated, use the new DrawableByName function instead.
- It provides a new procedure: Insert.
TListItem Has Undergone Some Changes
- There are two new properties: Adapter, Index.
- The protected
FHeaderReffields has been replaced by the public HeaderRef property.
TListItemObjectsTypetype has been renamed as TListItemViewType.
Objectsproperty has been renamed as View.
- You can no longer use the
FParentfield to access the parent control of the item list that you pass to the constructor.
There Have Been Other Changes
- TCustomListView.ClearItems, which was already deprecated in 1.16, has been removed. Use TCustomListView.Items.Clear instead.
- Appearances.TListViewItem has been moved to FMX.ListView.Appearances, and there is a new alias for it in
- The TListItemImage class provides a new procedure: FitInto.
- The IListItemStyleResources interface defines a new function: StyleResourcesNeedUpdate.
- The IListViewPresentationParent interface defines the following new methods: GetAdapter, GetItemClientRect, RebuildList. Also, DeleteItem now returns a boolean value that indicates whether the deletion succeeded or not.
- There is a new type, TListItemsList, which is an alias of TList<TListItem>.
- TAppearancesRegistry, a new class that contains some members that have been taken out of
TCustomListView, provides an additional, new function: FindItemAppearanceObjectsClassByOption.
- The visibility of the Owner property of TPublishedAppearance has changed from public to published.
Ownerproperty of TPublishedObjects is no longer available.