AndroidScreenReaderEnabled.cs 665 Bytes
Newer Older
Mattia's avatar
Mattia committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
using System;
using Android.Views.Accessibility;
using SampleApp.DependencyServices;
using SampleApp.Droid;
using Xamarin.Forms;
using Android.Content;
using Android.Runtime;
using Android.Views;

[assembly: Dependency(typeof(AndroidScreenReaderEnabled))]
namespace SampleApp.Droid
{
    public class AndroidScreenReaderEnabled : IScreenReaderEnabled
    {


        AccessibilityManager accessibilityManager =(AccessibilityManager)Android.App.Application.Context.GetSystemService(Context.AccessibilityService);

        public bool IsScreenReaderEnabled()
        {
            
            return accessibilityManager.IsEnabled;
            
        }
    }
}