Forum Xamarin Xamarin.Forms

Play AutomationProperties manually

DipenHansawalaDipenHansawala USMember ✭✭
edited October 16 in Xamarin.Forms

Is it possible to play AutomationProperties.HelpText manually?

Case:
1. Need to play automation text manually when page is loaded.
i.e. After login success, when navigate to home screen. App should play "Welcome to home page" automatically on page load.
2. Click on save button should play after get success response from API.
i.e. Click on save button on employee edit page. After successful response it should play custom msg like "Employee name is saved with detail emp details.

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    We could implement the function on each platform and use dependency service to call the method .

    For example , in iOS we could use AVSpeechSynthesizer to pronounce the words .

    var attriStrng = new NSMutableAttributedString(new NSString("hello iPhone"));    //here pass the text which you want to play
    // you can set the voice here ,a͡͡a͡͡a͡͡a͡͡a͡͡ is just for testing
    attriStrng.AddAttribute(new NSString("AVSpeechSynthesisIPANotationAttribute"), new NSString("ˈa͡͡a͡͡a͡͡a͡͡a͡͡a͡͡a͡͡.ˈfo͡ʊn"),new NSRange(6,6));
    
    var voice = new AVSpeechUtterance(attriStrng);
    
    AVSpeechSynthesizer synthesizer = new AVSpeechSynthesizer();
    synthesizer.SpeakUtterance(voice);
    

    Refer to
    https://stackoverflow.com/a/54414997/8187800

  • JohnHardmanJohnHardman GBUniversity admin

    @DipenHansawala said:
    Is it possible to play AutomationProperties.HelpText manually?

    Case:
    1. Need to play automation text manually when page is loaded.
    i.e. After login success, when navigate to home screen. App should play "Welcome to home page" automatically on page load.

    Whilst it doesn't do exactly what you are asking, you may find the following thread points you in the right direction, particularly for the first part of your question - https://forums.xamarin.com/discussion/185004/xamarin-forms-accessibility-screen-reader-to-read-each-page-name-header-on-page-load-appearing

Sign In or Register to comment.