pquessev 0 Posted Monday at 04:49 PM Hello, I developed an application that implements a password input feature, in which the user should be able to temporarily display the password. I defined the input fields in a rectangle whose visibility I can control. I added a TPasswordEditButton to the TEdit field (on Android, I use a TEditButton and implement the MouseUp and MouseDown event processing). This approach works, but I was wondering if it was possible to achieve a similar result with TDialogServiceASync. On Windows, the construction of the dialog elements is done in TDialogBuilder.InputQuery in FMX.DialogHelper. I modified this function to add a TPasswordEditButton component to the Edit field when the input is identified as a password. It works very well. If I understand correctly, in Android, the dialog construction isn't done in this function but in FMXDialogHelpers.java. I'm not an Android Java expert, but I have a feeling there might be a way to modify this function to use a TextInputEditText field, which seems to have a feature to show/hide the password. However, I'm not sure how feasible this modification would be. Do you have any ideas on this? Share this post Link to post
Remy Lebeau 1545 Posted Monday at 07:31 PM (edited) I can't answer your question. But an alternative approach would be to create your own dialog however you want, and then write your own class that implements the IFMXDialogServiceAsync interface to show your dialog, and then register that class with FMX using TPlatformServices.Current.AddPlatformService() (be sure to unregister the default implementation using TPlatformServices.Current.RemovePlatformService() first). Edited Monday at 07:32 PM by Remy Lebeau 1 Share this post Link to post
Patrick PREMARTIN 114 Posted 22 hours ago (edited) Modifying standard units can be a source of problems when you install a new update or major release. It's better you add your own implementation. In FMX it's simple : - ShowModal of a form for Windows, Mac, Linux - For iOS / Android, using a Rectangle for the background (to catch the click events) and your design in front of it. A TFrame shown with an alignment contains and it's done. You can also use https://github.com/andrea-magni/TFrameStand which have dialog box samples. Edited 14 hours ago by Patrick PREMARTIN Share this post Link to post
Remy Lebeau 1545 Posted 14 hours ago 7 hours ago, Patrick PREMARTIN said: - ShowModal of a form for Windows, Mac, Linux The OP asked about Android, and modal dialogs are not supported on Android. Share this post Link to post
Patrick PREMARTIN 114 Posted 14 hours ago 15 minutes ago, Remy Lebeau said: The OP asked about Android, and modal dialogs are not supported on Android. It was my second point, I've updated the post. Share this post Link to post