Refactoring of the List View Control in Seattle

From RAD Studio
Jump to: navigation, search

Go Up to What's New in Seattle


The RAD Studio Seattle 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 XE8.

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:

Class or Unit Members from TCustomListView New Members
FMX.ListView.TAdapterListView

Protected:

Public:

Protected:

FMX.ListView.TListViewBase

Public:

Protected:

Public:

Protected:

FMX.ListView.TPresentedListView

Protected:

FMX.ListView.TAppearanceListView

Public:

Protected:

Protected:

FMX.ListView.Appearances

Protected:

FMX.ListView.Appearances.TAppearancesRegistry

Protected:

FMX.ListView.Types

Protected:

Also:

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 TListViewItems:

Class or Unit Members from TListViewItems New Members
TAbstractListViewAdapter

Public:

  • Sort (previously protected)

Public:

Protected:

TFilterableListViewItems

Public:

Protected:

TAppearanceListViewItems

Public:

Protected:

Protected:

FMX.ListView.Types

This refactoring also resulted in the creation of the following new interfaces that these classes of list view items implement:

Class Interfaces
TListViewItems
TFilterableListViewItems
TAppearanceListViewItems

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

TListItemObject has been renamed as TListItemDrawable, and exists now only as an empty subclass of TListItemDrawable for backward compatibility.

In addition, TListItemDrawable has undergone the following changes:

TListItemObjectClass has been moved to FMX.ListView.Appearances and it is now a class reference of TListItemDrawable.

TListItemObjects has been renamed as TListItemView, and exists now only as an empty subclass of TListItemView for backward compatibility.

In addition, TListItemView has undergone the following changes:

  • The ItemList property has been renamed as ViewList. Also, its visibility has changed from protected to public.
  • The Objects property 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

In TListItem:

  • There are two new properties: Adapter, Index.
  • The protected FHeaderRef fields has been replaced by the public HeaderRef property.
  • The TListItemObjectsType type has been renamed as TListItemViewType.
  • The Objects property has been renamed as View.
  • You can no longer use the FParent field to access the parent control of the item list that you pass to the constructor.

There Have Been Other Changes