Feniks888 0 Posted Wednesday at 09:22 AM Hello everyone, I'm currently working on a Delphi FMX application and need to improve its accessibility features for interactive elements. Specifically, I want to set the contentDescription for a TImage component, so that it can be properly identified by Google accessibility programs, allowing visually impaired users to interact with it effectively. Could someone please guide me on how to set the contentDescription for an existing TImage component on my form? Any examples or best practices for implementing accessibility in Delphi FMX would be greatly appreciated! Thank you in advance for your help! Share this post Link to post
Feniks888 0 Posted Wednesday at 12:46 PM (edited) I found some information on this topic here: https://support.google.com/accessibility/android/answer/7158690 but I’m unsure how to apply it in Delphi FMX. Could anyone provide guidance on how to implement the contentDescription for interactive elements like TImage in Delphi based on this information? Edited Wednesday at 12:47 PM by Feniks888 Share this post Link to post
Lajos Juhász 286 Posted Wednesday at 01:42 PM I believe this is still the situation. Share this post Link to post
Feniks888 0 Posted Wednesday at 05:05 PM 3 hours ago, Lajos Juhász said: Я вважаю, що це все ще така ситуація. Thank you for your response. Share this post Link to post
Rollo62 526 Posted Friday at 06:32 AM (edited) Maybe that can give some ideas, although for Win and VCL. https://stackoverflow.com/questions/38273974/delphi-components-and-screen-readers Perhaps this can be implemented in similar ways on Android too? But I doubt it will be already well prepared under FMX, habe not checked recently. Edit: Maybe you can check, if this might work for you ( untested ) : But I doubt that the Delphi handle works as expected. uses System.SysUtils, FMX.Types, FMX.Controls, FMX.Platform, FMX.Platform.Android, Androidapi.JNI.GraphicsContentViewText, Androidapi.Helpers, Androidapi.JNI.Widget; ... procedure SetControlAccessibilityDescription(AControl: TControl; const ADescription: string); var NativeView: JView; begin NativeView := WindowHandleToPlatform(AControl.Handle).View; if NativeView <> nil then begin NativeView.setContentDescription(StringToJString(ADescription)); end else begin raise Exception.Create('Das View-Objekt konnte nicht abgerufen werden.'); end; end; ... // Application for Label SetControlAccessibilityDescription(Label1, 'Das ist eine Beschriftung für den Namen'); ... // Application for Edit SetControlAccessibilityDescription(Edit1, 'Bitte geben Sie Ihren Namen ein'); ... // Application for Checkbox SetControlAccessibilityDescription(CheckBox1, 'Ich akzeptiere die Nutzungsbedingungen'); ... // Application for Switch SetControlAccessibilityDescription(Switch1, 'Benachrichtigungen ein- oder ausschalten'); Edited Friday at 07:02 AM by Rollo62 Share this post Link to post
Feniks888 0 Posted 8 hours ago Thank you very much for the code, I'll try it today and let you know if it worked. Share this post Link to post