2019-01-08 03:07:50 +03:00
|
|
|
|
#if __ANDROID_28__
|
|
|
|
|
using Android.Content;
|
|
|
|
|
using Android.Views;
|
2019-02-28 02:48:45 +03:00
|
|
|
|
using Xamarin.Forms.Platform.Android;
|
2019-03-20 20:11:16 +03:00
|
|
|
|
using AndroidAppCompat = Android.Support.V7.Content.Res.AppCompatResources;
|
2019-01-08 03:07:50 +03:00
|
|
|
|
|
2019-02-28 02:48:45 +03:00
|
|
|
|
namespace Xamarin.Forms.Material.Android
|
2019-01-08 03:07:50 +03:00
|
|
|
|
{
|
|
|
|
|
public class MaterialContextThemeWrapper : ContextThemeWrapper
|
|
|
|
|
{
|
2019-03-20 20:11:16 +03:00
|
|
|
|
public MaterialContextThemeWrapper(Context context) : this(context, Resource.Style.XamarinFormsMaterialTheme)
|
2019-01-08 03:07:50 +03:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-20 20:11:16 +03:00
|
|
|
|
MaterialContextThemeWrapper(Context context, int themeResId) : base(context, themeResId)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2019-01-08 03:07:50 +03:00
|
|
|
|
|
2019-03-20 20:11:16 +03:00
|
|
|
|
public static MaterialContextThemeWrapper Create(Context context)
|
2019-01-08 03:07:50 +03:00
|
|
|
|
{
|
2019-03-20 20:11:16 +03:00
|
|
|
|
if (context is MaterialContextThemeWrapper materialContext)
|
|
|
|
|
return materialContext;
|
2019-01-08 03:07:50 +03:00
|
|
|
|
|
|
|
|
|
return new MaterialContextThemeWrapper(context);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-03-20 20:11:16 +03:00
|
|
|
|
#endif
|