TTMSFNCTaskDialog screen centering problem on Android

Hello,

I found this problem on Android only. I uploaded two screenshots:

  • when I use this code:
TaskDialog                            := TTMSFNCTaskDialog.Create(Nil);
TaskDialog.DialogPosition             := tdpOwnerFormCenter; // or tdpScreenCenter, it doesn't matter

... then on Android devices the Task dialog is not in center (have a look at Android-Pozicio01-2023-01-04_17-27-10x.png)

-when I use this code:

       TaskDialog                            := TTMSFNCTaskDialog.Create(DialogParent);
       TaskDialog.Parent                 := DialogParent;
       TaskDialog.DialogPosition     := tdpOwnerFormCenter;

... then it does show in the center, but in the left corner the icon of the TaskDialog can be seen, which won't disappear, even when the user closes the dialog (Android-Pozicio02-2023-01-04_17-58-17x.png screenshot).
If I use "TaskDialog.Visible := False;", it won't help.

How can I center it in the middle of the screen on Android, so as the icon won't be shown? Thank you!


Hi,

Typically on mobile devices the form takes up the screen so tdpOwnerFormCenter and tdpScreenCenter is not used in those cases. However, on mobile devices the dialog should be centered by default. This clearly does not happen when you create the dialog with a nil parent and we'll need to allocate time to investigate this.

In the meantime, you can just create the TTMSFNCTaskDialog with DialogParent, but don't assign DialogParent to TTMSFNCTaskDialog.Parent. This should result in the dialog being shown on the screen center.

TaskDialog := TTMSFNCTaskDialog.Create(DialogParent);
//Remove this:
//TaskDialog.Parent := DialogParent;

Hi Tünde,

Thank you that worked!
I don't know if I should open a new ticket for this question:
On Android the TaskDialog doesn't seem to be "dialog": the user can click on any control on the window which is under the dialog. Is there a workaround?
According to this piece of source, ShowModal doesn't work with mobiles:

  {$IFNDEF FMXMOBILE}
  try
    Result := FDialogForm.ShowModal;
  finally
    FDialogForm.Free;
  end;
  {$ENDIF}

Thank you!

On mobile platforms (Android and iOS) the dialog is handled a bit differently but it should be modal by default. While you can see what controls are on the form when the dialog is shown, you should not be able to interact with those controls.

Is this not the case for you? We cannot reproduce the incorrect behavior here. Do you have a small sample application or code snippet that can reproduce this outside of your application?

TmsDialogTest_2023-01-05_16-10-07.zip (9.8 KB)
Hello,

Thank you for your answer. I attached a sample application where you open the dialog on Android64 and you can still click on the other button.

Hi,

Thank you for the test project. We applied a fix for this which will be available with the next update.

Please check your private messages for an incremental source update.

1 Like

Hi,

Thank you very much!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.