-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathuForm6.pas
72 lines (60 loc) · 1.57 KB
/
uForm6.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
unit uForm6;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.ListView.Types, FMX.ListView.Appearances,
FMX.ListView.Adapters.Base, FMX.ListView, FMX.Layouts, FMX.StdCtrls, FMX.Controls.Presentation;
type
TForm6 = class(TForm)
ListView1: TListView;
Switch1: TSwitch;
Label1: TLabel;
Layout1: TLayout;
Layout2: TLayout;
Label2: TLabel;
Switch2: TSwitch;
procedure Switch1Switch(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Switch2Switch(Sender: TObject);
private
{ Private declarations }
procedure OnSwipeDirection(Sender: TObject; const Direction: TSwipeDirection);
public
{ Public declarations }
end;
var
Form6: TForm6;
implementation
{$R *.fmx}
procedure TForm6.FormShow(Sender: TObject);
var
I: Integer;
begin
ListView1.ItemsClearTrue;
for I := 0 to 99 do
begin
with ListView1.Items.Add do
begin
Text := 'Item ' + I.ToString;
Detail := '';
Height := 25 + random(99);
end;
end;
end;
procedure TForm6.OnSwipeDirection(Sender: TObject; const Direction: TSwipeDirection);
begin
if Direction = TSwipeDirection.ToLeft then
ShowMessage('ToLeft')
else
ShowMessage('ToRigth');
end;
procedure TForm6.Switch1Switch(Sender: TObject);
begin
ListView1.CanScroll := Switch1.IsChecked;
end;
procedure TForm6.Switch2Switch(Sender: TObject);
begin
ListView1.CanSwipeDirection := Switch2.IsChecked;
ListView1.OnSwipeDirection := OnSwipeDirection;
end;
end.