Updating the history configuration. We can switch between histories

This commit is contained in:
Joe Bowser 2012-05-08 13:58:24 -07:00
parent 8ab1733374
commit 4ce585be02
2 changed files with 13 additions and 14 deletions

View File

@ -203,9 +203,12 @@ public class CordovaWebViewClient extends WebViewClient {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
// Clear history so history.back() doesn't do anything.
// So we can reinit() native side CallbackServer & PluginManager.
view.clearHistory();
this.doClearHistory = true;
// So we can reinit() native side CallbackServer & PluginManager.\
if(!appView.useBrowserHistory)
{
view.clearHistory();
this.doClearHistory = true;
}
}
/**

View File

@ -225,16 +225,9 @@ public class DroidGap extends Activity implements CordovaInterface {
getWindow().requestFeature(Window.FEATURE_NO_TITLE);
if (preferences.prefMatches("fullscreen","true")) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else if(preferences.prefMatches("useBrowserHistory", "true")) {
useBrowserHistory = true;
} else {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
}
// This builds the view. We could probably get away with NOT having a LinearLayout, but I like having a bucket!
Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
@ -283,7 +276,11 @@ public class DroidGap extends Activity implements CordovaInterface {
// white list of allowed URLs
// debug setting
this.loadConfiguration();
//Now we can check the preference
appView.useBrowserHistory = preferences.prefMatches("useBrowserHistory", "true");
//
this.appView.setLayoutParams(new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT,
@ -291,7 +288,6 @@ public class DroidGap extends Activity implements CordovaInterface {
// Add web view but make it invisible while loading URL
this.appView.setVisibility(View.INVISIBLE);
this.appView.useBrowserHistory = useBrowserHistory;
root.addView(this.appView);
setContentView(root);