AndroidHeaderPane.cs 1.07 KB
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
using System;
using SampleApp.DependencyServices;
using SampleApp.Droid;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;

[assembly: Dependency(typeof(AndroidHeaderPane))]
namespace SampleApp.Droid
{
    public class AndroidHeaderPane : IAccessibilityHeading, IAccessibilityPane
    {
        public AndroidHeaderPane()
        {
        }

        public void SetHeading(View v)
        {
            v.GetRenderer().View.AccessibilityHeading = true;

        }

        //check if the passed view (vc) is a header
        public bool CheckHeading(View vc)
        {
            if (vc.GetRenderer().View.AccessibilityHeading == true)
            {
                return true;
            }
            return false;
        }

        public void SetPane(View v, string t)
        {
            v.GetRenderer().View.AccessibilityPaneTitle = t;
        }

        public bool CheckPane(View vc)
        {
            if (vc.GetRenderer().View.AccessibilityPaneTitle == null)
            {
                return false;
            }
            return true;


        }
    }
}