summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android/Cells
diff options
context:
space:
mode:
authorPaul DiPietro <paul.dipietro@me.com>2016-04-11 09:50:28 -0700
committerJason Smith <jason.smith@xamarin.com>2016-04-11 09:50:28 -0700
commitb2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c (patch)
tree227d1614c84e3d2dbe7f6231276955a6a174ff6d /Xamarin.Forms.Platform.Android/Cells
parentc0468f1cc33fc4dc415c3a3ca4dc71986b04fc9c (diff)
downloadxamarin-forms-b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c.tar.gz
xamarin-forms-b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c.tar.bz2
xamarin-forms-b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c.zip
Enable CS0618 warnings as errors (#72)
CS0618 occurs when using an obsolete property or method. https://msdn.microsoft.com/en-us/library/x5ye6x1e.aspx
Diffstat (limited to 'Xamarin.Forms.Platform.Android/Cells')
-rw-r--r--Xamarin.Forms.Platform.Android/Cells/BaseCellView.cs14
-rw-r--r--Xamarin.Forms.Platform.Android/Cells/EntryCellView.cs2
2 files changed, 16 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Android/Cells/BaseCellView.cs b/Xamarin.Forms.Platform.Android/Cells/BaseCellView.cs
index 46959c08..60267c3e 100644
--- a/Xamarin.Forms.Platform.Android/Cells/BaseCellView.cs
+++ b/Xamarin.Forms.Platform.Android/Cells/BaseCellView.cs
@@ -39,7 +39,9 @@ namespace Xamarin.Forms.Platform.Android
SetPadding(padding, padding, padding, padding);
_imageView = new ImageView(context);
+#pragma warning disable 618
var imageParams = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.FillParent)
+#pragma warning restore 618
{
Width = (int)context.ToPixels(60),
Height = (int)context.ToPixels(60),
@@ -55,8 +57,13 @@ namespace Xamarin.Forms.Platform.Android
_mainText.SetSingleLine(true);
_mainText.Ellipsize = TextUtils.TruncateAt.End;
_mainText.SetPadding((int)context.ToPixels(15), padding, padding, padding);
+#pragma warning disable 618
_mainText.SetTextAppearance(context, global::Android.Resource.Attribute.TextAppearanceListItem);
+#pragma warning restore 618
+
+#pragma warning disable 618
using (var lp = new LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent))
+#pragma warning restore 618
textLayout.AddView(_mainText, lp);
_detailText = new TextView(context);
@@ -64,8 +71,13 @@ namespace Xamarin.Forms.Platform.Android
_detailText.Ellipsize = TextUtils.TruncateAt.End;
_detailText.SetPadding((int)context.ToPixels(15), padding, padding, padding);
_detailText.Visibility = ViewStates.Gone;
+#pragma warning disable 618
_detailText.SetTextAppearance(context, global::Android.Resource.Attribute.TextAppearanceListItemSmall);
+#pragma warning restore 618
+
+#pragma warning disable 618
using (var lp = new LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent))
+#pragma warning restore 618
textLayout.AddView(_detailText, lp);
var layoutParams = new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent) { Width = 0, Weight = 1, Gravity = GravityFlags.Center };
@@ -118,7 +130,9 @@ namespace Xamarin.Forms.Platform.Android
if (view != null)
{
+#pragma warning disable 618
using (var layout = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.FillParent))
+#pragma warning restore 618
AddView(view, layout);
AccessoryView = view;
diff --git a/Xamarin.Forms.Platform.Android/Cells/EntryCellView.cs b/Xamarin.Forms.Platform.Android/Cells/EntryCellView.cs
index f94709d0..c1ae1911 100644
--- a/Xamarin.Forms.Platform.Android/Cells/EntryCellView.cs
+++ b/Xamarin.Forms.Platform.Android/Cells/EntryCellView.cs
@@ -29,7 +29,9 @@ namespace Xamarin.Forms.Platform.Android
SetPadding((int)context.ToPixels(15), padding, padding, padding);
_label = new TextView(context);
+#pragma warning disable 618
_label.SetTextAppearance(context, global::Android.Resource.Attribute.TextAppearanceListItem);
+#pragma warning restore 618
var layoutParams = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent) { Gravity = GravityFlags.CenterVertical };
using (layoutParams)