-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ability to handle new open windows
- Loading branch information
Kolesnyk Sviatoslav
committed
Mar 21, 2017
1 parent
a1ffad7
commit 164863d
Showing
8 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
HybridWebControl.Droid/ControlRenderers/HybridWebView/WebPlatformNewWindowViewClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using Android.Webkit; | ||
|
||
namespace HybridWebControl.Droid | ||
{ | ||
public class WebPlatformNewWindowViewClient : WebViewClient | ||
{ | ||
Action<Uri> openExternalLink; | ||
|
||
public WebPlatformNewWindowViewClient(Action<Uri> openExternalLink) | ||
{ | ||
this.openExternalLink = openExternalLink; | ||
} | ||
|
||
public override bool ShouldOverrideUrlLoading(WebView view, string url) | ||
{ | ||
if (openExternalLink != null) | ||
{ | ||
openExternalLink(new Uri(url)); | ||
} | ||
view.Dispose(); | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters