Skip to content

Commit 765eb7f

Browse files
committed
rewrite slide method, now can support loop
1 parent c98e9a6 commit 765eb7f

12 files changed

+212
-110
lines changed

ComponentsSource/FMX.ImageSlider.pas

+180-82
Large diffs are not rendered by default.

Demo/ImageSliderDemo/ImageSliderDemo.dpr

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ program ImageSliderDemo;
33
uses
44
System.StartUpCopy,
55
FMX.Forms,
6-
frmMainU in 'frmMainU.pas' {frmMain};
6+
frmMainU in 'frmMainU.pas' {frmMain},
7+
FMX.ImageSlider in '..\..\ComponentsSource\FMX.ImageSlider.pas';
78

89
{$R *.res}
910

Demo/ImageSliderDemo/ImageSliderDemo.dproj

+1
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@
319319
<Form>frmMain</Form>
320320
<FormType>fmx</FormType>
321321
</DCCReference>
322+
<DCCReference Include="..\..\ComponentsSource\FMX.ImageSlider.pas"/>
322323
<BuildConfiguration Include="Release">
323324
<Key>Cfg_2</Key>
324325
<CfgParent>Base</CfgParent>

Demo/ImageSliderDemo/frmMainU.fmx

+2-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ object frmMain: TfrmMain
181181
Size.Height = 161.000000000000000000
182182
Size.PlatformDefault = False
183183
TabOrder = 10
184-
ActivePage = 0
184+
ActivePage = -1
185+
AnimateDuration = 0.200000002980232200
185186
AutoSlider = False
186187
PageCount = 0
187188
TimerInterval = 5000

Demo/ImageSliderDemo/frmMainU.pas

+9-8
Original file line numberDiff line numberDiff line change
@@ -98,39 +98,40 @@ procedure TfrmMain.FormCreate(Sender: TObject);
9898
AddBitmap('..\..\Images\image2.jpg');
9999
AddBitmap('..\..\Images\image3.jpg');
100100
AddBitmap('..\..\Images\image4.jpg');
101+
ImgSlider.ActivePage := 0;
101102
{$ENDIF}
102103
end;
103104

104105
procedure TfrmMain.ImgSliderCanDragBegin(Sender: TObject;
105106
var CanBegin: Boolean);
106107
begin
107-
Memo1.Lines.Add('On CanDragBegin');
108+
// Memo1.Lines.Add('On CanDragBegin');
108109
end;
109110

110111
procedure TfrmMain.ImgSliderItemClick(Sender: TObject);
111112
begin
112-
Memo1.Lines.Add('On Item Click: '+ TControl(Sender).Tag.ToString);
113+
// Memo1.Lines.Add('On Item Click: '+ TControl(Sender).Tag.ToString);
113114
end;
114115

115116
procedure TfrmMain.ImgSliderItemTap(Sender: TObject; const Point: TPointF);
116117
begin
117-
Memo1.Lines.Add('On Item Tap: '+ TControl(Sender).Tag.ToString);
118+
// Memo1.Lines.Add('On Item Tap: '+ TControl(Sender).Tag.ToString);
118119
end;
119120

120121
procedure TfrmMain.ImgSliderPageAnimationFinish(Sender: TObject; NewPage,
121122
OldPage: Integer);
122123
begin
123-
Memo1.Lines.Add(
124-
Format('On PageAnimationFinish, NewPage: %d, OldPage: %d',
125-
[NewPage, OldPage]));
124+
// Memo1.Lines.Add(
125+
// Format('On PageAnimationFinish, NewPage: %d, OldPage: %d',
126+
// [NewPage, OldPage]));
126127
end;
127128

128129
procedure TfrmMain.ImgSliderPageChange(Sender: TObject; NewPage,
129130
OldPage: Integer);
130131
begin
131132
Memo1.Lines.Add(
132-
Format('On PageChange, NewPage: %d, OldPage: %d',
133-
[NewPage, OldPage]));
133+
Format('On PageChange, OldPage: %d, NewPage: %d',
134+
[OldPage, NewPage]));
134135
end;
135136

136137
procedure TfrmMain.AddBitmap(const FileName: string);

Demo/LoadingIndicatiorDemoMain.fmx

+6-6
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ object LoadingIndicatorDemoForm: TLoadingIndicatorDemoForm
173173
end>
174174
RowCollection = <
175175
item
176-
Value = 33.333333333333330000
176+
Value = 33.333333333333340000
177177
end
178178
item
179-
Value = 33.333333333333330000
179+
Value = 33.333333333333340000
180180
end
181181
item
182-
Value = 33.333333333333330000
182+
Value = 33.333333333333340000
183183
end
184184
item
185185
SizeStyle = Auto
@@ -470,13 +470,13 @@ object LoadingIndicatorDemoForm: TLoadingIndicatorDemoForm
470470
end>
471471
RowCollection = <
472472
item
473-
Value = 33.333333333333330000
473+
Value = 33.333333333333340000
474474
end
475475
item
476-
Value = 33.333333333333330000
476+
Value = 33.333333333333340000
477477
end
478478
item
479-
Value = 33.333333333333330000
479+
Value = 33.333333333333340000
480480
end
481481
item
482482
SizeStyle = Auto

