summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS/Renderers
diff options
context:
space:
mode:
authorSamantha Houts <samantha@teamredwall.com>2016-04-11 18:05:28 -0700
committerJason Smith <jason.smith@xamarin.com>2016-04-11 18:05:28 -0700
commit90d8976cfdadc1582e366c0b6f6611d6fe83f5ff (patch)
treee2ebd71214c4855ec5862d9c2c13f3a90051ae31 /Xamarin.Forms.Platform.iOS/Renderers
parentdf2427091536ed8065e50f7bffebbc5707971803 (diff)
downloadxamarin-forms-90d8976cfdadc1582e366c0b6f6611d6fe83f5ff.tar.gz
xamarin-forms-90d8976cfdadc1582e366c0b6f6611d6fe83f5ff.tar.bz2
xamarin-forms-90d8976cfdadc1582e366c0b6f6611d6fe83f5ff.zip
[iOS] Resolve Warning 0108 (#64)
[iOS] Resolve warning 0114 `Selected` is overridable, but current behavior is to hide it, so we're going to add the `new` keyword. [iOS] Resolve warning 0618 [iOS] Resolve warning 0414, 0649, 0169 [iOS] Resolve warning 0105 Update dispose to override base dispose (#67) Add an optional extended description…
Diffstat (limited to 'Xamarin.Forms.Platform.iOS/Renderers')
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/CarouselViewRenderer.cs11
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/FontExtensions.cs3
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/FormattedStringExtensions.cs5
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/NavigationMenuRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs9
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/TabletMasterDetailRenderer.cs61
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/WebViewRenderer.cs4
7 files changed, 45 insertions, 50 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/CarouselViewRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/CarouselViewRenderer.cs
index 84f57a91..3efb316b 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/CarouselViewRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/CarouselViewRenderer.cs
@@ -46,7 +46,6 @@ namespace Xamarin.Forms.Platform.iOS
{
#region Static Fields
const int DefaultMinimumDimension = 44;
- static readonly UIColor DefaultBackgroundColor = UIColor.White;
#endregion
#region Fields
@@ -248,11 +247,11 @@ namespace Xamarin.Forms.Platform.iOS
void Bind(object item, int position)
{
- //if (position != this.position)
- // controller.SendPositionDisappearing (this.position);
+ //if (position != this._position)
+ // controller.SendPositionDisappearing (this._position);
_position = position;
- OnBind?.Invoke(position);
+ OnBind?.Invoke(_position);
_controller.BindView(_view, item);
}
@@ -274,7 +273,7 @@ namespace Xamarin.Forms.Platform.iOS
_view = controller.CreateView(itemType);
// bind view
- Bind(item, position);
+ Bind(item, _position);
// render view
_renderer = Platform.CreateRenderer(_view);
@@ -285,7 +284,7 @@ namespace Xamarin.Forms.Platform.iOS
ContentView.AddSubview(uiView);
}
else
- Bind(item, position);
+ Bind(item, _position);
}
public Action<int> OnBind;
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/FontExtensions.cs b/Xamarin.Forms.Platform.iOS/Renderers/FontExtensions.cs
index b2410018..c2e565d9 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/FontExtensions.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/FontExtensions.cs
@@ -196,10 +196,11 @@ namespace Xamarin.Forms.Platform.iOS
_size = size;
_attributes = attributes;
}
-
+#pragma warning disable 0414 // these are not called explicitly, but they are used to establish uniqueness. allow it!
string _family;
float _size;
FontAttributes _attributes;
+#pragma warning restore 0414
}
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/FormattedStringExtensions.cs b/Xamarin.Forms.Platform.iOS/Renderers/FormattedStringExtensions.cs
index 89a09e86..4bb829b5 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/FormattedStringExtensions.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/FormattedStringExtensions.cs
@@ -16,10 +16,9 @@ namespace Xamarin.Forms.Platform.iOS
if (span == null)
return null;
-#pragma warning disable 618
+#pragma warning disable 0618 //retaining legacy call to obsolete code
var font = span.Font != Font.Default ? span.Font : defaultFont;
-#pragma warning restore 618
-
+#pragma warning restore 0618
var fgcolor = span.ForegroundColor;
if (fgcolor.IsDefault)
fgcolor = defaultForegroundColor;
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/NavigationMenuRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/NavigationMenuRenderer.cs
index b3269927..aa9b5ff3 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/NavigationMenuRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/NavigationMenuRenderer.cs
@@ -89,7 +89,7 @@ namespace Xamarin.Forms.Platform.iOS
set { _nameLabel.Text = value; }
}
- public Action Selected { get; set; }
+ public new Action Selected { get; set; }
public override void LayoutSubviews()
{
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs
index 74e7fdd6..ca690eed 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs
@@ -435,9 +435,9 @@ namespace Xamarin.Forms.Platform.iOS
void HandlePropertyChanged(object sender, PropertyChangedEventArgs e)
{
-#pragma warning disable 618
+#pragma warning disable 0618 //retaining legacy call to obsolete code
if (e.PropertyName == NavigationPage.TintProperty.PropertyName)
-#pragma warning restore 618
+#pragma warning restore 0618
UpdateTint();
if (e.PropertyName == NavigationPage.BarBackgroundColorProperty.PropertyName)
UpdateBarBackgroundColor();
@@ -645,10 +645,9 @@ namespace Xamarin.Forms.Platform.iOS
void UpdateTint()
{
-#pragma warning disable 618
+#pragma warning disable 0618 //retaining legacy call to obsolete code
var tintColor = ((NavigationPage)Element).Tint;
-#pragma warning restore 618
-
+#pragma warning restore 0618
if (Forms.IsiOS7OrNewer)
{
NavigationBar.BarTintColor = tintColor == Color.Default ? UINavigationBar.Appearance.BarTintColor : tintColor.ToUIColor();
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/TabletMasterDetailRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/TabletMasterDetailRenderer.cs
index 3561322c..6bf2aa86 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/TabletMasterDetailRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/TabletMasterDetailRenderer.cs
@@ -69,37 +69,38 @@ namespace Xamarin.Forms.Platform.iOS
get { return _innerDelegate == null ? null : _innerDelegate.PresentButton; }
}
- public void Dispose()
+ protected override void Dispose(bool disposing)
{
- if (_disposed)
- return;
-
- if (Element != null)
- {
- ((Page)Element).SendDisappearing();
- Element.PropertyChanged -= HandlePropertyChanged;
- Element = null;
- }
-
- if (_tracker != null)
- {
- _tracker.Dispose();
- _tracker = null;
- }
-
- if (_events != null)
- {
- _events.Dispose();
- _events = null;
- }
-
- if (_masterController != null)
- {
- _masterController.WillAppear -= MasterControllerWillAppear;
- _masterController.WillDisappear -= MasterControllerWillDisappear;
- }
-
- _disposed = true;
+ if (!_disposed && disposing)
+ {
+ if (Element != null)
+ {
+ ((Page)Element).SendDisappearing();
+ Element.PropertyChanged -= HandlePropertyChanged;
+ Element = null;
+ }
+
+ if (_tracker != null)
+ {
+ _tracker.Dispose();
+ _tracker = null;
+ }
+
+ if (_events != null)
+ {
+ _events.Dispose();
+ _events = null;
+ }
+
+ if (_masterController != null)
+ {
+ _masterController.WillAppear -= MasterControllerWillAppear;
+ _masterController.WillDisappear -= MasterControllerWillDisappear;
+ }
+
+ _disposed = true;
+ }
+ base.Dispose(disposing);
}
public VisualElement Element { get; private set; }
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/WebViewRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/WebViewRenderer.cs
index 538bc2d0..0c6c639b 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/WebViewRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/WebViewRenderer.cs
@@ -19,8 +19,6 @@ namespace Xamarin.Forms.Platform.iOS
WebNavigationEvent _lastBackForwardEvent;
VisualElementPackager _packager;
- VisualElementTracker _tracker;
-
public WebViewRenderer() : base(RectangleF.Empty)
{
}
@@ -49,8 +47,6 @@ namespace Xamarin.Forms.Platform.iOS
AutosizesSubviews = true;
AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
- _tracker = new VisualElementTracker(this);
-
_packager = new VisualElementPackager(this);
_packager.Load();