-
Notifications
You must be signed in to change notification settings - Fork 3
/
Widgets.View.pas
51 lines (41 loc) · 1.31 KB
/
Widgets.View.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
unit Widgets.View;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, System.Skia,
FMX.Skia;
type
TFormWidgets = class(TForm)
SkAniHeartPulse: TSkAnimatedImage;
SkSvgSolidHeart: TSkSvg;
SkSvgHeart: TSkSvg;
private
{ Private declarations }
public
procedure GetAnimationHeart(AParent: TSkSvg);
procedure SkAniHeartAnimationFinish(Sender: TObject);
end;
var
FormWidgets: TFormWidgets;
implementation
{$R *.fmx}
uses AnimationHelper;
procedure TFormWidgets.GetAnimationHeart(AParent: TSkSvg);
begin
TAnimationHelper.CreateAnimatedHeart(FormWidgets.SkAniHeartPulse, AParent, SkAniHeartAnimationFinish);
end;
procedure TFormWidgets.SkAniHeartAnimationFinish(Sender: TObject);
begin
if TSkSvg(TSkAnimatedImage(Sender).Parent).Tag = 1 then
begin
TSkSvg(TSkAnimatedImage(Sender).Parent).Tag := 0;
TSkSvg(TSkAnimatedImage(Sender).Parent).Svg.Source := FormWidgets.SkSvgHeart.Svg.Source;
end
else
begin
TSkSvg(TSkAnimatedImage(Sender).Parent).Tag := 1;
TSkSvg(TSkAnimatedImage(Sender).Parent).Svg.Source := FormWidgets.SkSvgSolidHeart.Svg.Source;
end;
TSkAnimatedImage(Sender).DisposeOf;
end;
end.