summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/layout-land/launcher.xml1
-rw-r--r--res/layout-port/launcher.xml1
-rw-r--r--res/layout-sw720dp/launcher.xml1
-rw-r--r--src/com/android/launcher3/Launcher.java26
4 files changed, 20 insertions, 9 deletions
diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml
index f0f7bbb9f..113b319ff 100644
--- a/res/layout-land/launcher.xml
+++ b/res/layout-land/launcher.xml
@@ -21,7 +21,6 @@
android:id="@+id/launcher"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@drawable/workspace_bg"
android:fitsSystemWindows="true">
<com.android.launcher3.DragLayer
diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml
index 5a018c516..7202f7b32 100644
--- a/res/layout-port/launcher.xml
+++ b/res/layout-port/launcher.xml
@@ -22,7 +22,6 @@
android:id="@+id/launcher"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@drawable/workspace_bg"
android:fitsSystemWindows="true">
<com.android.launcher3.DragLayer
diff --git a/res/layout-sw720dp/launcher.xml b/res/layout-sw720dp/launcher.xml
index a9601af6a..8a9f3e913 100644
--- a/res/layout-sw720dp/launcher.xml
+++ b/res/layout-sw720dp/launcher.xml
@@ -22,7 +22,6 @@
android:id="@+id/launcher"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@drawable/workspace_bg"
android:fitsSystemWindows="true">
<com.android.launcher3.DragLayer
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 7b7b61795..d7282eb73 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -55,6 +55,7 @@ import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.Rect;
+import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.AsyncTask;
@@ -156,6 +157,10 @@ public class Launcher extends Activity
private static final int REQUEST_BIND_APPWIDGET = 11;
private static final int REQUEST_RECONFIGURE_APPWIDGET = 12;
+ private static final int WORKSPACE_BACKGROUND_GRADIENT = 0;
+ private static final int WORKSPACE_BACKGROUND_TRANSPARENT = 1;
+ private static final int WORKSPACE_BACKGROUND_BLACK = 2;
+
/**
* IntentStarter uses request codes starting with this. This must be greater than all activity
* request codes used internally.
@@ -1040,8 +1045,9 @@ public class Launcher extends Activity
}
}
- // Background was set to gradient in onPause(), restore to black if in all apps.
- setWorkspaceBackground(mState == State.WORKSPACE);
+ // Background was set to gradient in onPause(), restore to transparent if in all apps.
+ setWorkspaceBackground(mState == State.WORKSPACE ? WORKSPACE_BACKGROUND_TRANSPARENT
+ : WORKSPACE_BACKGROUND_GRADIENT);
mPaused = false;
if (mRestoring || mOnResumeNeedsLoad) {
@@ -3294,9 +3300,17 @@ public class Launcher extends Activity
return (mState == State.WIDGETS) || (mOnResumeState == State.WIDGETS);
}
- private void setWorkspaceBackground(boolean workspace) {
- mLauncherView.setBackground(workspace ?
- mWorkspaceBackgroundDrawable : null);
+ private void setWorkspaceBackground(int background) {
+ switch (background) {
+ case WORKSPACE_BACKGROUND_TRANSPARENT:
+ getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
+ break;
+ case WORKSPACE_BACKGROUND_BLACK:
+ getWindow().setBackgroundDrawable(null);
+ break;
+ default:
+ getWindow().setBackgroundDrawable(mWorkspaceBackgroundDrawable);
+ }
}
protected void changeWallpaperVisiblity(boolean visible) {
@@ -3306,7 +3320,7 @@ public class Launcher extends Activity
if (wpflags != curflags) {
getWindow().setFlags(wpflags, WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER);
}
- setWorkspaceBackground(visible);
+ setWorkspaceBackground(visible ? WORKSPACE_BACKGROUND_GRADIENT : WORKSPACE_BACKGROUND_BLACK);
}
@Override