summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornebkat <nebkat@teamhacksung.org>2012-12-19 10:56:53 -0800
committerGerrit Code Review <gerrit@review.cyanogenmod.com>2012-12-19 10:56:53 -0800
commit688654eb01ffd2887b4780162c030850fad48172 (patch)
treec9ee9f3d13c84ccb976c784b4b87bc2e7afaa361
parente5723bacbaa82488f5222c751a3e13c791592e32 (diff)
parent54c408226a92589fcd56c427e2e68e3dbce196dd (diff)
downloadpackages_apps_trebuchet-688654eb01ffd2887b4780162c030850fad48172.zip
packages_apps_trebuchet-688654eb01ffd2887b4780162c030850fad48172.tar.gz
packages_apps_trebuchet-688654eb01ffd2887b4780162c030850fad48172.tar.bz2
Merge "Launcher: Fullscreen Mode" into cm-10.1
-rw-r--r--res/values/strings.xml2
-rw-r--r--res/xml/preferences_general.xml3
-rw-r--r--src/com/cyanogenmod/trebuchet/Launcher.java36
-rw-r--r--src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java3
4 files changed, 23 insertions, 21 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index bfdad6b..2223fe3 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -371,4 +371,6 @@ s -->
<!-- General -->
<string name="preferences_interface_general_title">General</string>
<string name="preferences_interface_general_orientation_title">Auto-rotate screen</string>
+ <string name="preferences_interface_general_fullscreen_title">Fullscreen mode</string>
+ <string name="preferences_interface_general_fullscreen_summary">Hide the status bar to extend the homescreen</string>
</resources>
diff --git a/res/xml/preferences_general.xml b/res/xml/preferences_general.xml
index 1385bd2..abe0cf8 100644
--- a/res/xml/preferences_general.xml
+++ b/res/xml/preferences_general.xml
@@ -20,4 +20,7 @@
android:title="@string/preferences_interface_general_title">
<CheckBoxPreference android:key="ui_general_orientation"
android:title="@string/preferences_interface_general_orientation_title" />
+ <CheckBoxPreference android:key="ui_general_fullscreen"
+ android:title="@string/preferences_interface_general_fullscreen_title"
+ android:summary="@string/preferences_interface_general_fullscreen_summary" />
</PreferenceScreen> \ No newline at end of file
diff --git a/src/com/cyanogenmod/trebuchet/Launcher.java b/src/com/cyanogenmod/trebuchet/Launcher.java
index de47f77..28e4f0e 100644
--- a/src/com/cyanogenmod/trebuchet/Launcher.java
+++ b/src/com/cyanogenmod/trebuchet/Launcher.java
@@ -310,6 +310,7 @@ public final class Launcher extends Activity
private boolean mShowDockDivider;
private boolean mHideIconLabels;
private boolean mAutoRotate;
+ private boolean mFullscreenMode;
private boolean mWallpaperVisible;
@@ -389,6 +390,7 @@ public final class Launcher extends Activity
mShowDockDivider = PreferencesProvider.Interface.Dock.getShowDivider();
mHideIconLabels = PreferencesProvider.Interface.Homescreen.getHideIconLabels();
mAutoRotate = PreferencesProvider.Interface.General.getAutoRotate(getResources().getBoolean(R.bool.allow_rotation));
+ mFullscreenMode = PreferencesProvider.Interface.General.getFullscreenMode();
if (PROFILE_STARTUP) {
android.os.Debug.startMethodTracing(
@@ -807,27 +809,6 @@ public final class Launcher extends Activity
return Boolean.TRUE;
}
- // We can't hide the IME if it was forced open. So don't bother
- /*
- @Override
- public void onWindowFocusChanged(boolean hasFocus) {
- super.onWindowFocusChanged(hasFocus);
-
- if (hasFocus) {
- final InputMethodManager inputManager = (InputMethodManager)
- getSystemService(Context.INPUT_METHOD_SERVICE);
- WindowManager.LayoutParams lp = getWindow().getAttributes();
- inputManager.hideSoftInputFromWindow(lp.token, 0, new android.os.ResultReceiver(new
- android.os.Handler()) {
- protected void onReceiveResult(int resultCode, Bundle resultData) {
- Log.d(TAG, "ResultReceiver got resultCode=" + resultCode);
- }
- });
- Log.d(TAG, "called hideSoftInputFromWindow from onWindowFocusChanged");
- }
- }
- */
-
private boolean acceptFilter() {
final InputMethodManager inputManager = (InputMethodManager)
getSystemService(Context.INPUT_METHOD_SERVICE);
@@ -2492,6 +2473,15 @@ public final class Launcher extends Activity
}
}
+ private void updateFullscreenMode(boolean enable) {
+ int fsflags = enable ? WindowManager.LayoutParams.FLAG_FULLSCREEN : 0;
+ int curflags = getWindow().getAttributes().flags
+ & WindowManager.LayoutParams.FLAG_FULLSCREEN;
+ if (fsflags != curflags) {
+ getWindow().setFlags(fsflags, WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ }
+ }
+
private void dispatchOnLauncherTransitionPrepare(View v, boolean animated, boolean toWorkspace) {
if (v instanceof LauncherTransitionable) {
((LauncherTransitionable) v).onLauncherTransitionPrepare(this, animated, toWorkspace);
@@ -2868,6 +2858,10 @@ public final class Launcher extends Activity
disableWallpaperIfInAllApps();
}
}, 500);
+
+ if (mFullscreenMode) {
+ updateFullscreenMode(true);
+ }
}
}
diff --git a/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java b/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java
index 4146ebf..cf989f0 100644
--- a/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java
+++ b/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java
@@ -183,6 +183,9 @@ public final class PreferencesProvider {
public static boolean getAutoRotate(boolean def) {
return getBoolean("ui_general_orientation", def);
}
+ public static boolean getFullscreenMode() {
+ return getBoolean("ui_general_fullscreen", false);
+ }
}
}