incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [44/50] git commit: Backbutton should go back in appview history before going back in our history stack.
Date Tue, 03 Jan 2012 18:57:11 GMT
Backbutton should go back in appview history before going back in our history stack.

JQMobile uses htmlPage#div to navigate "multipage" apps.  When the webview navigates between
tags in the same page, it is added to the webview history.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/fd93404c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/fd93404c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/fd93404c

Branch: refs/heads/master
Commit: fd93404c7c9860194f394361ca83cd0efb5af382
Parents: e9fcb29
Author: Bryce Curtis <curtis.bryce@gmail.com>
Authored: Wed Nov 9 09:14:13 2011 -0600
Committer: Bryce Curtis <curtis.bryce@gmail.com>
Committed: Wed Nov 9 09:14:13 2011 -0600

----------------------------------------------------------------------
 framework/src/com/phonegap/DroidGap.java |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/fd93404c/framework/src/com/phonegap/DroidGap.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/DroidGap.java b/framework/src/com/phonegap/DroidGap.java
index 3db2518..1d8017d 100755
--- a/framework/src/com/phonegap/DroidGap.java
+++ b/framework/src/com/phonegap/DroidGap.java
@@ -1450,7 +1450,11 @@ public class DroidGap extends PhonegapActivity {
             else {
 
                 // Go to previous page in webview if it is possible to go back
-                if (this.urls.size() > 1) {
+                if (this.appView.canGoBack()) {
+                    this.appView.goBack();  // This is needed to support curPage#diffLink,
since they are added to appView's history, but not our history url array (JQMobile behavior)
+                    return true;
+                }
+                else if (this.urls.size() > 1) {
                     this.backHistory();
                     return true;
                 }


Mime
View raw message