diff options
-rw-r--r-- | res/values/strings.xml | 5 | ||||
-rw-r--r-- | res/xml/lab_preferences.xml | 5 | ||||
-rw-r--r-- | src/com/android/browser/BaseUi.java | 12 | ||||
-rw-r--r-- | src/com/android/browser/BrowserSettings.java | 9 | ||||
-rw-r--r-- | src/com/android/browser/PreferenceKeys.java | 1 | ||||
-rw-r--r-- | src/com/android/browser/UI.java | 2 |
6 files changed, 34 insertions, 0 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 614e37e..f3631d2 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -655,6 +655,11 @@ <string name="pref_use_instant_search_summary"> Use Google Instant when you use Google Search, to show results as you type (this can increase data use).</string> + <string name="pref_lab_fullscreen">Fullscreen</string> + <!-- Summary for the fullscreen lab feature [CHAR LIMIT=120] --> + <string name="pref_lab_fullscreen_summary"> + Use fullscreen mode to hide the status bar.</string> + <!-- Title for a dialog displayed when the browser has a data connectivity problem --> <string name="browserFrameNetworkErrorLabel">Data connectivity problem</string> diff --git a/res/xml/lab_preferences.xml b/res/xml/lab_preferences.xml index b33052f..ee00463 100644 --- a/res/xml/lab_preferences.xml +++ b/res/xml/lab_preferences.xml @@ -26,4 +26,9 @@ android:defaultValue="false" android:title="@string/pref_lab_most_visited_homepage" android:summary="@string/pref_lab_most_visited_homepage_summary" /> + <CheckBoxPreference + android:key="fullscreen" + android:defaultValue="false" + android:title="@string/pref_lab_fullscreen" + android:summary="@string/pref_lab_fullscreen_summary" /> </PreferenceScreen> diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java index 5bb4c1f..e2e313e 100644 --- a/src/com/android/browser/BaseUi.java +++ b/src/com/android/browser/BaseUi.java @@ -116,6 +116,7 @@ public abstract class BaseUi implements UI, WebViewFactory { mCustomViewContainer = (FrameLayout) mBrowserFrameLayout .findViewById(R.id.fullscreen_custom_content); frameLayout.addView(mBrowserFrameLayout, COVER_SCREEN_PARAMS); + setFullscreen(BrowserSettings.getInstance().useFullscreen()); } @Override @@ -783,4 +784,15 @@ public abstract class BaseUi implements UI, WebViewFactory { return menu; } + public void setFullscreen(boolean enabled) { + if (enabled) { + mActivity.getWindow().setFlags( + WindowManager.LayoutParams.FLAG_FULLSCREEN, + WindowManager.LayoutParams.FLAG_FULLSCREEN); + } else { + mActivity.getWindow().clearFlags( + WindowManager.LayoutParams.FLAG_FULLSCREEN); + } + } + } diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java index e0e7bc4..7d64cfc 100644 --- a/src/com/android/browser/BrowserSettings.java +++ b/src/com/android/browser/BrowserSettings.java @@ -227,6 +227,11 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener, if (PREF_USE_INSTANT_SEARCH.equals(key)) { updateSearchEngine(true); } + if (PREF_FULLSCREEN.equals(key)) { + if (mController.getUi() != null) { + mController.getUi().setFullscreen(useFullscreen()); + } + } } static String getFactoryResetHomeUrl(Context context) { @@ -569,6 +574,10 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener, return mPrefs.getBoolean(PREF_USE_INSTANT_SEARCH, false); } + public boolean useFullscreen() { + return mPrefs.getBoolean(PREF_FULLSCREEN, false); + } + // ----------------------------- // getter/setters for privacy_security_preferences.xml // ----------------------------- diff --git a/src/com/android/browser/PreferenceKeys.java b/src/com/android/browser/PreferenceKeys.java index 7976869..f7230df 100644 --- a/src/com/android/browser/PreferenceKeys.java +++ b/src/com/android/browser/PreferenceKeys.java @@ -77,6 +77,7 @@ public interface PreferenceKeys { static final String PREF_ENABLE_QUICK_CONTROLS = "enable_quick_controls"; static final String PREF_USE_MOST_VISITED_HOMEPAGE = "use_most_visited_homepage"; static final String PREF_USE_INSTANT_SEARCH = "use_instant_search"; + static final String PREF_FULLSCREEN = "fullscreen"; // ---------------------- // Keys for privacy_security_preferences.xml diff --git a/src/com/android/browser/UI.java b/src/com/android/browser/UI.java index 40fc14a..bb34ada 100644 --- a/src/com/android/browser/UI.java +++ b/src/com/android/browser/UI.java @@ -132,4 +132,6 @@ public interface UI { void showAutoLogin(Tab tab); void hideAutoLogin(Tab tab); + + void setFullscreen(boolean enabled); } |