Delphi Can

Orjinalini görmek için tıklayınız: Application.ProcessMessages in Android
Şu anda (Arşiv) modunu görüntülemektesiniz. Orjinal Sürümü Görüntüle internal link
Hello

why "Application.ProcessMessages" not work in Android?
ProcessMessages allows the jobs waiting in the queue to be temporarily transferred to the main thread by leaving the current thread. 
I do not recommend using ProcessMessages in FMX Multi-platform architecture. Instead of ProcessMessages, write small subroutines. Synchronize or queue each subroutine in a new thread.
(04-12-2020, Saat: 12:57)RAD Coder Adlı Kullanıcıdan Alıntı: [ -> ]ProcessMessages allows the jobs waiting in the queue to be temporarily transferred to the main thread by leaving the current thread. 
I do not recommend using ProcessMessages in FMX Multi-platform architecture. Instead of ProcessMessages, write small subroutines. Synchronize or queue each subroutine in a new thread.
Yes I khow but Embarcadero use it!

See FMX.Ani

class procedure TAnimator.AnimateIntWait(const Target: TFmxObject; const APropertyName: string; const NewValue: Integer;
 Duration: Single = 0.2; AType: TAnimationType = TAnimationType.In;
 AInterpolation: TInterpolationType = TInterpolationType.Linear);
var
 Animation: TIntAnimation;
begin
 StopPropertyAnimation(Target, APropertyName);

 Animation := TIntAnimation.Create(nil);
 try
   Animation.Parent := Target;
   Animation.AnimationType := AType;
   Animation.Interpolation := AInterpolation;
   Animation.Duration := Duration;
   Animation.PropertyName := APropertyName;
   Animation.StartFromCurrent := True;
   Animation.StopValue := NewValue;
   Animation.Start;
   while Animation.FRunning do
   begin
     Application.ProcessMessages;
     Sleep(0);
   end;
 finally
   Animation.DisposeOf;
 end;
end;


I use AnimateIntWait in project , in windows run correct but in android UI don`t response to user because use "Application.ProcessMessages;"

Your comment was edited because it contains invalid code formatting. Please use code formatting in code shares!
(04-12-2020, Saat: 12:32)gbg Adlı Kullanıcıdan Alıntı: [ -> ]Hello

why "Application.ProcessMessages" not work in Android?

Hi,

You can find official answers on this topic here, unfortunately, for now you have to move forward with other solutions.

Good work.
but "Application.ProcessMessages" work in Android with D10.2
You can use the following workaround with Delphi 10.4.
  TThread.CreateAnonymousThread(
   procedure
   begin
     TAnimator.AnimateFloat(Arc1, 'EndAngle', 360, 1.3);
     TThread.Sleep(13 * 100);
     TAnimator.AnimateFloat(Arc1, 'EndAngle', 0, 1.3);
   end).Start;


(04-12-2020, Saat: 17:04)RAD Coder Adlı Kullanıcıdan Alıntı: [ -> ]You can use the following workaround with Delphi 10.4.
  TThread.CreateAnonymousThread(
   procedure
   begin
     TAnimator.AnimateFloat(Arc1, 'EndAngle', 360, 1.3);
     TThread.Sleep(13 * 100);
     TAnimator.AnimateFloat(Arc1, 'EndAngle', 0, 1.3);
   end).Start;

Thanks
But I need to wait in the main thread
I have a CriticalSection and I want the main thread to wait for the end