diff options
author | Jason Smith <jason.smith@xamarin.com> | 2016-04-12 08:53:36 -0700 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-04-12 08:53:36 -0700 |
commit | ba2a434ec13370cc4814b54f6ce51d4d16594f97 (patch) | |
tree | ce0d082e4e114fa689e7c5eee3da9d892b11f49c /Xamarin.Forms.Platform.Android/AppCompat/ButtonRenderer.cs | |
parent | 0a20bdaa3c373ec303c9a94ae45ecaa144996ba5 (diff) | |
download | xamarin-forms-ba2a434ec13370cc4814b54f6ce51d4d16594f97.tar.gz xamarin-forms-ba2a434ec13370cc4814b54f6ce51d4d16594f97.tar.bz2 xamarin-forms-ba2a434ec13370cc4814b54f6ce51d4d16594f97.zip |
Add compatibility shims to fix warnings; annotate warnings which require (#75)
more thought to fix;
Fix a few more warnings VS didn't see fit to raise as errors
Adding comments to `pragma warning disable` statements
pragma comments
Fix typo
Set TabletMasterDetailRenderer back to previous version
Fix incorrect config access in legacy activity
Diffstat (limited to 'Xamarin.Forms.Platform.Android/AppCompat/ButtonRenderer.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Android/AppCompat/ButtonRenderer.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/ButtonRenderer.cs b/Xamarin.Forms.Platform.Android/AppCompat/ButtonRenderer.cs index 817519c7..3260dbf1 100644 --- a/Xamarin.Forms.Platform.Android/AppCompat/ButtonRenderer.cs +++ b/Xamarin.Forms.Platform.Android/AppCompat/ButtonRenderer.cs @@ -4,6 +4,7 @@ using Android.Content; using Android.Content.Res; using Android.Graphics; using Android.Graphics.Drawables; +using Android.Support.V4.Content; using Android.Support.V7.Widget; using Android.Util; using GlobalResource = Android.Resource; @@ -127,14 +128,13 @@ namespace Xamarin.Forms.Platform.Android.AppCompat { Resources.Theme theme = context.Theme; if (theme != null && theme.ResolveAttribute(id, value, true)) -#pragma warning disable 618 - Control.SupportBackgroundTintList = Resources.GetColorStateList(value.Data); -#pragma warning restore 618 + Control.SupportBackgroundTintList = ContextCompat.GetColorStateList(context, value.Data); else Control.SupportBackgroundTintList = new ColorStateList(States, new[] { (int)0xffd7d6d6, 0x7fd7d6d6 }); } catch (Exception ex) { + Log.Warning("Xamarin.Forms.Platform.Android.ButtonRenderer", "Could not retrieve button background resource: {0}", ex); Control.SupportBackgroundTintList = new ColorStateList(States, new[] { (int)0xffd7d6d6, 0x7fd7d6d6 }); } } |