unit Unit3;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,System.IOUtils,
FMX.ListView.Types, FMX.ListView;
type
TForm3 = class(TForm)
ListView1: TListView;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
{$R *.fmx}
{$R *.NmXhdpiPh.fmx ANDROID}
procedure TForm3.FormCreate(Sender: TObject);
var
LList: TStringDynArray; // Cписок .JPG файлов
LItem: TListViewItem; // Cписок .JPG файлов
path: string; // Папки в которой будем искать файлы
i: Integer;
begin
if TDirectory.Exists('/storage/') then
path := '/storage/'
else path := '/sdcard/';
try
LList := TDirectory.GetFiles(path, '*.JPG', TSearchOption.soAllDirectories);
except
ShowMessage('Произошла ошибка !');
Exit;
end;
ListView1.BeginUpdate;
try
for i := 0 to Length(LList) - 1 do
begin
LItem := ListView1.Items.Add;
LItem.Text := TPath.GetFileNameWithoutExtension(LList);
LItem.Detail := LList;
end;
finally
ListView1.EndUpdate;
end;
end;
end.
0_3.rar