summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android/TextViewExtensions.cs
blob: 5b5c1dd8ed95e66049d3b3ded6659a8fcef0fca7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using Android.Content;
using Android.OS;
using Android.Widget;

namespace Xamarin.Forms.Platform.Android
{
	internal static class TextViewExtensions
	{
		public static void SetTextAppearanceCompat(this TextView textView, Context context, int resId)
		{
			if ((int)Build.VERSION.SdkInt < 23)
			{
#pragma warning disable 618 // Using older version of SetTextAppearance for compatibility with API 15-22
				textView.SetTextAppearance(context, resId);
#pragma warning restore 618
			}
			else
				textView.SetTextAppearance(resId);
		}
	}
}