Demo/LoadingIndicatiorDemoMain.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ procedure TLoadingIndicatorDemoForm.FloatAnimation1Process(Sender: TObject);
8383
T, T1: Single;
8484
begin
8585
T := FloatAnimation1.NormalizedTime;
86-
T1 := GetEaseInOut.Solve(T, 1.0E-5);
86+
T1 := TBezier.GetEaseInOut.Solve(T, 1.0E-5);
8787
Rectangle6.Position.X := InterpolateSingle(
8888
FloatAnimation1.StartValue, FloatAnimation1.StopValue, T1);
8989
end;

Demo/RatingBarDemo/RatingBarDemo.dproj

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<MainSource>RatingBarDemo.dpr</MainSource>
77
<Base>True</Base>
88
<Config Condition="'$(Config)'==''">Debug</Config>
9-
<Platform Condition="'$(Platform)'==''">Android</Platform>
9+
<Platform Condition="'$(Platform)'==''">Win32</Platform>
1010
<TargetedPlatforms>1119</TargetedPlatforms>
1111
<AppType>Application</AppType>
1212
</PropertyGroup>
@@ -358,18 +358,18 @@
358358
<Overwrite>true</Overwrite>
359359
</Platform>
360360
</DeployFile>
361-
<DeployFile LocalName="Win32\Debug\RatingBarDemo.exe" Configuration="Debug" Class="ProjectOutput">
362-
<Platform Name="Win32">
363-
<RemoteName>RatingBarDemo.exe</RemoteName>
364-
<Overwrite>true</Overwrite>
365-
</Platform>
366-
</DeployFile>
367361
<DeployFile LocalName="Android\Debug\libRatingBarDemo.so" Configuration="Debug" Class="ProjectOutput">
368362
<Platform Name="Android">
369363
<RemoteName>libRatingBarDemo.so</RemoteName>
370364
<Overwrite>true</Overwrite>
371365
</Platform>
372366
</DeployFile>
367+
<DeployFile LocalName="Win32\Debug\RatingBarDemo.exe" Configuration="Debug" Class="ProjectOutput">
368+
<Platform Name="Win32">
369+
<RemoteName>RatingBarDemo.exe</RemoteName>
370+
<Overwrite>true</Overwrite>
371+
</Platform>
372+
</DeployFile>
373373
<DeployFile LocalName="Android\Debug\AndroidManifest.xml" Configuration="Debug" Class="ProjectAndroidManifest">
374374
<Platform Name="Android">
375375
<Overwrite>true</Overwrite>

Demo/RotatingTextDemo/RotateTextDemoProj.dproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<MainSource>RotateTextDemoProj.dpr</MainSource>
77
<Base>True</Base>
88
<Config Condition="'$(Config)'==''">Debug</Config>
9-
<Platform Condition="'$(Platform)'==''">iOSSimulator</Platform>
9+
<Platform Condition="'$(Platform)'==''">Win32</Platform>
1010
<TargetedPlatforms>1119</TargetedPlatforms>
1111
<AppType>Application</AppType>
1212
</PropertyGroup>

Demo/TestCallout/TestFMXCallout.dproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<MainSource>TestFMXCallout.dpr</MainSource>
77
<Base>True</Base>
88
<Config Condition="'$(Config)'==''">Debug</Config>
9-
<Platform Condition="'$(Platform)'==''">Android</Platform>
9+
<Platform Condition="'$(Platform)'==''">Win32</Platform>
1010
<TargetedPlatforms>1119</TargetedPlatforms>
1111
<AppType>Application</AppType>
1212
</PropertyGroup>

Demo/TestINativeCanvas/TestINativeCanvas.dproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<MainSource>TestINativeCanvas.dpr</MainSource>
77
<Base>True</Base>
88
<Config Condition="'$(Config)'==''">Debug</Config>
9-
<Platform Condition="'$(Platform)'==''">iOSDevice64</Platform>
9+
<Platform Condition="'$(Platform)'==''">Win32</Platform>
1010
<TargetedPlatforms>1119</TargetedPlatforms>
1111
<AppType>Application</AppType>
1212
</PropertyGroup>

Demo/TestLoadingIndicator/TestLoadingIndicator.dpr

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ uses
99

1010
begin
1111
Application.Initialize;
12-
Application.CreateForm(TForm35, Form35);
12+
Application.CreateForm(TLoadingIndicatorDemoMainForm, LoadingIndicatorDemoMainForm);
1313
Application.Run;
1414
end.

0 commit comments

Comments
 (0)