- Status: Fixed
- Priority: Normal
- Resolution: Fixed
- Platform: Android
- Affects version: 1.11.0.0
Скрытый текст
class procedure TfgAnimationHelper.HideForm(const AForm: TObject; const AOptions: TfgAnimationOptions;
const ADuration: Integer; const AFinishCallback: TfgCallback);
var
LDuration: Integer;
LForm: TfgCustomForm;
{$IFDEF IOS}
LAnimation: TfgAnimation;
LNewTopForm: TfgCustomForm;
{$ENDIF}
begin
TfgAssert.IsNotNil(AForm, 'AForm');
TfgAssert.IsClass(AForm, TfgCustomForm);
LForm := TfgCustomForm(AForm);
if LForm <> TfgFormManager.Current.TopMost then
begin
LForm.Hide;
if Assigned(AFinishCallback) then
AFinishCallback;
Exit;
end;
if ADuration = PlatformDuration then
LDuration := TfgAnimationManager.ShortAnimationDuration
else
LDuration := ADuration;
{$IFDEF IOS}
LNewTopForm := TfgFormManager.Current.PreviousTopMost;
LAnimation := LForm.AnimationManager.AddTranslationAnimation(TPointF.Zero, TPointF.Create(LForm.Width, 0), LDuration);
LAnimation.Options := AOptions + [TfgAnimationOption.ReleaseAnimationOnFinish];
LAnimation.OnFinishCallback := procedure
begin
LForm.Hide;
if Assigned(AFinishCallback) then
AFinishCallback;
end;
LAnimation.Start;
if LNewTopForm <> nil then
begin
LAnimation := LNewTopForm.AnimationManager.AddTranslationAnimation(TPointF.Create(-LNewTopForm.Width / 3, 0),
TPointF.Zero, LDuration);
LAnimation.Options := [TfgAnimationOption.ReleaseAnimationOnFinish];
LAnimation.Start;
end;
{$ELSE}
LForm.Show;
&Out(LForm, TfgAnimationInOutMode.LeftToRight, AOptions, LDuration,
procedure
begin
LForm.Hide;
if Assigned(AFinishCallback) then
AFinishCallback;
end);
{$ENDIF}
end;
При вызове процедуры HideForm из-за вызова LForm.Show (после {$ELSE}) у меня крашится приложение с ошибкой "Component with name ... already exist", т.к. на форме есть компоненты, которые создаются в рантайме в обработчике формы OnShow. На предыдущей версии библиотеки этого не было. Сделал копию файла FGX.Animation с закомментированным вызовом LForm.Show - всё работает.
Fix version: 1.11.1.0
Recommended Comments
Create an account or sign in to comment