Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/macdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremie Laval <jeremie.laval@gmail.com>2012-03-09 18:07:12 +0400
committerJeremie Laval <jeremie.laval@gmail.com>2012-03-09 18:14:49 +0400
commite0e1bdc47bf2dba28baad64318d8cd561ce9eb5c (patch)
treed1160b03dd7ba1efc245d80fdb084937ad660289 /MyDocument.cs
parent2c7768f0504fe3a0873dd317a7584e3caeac31ef (diff)
[macdoc] Implement swipe gesture for navigation
Diffstat (limited to 'MyDocument.cs')
-rw-r--r--MyDocument.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/MyDocument.cs b/MyDocument.cs
index f125a23..67507f0 100644
--- a/MyDocument.cs
+++ b/MyDocument.cs
@@ -77,6 +77,12 @@ namespace macdoc
SetupBookmarks ();
webView.DecidePolicyForNavigation += HandleWebViewDecidePolicyForNavigation;
webView.FinishedLoad += HandleWebViewFinishedLoad;
+ ((WebViewExtraordinaire)webView).SwipeEvent += (sender, e) => {
+ if (e.Side == SwipeSide.Left && history.BackClicked ())
+ navigationCells.SetSelected (true, 0);
+ else if (history.ForwardClicked ())
+ navigationCells.SetSelected (true, 1);
+ };
HideMultipleMatches ();
if (!string.IsNullOrEmpty (initialLoadFromUrl))
LoadUrl (initialLoadFromUrl);
@@ -398,6 +404,8 @@ namespace macdoc
ShowNode (match);
match = null;
}
+ if (navigationCells.SelectedSegment != -1)
+ navigationCells.SetSelected (false, navigationCells.SelectedSegment);
var dom = e.ForFrame.DomDocument;
// Update the title of the current page