summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android/Renderers
diff options
context:
space:
mode:
authorkingces95 <kingces95@users.noreply.github.com>2017-03-07 19:56:24 (GMT)
committerGitHub <noreply@github.com>2017-03-07 19:56:24 (GMT)
commite6d5186c8acbf37b877c7ca3c77a378352a3743d (patch)
treed61ca8ea619f7844e9e0a973dbd7bac794e39147 /Xamarin.Forms.Platform.Android/Renderers
parent2b92142ab2a501de71d3572efc0e5deb2b7bae9a (diff)
downloadxamarin-forms-e6d5186c8acbf37b877c7ca3c77a378352a3743d.zip
xamarin-forms-e6d5186c8acbf37b877c7ca3c77a378352a3743d.tar.gz
xamarin-forms-e6d5186c8acbf37b877c7ca3c77a378352a3743d.tar.bz2
Remove InternalsVisibleTo from Core to XF.Platforms.* (#782)
* Remove InternalsVisibleTo from Core to XF.Platforms.* * Changes per Jason's code review * Move LockableObservableListWrapper to internals namespace * Changes per Stephane's code review * update docs * Touch code to get CI to run tests * Rebase; Update documentation
Diffstat (limited to 'Xamarin.Forms.Platform.Android/Renderers')
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/ActionSheetRenderer.cs1
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/CarouselPageAdapter.cs1
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/FontExtensions.cs1
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/ImageRenderer.cs3
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/KeyboardExtensions.cs1
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/MasterDetailContainer.cs1
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/NavigationMenuRenderer.cs5
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/WebViewRenderer.cs32
8 files changed, 29 insertions, 16 deletions
diff --git a/Xamarin.Forms.Platform.Android/Renderers/ActionSheetRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/ActionSheetRenderer.cs
index 8495d80..8c937f4 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/ActionSheetRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/ActionSheetRenderer.cs
@@ -6,6 +6,7 @@ using Android.Views;
using Android.Widget;
using AButton = Android.Widget.Button;
using AView = Android.Views.View;
+using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Platform.Android
{
diff --git a/Xamarin.Forms.Platform.Android/Renderers/CarouselPageAdapter.cs b/Xamarin.Forms.Platform.Android/Renderers/CarouselPageAdapter.cs
index b7e98ba..efee571 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/CarouselPageAdapter.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/CarouselPageAdapter.cs
@@ -4,6 +4,7 @@ using System.Linq;
using Android.Content;
using Android.Support.V4.View;
using Android.Views;
+using Xamarin.Forms.Internals;
using Object = Java.Lang.Object;
namespace Xamarin.Forms.Platform.Android
diff --git a/Xamarin.Forms.Platform.Android/Renderers/FontExtensions.cs b/Xamarin.Forms.Platform.Android/Renderers/FontExtensions.cs
index 981065b..75238a3 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/FontExtensions.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/FontExtensions.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Text.RegularExpressions;
using Android.Graphics;
using AApplication = Android.App.Application;
+using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Platform.Android
{
diff --git a/Xamarin.Forms.Platform.Android/Renderers/ImageRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/ImageRenderer.cs
index fe91d58..e18d4b9 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/ImageRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/ImageRenderer.cs
@@ -4,6 +4,7 @@ using System.IO;
using System.Threading.Tasks;
using Android.Graphics;
using AImageView = Android.Widget.ImageView;
+using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Platform.Android
{
@@ -82,7 +83,7 @@ namespace Xamarin.Forms.Platform.Android
Bitmap bitmap = null;
IImageSourceHandler handler;
- if (source != null && (handler = Registrar.Registered.GetHandler<IImageSourceHandler>(source.GetType())) != null)
+ if (source != null && (handler = Internals.Registrar.Registered.GetHandler<IImageSourceHandler>(source.GetType())) != null)
{
try
{
diff --git a/Xamarin.Forms.Platform.Android/Renderers/KeyboardExtensions.cs b/Xamarin.Forms.Platform.Android/Renderers/KeyboardExtensions.cs
index 6941422..9a22e64 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/KeyboardExtensions.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/KeyboardExtensions.cs
@@ -1,4 +1,5 @@
using Android.Text;
+using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Platform.Android
{
diff --git a/Xamarin.Forms.Platform.Android/Renderers/MasterDetailContainer.cs b/Xamarin.Forms.Platform.Android/Renderers/MasterDetailContainer.cs
index 7e28392..a7bebf1 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/MasterDetailContainer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/MasterDetailContainer.cs
@@ -5,6 +5,7 @@ using Android.Content.Res;
using Android.Runtime;
using Android.Views;
using Android.Widget;
+using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Platform.Android
{
diff --git a/Xamarin.Forms.Platform.Android/Renderers/NavigationMenuRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/NavigationMenuRenderer.cs
index c7e45ad..ea43a43 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/NavigationMenuRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/NavigationMenuRenderer.cs
@@ -6,6 +6,7 @@ using Android.Graphics;
using Android.Views;
using Android.Widget;
using AView = Android.Views.View;
+using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Platform.Android
{
@@ -115,6 +116,8 @@ namespace Xamarin.Forms.Platform.Android
{
readonly NavigationMenu _menu;
+ INavigationMenuController MenuController => _menu;
+
public MenuAdapter(NavigationMenu menu)
{
_menu = menu;
@@ -135,7 +138,7 @@ namespace Xamarin.Forms.Platform.Android
Page item = this[position];
menuItem.Icon = item.Icon;
menuItem.Name = item.Title;
- menuItem.OnSelected = () => _menu.SendTargetSelected(item);
+ menuItem.OnSelected = () => MenuController.SendTargetSelected(item);
return menuItem;
}
diff --git a/Xamarin.Forms.Platform.Android/Renderers/WebViewRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/WebViewRenderer.cs
index 8efc41e..9e49a90 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/WebViewRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/WebViewRenderer.cs
@@ -12,6 +12,8 @@ namespace Xamarin.Forms.Platform.Android
bool _ignoreSourceChanges;
FormsWebChromeClient _webChromeClient;
+ IWebViewController ElementController => Element;
+
public WebViewRenderer()
{
AutoPackage = false;
@@ -35,9 +37,9 @@ namespace Xamarin.Forms.Platform.Android
{
if (Control != null)
Control.StopLoading();
- Element.EvalRequested -= OnEvalRequested;
- Element.GoBackRequested -= OnGoBackRequested;
- Element.GoForwardRequested -= OnGoForwardRequested;
+ ElementController.EvalRequested -= OnEvalRequested;
+ ElementController.GoBackRequested -= OnGoBackRequested;
+ ElementController.GoForwardRequested -= OnGoForwardRequested;
_webChromeClient?.Dispose();
}
@@ -84,16 +86,18 @@ namespace Xamarin.Forms.Platform.Android
if (e.OldElement != null)
{
- e.OldElement.EvalRequested -= OnEvalRequested;
- e.OldElement.GoBackRequested -= OnGoBackRequested;
- e.OldElement.GoForwardRequested -= OnGoForwardRequested;
+ var oldElementController = e.OldElement as IWebViewController;
+ oldElementController.EvalRequested -= OnEvalRequested;
+ oldElementController.GoBackRequested -= OnGoBackRequested;
+ oldElementController.GoForwardRequested -= OnGoForwardRequested;
}
if (e.NewElement != null)
{
- e.NewElement.EvalRequested += OnEvalRequested;
- e.NewElement.GoBackRequested += OnGoBackRequested;
- e.NewElement.GoForwardRequested += OnGoForwardRequested;
+ var newElementController = e.NewElement as IWebViewController;
+ newElementController.EvalRequested += OnEvalRequested;
+ newElementController.GoBackRequested += OnGoBackRequested;
+ newElementController.GoForwardRequested += OnGoForwardRequested;
}
Load();
@@ -147,8 +151,8 @@ namespace Xamarin.Forms.Platform.Android
{
if (Element == null || Control == null)
return;
- Element.CanGoBack = Control.CanGoBack();
- Element.CanGoForward = Control.CanGoForward();
+ ElementController.CanGoBack = Control.CanGoBack();
+ ElementController.CanGoForward = Control.CanGoForward();
}
class WebClient : WebViewClient
@@ -170,12 +174,12 @@ namespace Xamarin.Forms.Platform.Android
var source = new UrlWebViewSource { Url = url };
_renderer._ignoreSourceChanges = true;
- ((IElementController)_renderer.Element).SetValueFromRenderer(WebView.SourceProperty, source);
+ _renderer.ElementController.SetValueFromRenderer(WebView.SourceProperty, source);
_renderer._ignoreSourceChanges = false;
var args = new WebNavigatedEventArgs(WebNavigationEvent.NewPage, source, url, _navigationResult);
- _renderer.Element.SendNavigated(args);
+ _renderer.ElementController.SendNavigated(args);
_renderer.UpdateCanGoBackForward();
@@ -209,7 +213,7 @@ namespace Xamarin.Forms.Platform.Android
var args = new WebNavigatingEventArgs(WebNavigationEvent.NewPage, new UrlWebViewSource { Url = url }, url);
- _renderer.Element.SendNavigating(args);
+ _renderer.ElementController.SendNavigating(args);
_navigationResult = WebNavigationResult.Success;
_renderer.UpdateCanGoBackForward();