unit uMain;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, DPF.iOS.BaseControl,
  System.Math,
  System.DateUtils,
  DPF.iOS.Common,
  DPF.iOS.UIFont,
  DPF.iOS.UITableViewItems,
  DPF.iOS.UILabel,
  DPF.iOS.UITableView, DPF.iOS.UIImageView, DPF.iOS.UIView, DPF.iOS.UIButton,
  DPF.iOS.UISwitch;

type
  TForm3 = class( TForm )
    DPFUITableView1: TDPFUITableView;
    DPFUIView1: TDPFUIView;
    procedure FormCreate( Sender: TObject );

    procedure DPFUITableView1GetRowHeight(Sender: TObject; Section: Integer; RowNo: Integer; var RowHeight: Single);

    procedure DPFUITableView1ApplyFrameData( Sender: TObject; Section, RowNo: Integer; TableItem: TTableItem; var Frame: TFrame );
  private
    { Private declarations }
  protected
    procedure PaintRects( const UpdateRects: array of TRectF ); override;
  public
    { Public declarations }
  end;

var
  Form3: TForm3;

implementation

{$R *.fmx}

uses uFrame;

procedure TForm3.DPFUITableView1ApplyFrameData( Sender: TObject; Section, RowNo: Integer; TableItem: TTableItem; var Frame: TFrame );
begin
  if Frame = nil then
    Frame := TFrame1.Create( nil );

  TFrame1( Frame ).DPFImageView1.ImageList.Clear;
  TFrame1( Frame ).DPFImageView1.LoadAsync := true;
  TFrame1( Frame ).DPFImageView1.ImageList.Add( '/Documents/admin.png' );
  TFrame1( Frame ).DPFImageView1.ReloadImage;
  TFrame1( Frame ).DPFLabel1.Text := 'Left Label ' + RowNo.ToString;
  TFrame1( Frame ).DPFLabel2.Text := 'Right Label ' + RowNo.ToString;
  TFrame1( Frame ).DPFLabel3.Text := 'Description ' + RowNo.ToString;
  TFrame1( Frame ).DPFLabel4.Text := FormatDateTime( 'hh:mm', IncSecond( now, RandomRange( 1, 10000 ) ) );
end;

procedure TForm3.DPFUITableView1GetRowHeight( Sender: TObject; Section: Integer; RowNo: Integer; var RowHeight: Single );
begin
  RowHeight := 80;
end;

procedure TForm3.FormCreate( Sender: TObject );
var
  I: Integer;
begin
  DPFUITableView1.ClearAll;
  with DPFUITableView1.Sections.Add do
  begin
    for I := 0 to 100 do
      TableItems.Add;
  end;
  DPFUITableView1.RefreshNeeded;
end;

procedure TForm3.PaintRects( const UpdateRects: array of TRectF );
begin
  { }
end;

end.
