Skip to content

Commit

Permalink
Merge pull request #513 from Esri/thad/forms-remove-pagerenderers
Browse files Browse the repository at this point in the history
Remove the custom page renderers from the Xamarin Forms projects.
  • Loading branch information
ThadT committed Aug 8, 2018
2 parents 46c7e22 + 5c7bf18 commit 3a14a0a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 235 deletions.
Expand Up @@ -91,7 +91,6 @@
<ItemGroup>
<!-- Sample Manager Code -->
<Compile Include="MainActivity.cs" />
<Compile Include="PageRenderer\SaveMapPageRenderer.cs" />
<Compile Include="Resources\Resource.Designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Expand Down
115 changes: 0 additions & 115 deletions src/Forms/Android/PageRenderer/SaveMapPageRenderer.cs

This file was deleted.

15 changes: 7 additions & 8 deletions src/Forms/Shared/Samples/Map/AuthorMap/AuthorMap.xaml.cs
Expand Up @@ -178,8 +178,6 @@ private async void ShowSaveMapUI(object sender, EventArgs e)
mapInputForm.OnSaveClicked += SaveMapAsync;

// Navigate to the SaveMapPage UI
// Note: in each platform's project, there is a custom PageRenderer class called SaveMapPage that provides
// platform-specific logic to challenge the user for OAuth credentials for ArcGIS Online when the page launches
await Navigation.PushAsync(mapInputForm);
}

Expand Down Expand Up @@ -412,10 +410,6 @@ public async Task<Credential> CreateCredentialAsync(CredentialRequestInfo info)
#if __ANDROID__
// Get the current Android Activity
Activity activity = (Activity)ArcGISRuntime.Droid.MainActivity.Instance;
#endif
#if __IOS__
// Get the current iOS ViewController
var viewController = Xamarin.Forms.Platform.iOS.Platform.GetRenderer(this).ViewController;
#endif
// Create a new Xamarin.Auth.OAuth2Authenticator using the information passed in
Xamarin.Auth.OAuth2Authenticator authenticator = new Xamarin.Auth.OAuth2Authenticator(
Expand All @@ -437,7 +431,11 @@ public async Task<Credential> CreateCredentialAsync(CredentialRequestInfo info)
{
#if __IOS__
// Dismiss the OAuth UI when complete
viewController.DismissViewController(true, null);
Device.BeginInvokeOnMainThread(() =>
{
var viewController = UIApplication.SharedApplication.KeyWindow.RootViewController;
viewController.DismissViewController(true, null);
});
#endif
// Check if the user is authenticated
Expand Down Expand Up @@ -504,6 +502,7 @@ public async Task<Credential> CreateCredentialAsync(CredentialRequestInfo info)
// Present the OAuth UI (on the app's UI thread) so the user can enter user name and password
Device.BeginInvokeOnMainThread(() =>
{
var viewController = UIApplication.SharedApplication.KeyWindow.RootViewController;
viewController.PresentViewController(authenticator.GetUI(), true, null);
});
#endif
Expand All @@ -516,4 +515,4 @@ public async Task<Credential> CreateCredentialAsync(CredentialRequestInfo info)
#endregion

}
}
}
1 change: 0 additions & 1 deletion src/Forms/iOS/ArcGISRuntime.Xamarin.Forms.iOS.csproj
Expand Up @@ -176,7 +176,6 @@
<!-- Sample Manager Code -->
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<Compile Include="PageRenderer\SaveMapPageRenderer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
110 changes: 0 additions & 110 deletions src/Forms/iOS/PageRenderer/SaveMapPageRenderer.cs

This file was deleted.

0 comments on commit 3a14a0a

Please sign in to comment.