diff options
Diffstat (limited to 'Xamarin.Forms.ControlGallery.Android')
3 files changed, 25 insertions, 1 deletions
diff --git a/Xamarin.Forms.ControlGallery.Android/Activity1.cs b/Xamarin.Forms.ControlGallery.Android/Activity1.cs index ad3945ee..cfd8350f 100644 --- a/Xamarin.Forms.ControlGallery.Android/Activity1.cs +++ b/Xamarin.Forms.ControlGallery.Android/Activity1.cs @@ -21,7 +21,8 @@ using System.IO.IsolatedStorage; using Droid = Android; using System.Globalization; - +using Java.Interop; +using Xamarin.Forms.Controls.Issues; [assembly: Dependency (typeof (CacheService))] [assembly: Dependency (typeof (TestCloudService))] @@ -274,6 +275,12 @@ namespace Xamarin.Forms.ControlGallery.Android { base.OnDestroy(); } + + [Export("NavigateToTest")] + public bool NavigateToTest(string test) + { + return _app.NavigateToTestPage(test); + } } #else @@ -297,6 +304,8 @@ namespace Xamarin.Forms.ControlGallery.Android ] public class Activity1 : FormsAppCompatActivity { + App _app; + protected override void OnCreate (Bundle bundle) { ToolbarResource = Resource.Layout.Toolbar; @@ -319,6 +328,7 @@ namespace Xamarin.Forms.ControlGallery.Android //Forms.SetTitleBarVisibility (AndroidTitleBarVisibility.Never); var app = new App(); + _app = app; // When the native control gallery loads up, it'll let us know so we can add the nested native controls MessagingCenter.Subscribe<NestedNativeControlGalleryPage>(this, NestedNativeControlGalleryPage.ReadyForNativeControlsMessage, AddNativeControls); @@ -446,6 +456,18 @@ namespace Xamarin.Forms.ControlGallery.Android return null; } } + + [Export("NavigateToTest")] + public bool NavigateToTest(string test) + { + return _app.NavigateToTestPage(test); + } + + [Export("Reset")] + public void Reset() + { + _app.Reset(); + } } #endif } diff --git a/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs b/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs index 0530fc3c..86876a38 100644 --- a/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs +++ b/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs @@ -19,6 +19,7 @@ using AButton = Android.Widget.Button; using AView = Android.Views.View; using Android.OS; using System.Reflection; +using Xamarin.Forms.Controls.Issues; [assembly: ExportRenderer(typeof(Bugzilla31395.CustomContentView), typeof(CustomContentRenderer))] [assembly: ExportRenderer(typeof(NativeListView), typeof(NativeListViewRenderer))] diff --git a/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj b/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj index 199e16d6..32f92ecc 100644 --- a/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj +++ b/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj @@ -114,6 +114,7 @@ </PropertyGroup> <ItemGroup> <Reference Include="Mono.Android" /> + <Reference Include="Mono.Android.Export" /> <Reference Include="mscorlib" /> <Reference Include="System" /> <Reference Include="System.Core" /> |