Move handling of Fullscreen preference to CordovaActivity

Makes more sense here since that's where the other FullScreen related
changes are.
This commit is contained in:
Andrew Grieve 2014-07-04 12:11:19 -04:00
parent 79aa3e159d
commit 663a71255f
2 changed files with 5 additions and 23 deletions

View File

@ -213,12 +213,14 @@ public class CordovaActivity extends Activity implements CordovaInterface {
Log.d(TAG, "The SetFullscreen configuration is deprecated in favor of Fullscreen, and will be removed in a future version."); Log.d(TAG, "The SetFullscreen configuration is deprecated in favor of Fullscreen, and will be removed in a future version.");
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN); WindowManager.LayoutParams.FLAG_FULLSCREEN);
} } else if (this.getBooleanProperty("Fullscreen", false)) {
else getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
{ WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
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! // This builds the view. We could probably get away with NOT having a LinearLayout, but I like having a bucket!
Display display = getWindowManager().getDefaultDisplay(); Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth(); int width = display.getWidth();

View File

@ -49,7 +49,6 @@ import android.view.Gravity;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.webkit.WebBackForwardList; import android.webkit.WebBackForwardList;
import android.webkit.WebHistoryItem; import android.webkit.WebHistoryItem;
@ -138,7 +137,6 @@ public class CordovaWebView extends WebView {
{ {
Log.d(TAG, "Your activity must implement CordovaInterface to work"); Log.d(TAG, "Your activity must implement CordovaInterface to work");
} }
this.loadConfiguration();
this.setup(); this.setup();
} }
@ -160,7 +158,6 @@ public class CordovaWebView extends WebView {
} }
this.setWebChromeClient(new CordovaChromeClient(this.cordova, this)); this.setWebChromeClient(new CordovaChromeClient(this.cordova, this));
this.initWebViewClient(this.cordova); this.initWebViewClient(this.cordova);
this.loadConfiguration();
this.setup(); this.setup();
} }
@ -183,7 +180,6 @@ public class CordovaWebView extends WebView {
Log.d(TAG, "Your activity must implement CordovaInterface to work"); Log.d(TAG, "Your activity must implement CordovaInterface to work");
} }
this.setWebChromeClient(new CordovaChromeClient(this.cordova, this)); this.setWebChromeClient(new CordovaChromeClient(this.cordova, this));
this.loadConfiguration();
this.setup(); this.setup();
} }
@ -208,7 +204,6 @@ public class CordovaWebView extends WebView {
} }
this.setWebChromeClient(new CordovaChromeClient(this.cordova)); this.setWebChromeClient(new CordovaChromeClient(this.cordova));
this.initWebViewClient(this.cordova); this.initWebViewClient(this.cordova);
this.loadConfiguration();
this.setup(); this.setup();
} }
@ -654,21 +649,6 @@ public class CordovaWebView extends WebView {
} }
} }
/**
* Check configuration parameters from Config.
* Approved list of URLs that can be loaded into Cordova
* <access origin="http://server regexp" subdomains="true" />
* Log level: ERROR, WARN, INFO, DEBUG, VERBOSE (default=ERROR)
* <log level="DEBUG" />
*/
private void loadConfiguration() {
if ("true".equals(this.getProperty("Fullscreen", "false"))) {
this.cordova.getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
this.cordova.getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
}
/** /**
* Get string property for activity. * Get string property for activity.
* *