diff options
author | nebkat <nebkat@teamhacksung.org> | 2012-11-30 19:41:34 +0000 |
---|---|---|
committer | nebkat <nebkat@teamhacksung.org> | 2012-12-01 21:55:43 +0000 |
commit | 9180c157cc84b76ee92d26d2ee4f199da4fc0038 (patch) | |
tree | 320b5552014dfb15bf000c15a728c02796bd8704 /src/com/cyanogenmod/trebuchet/Launcher.java | |
parent | e74a54343ce7896b5005154e8bcbc7d5f06c7808 (diff) | |
download | packages_apps_trebuchet-9180c157cc84b76ee92d26d2ee4f199da4fc0038.zip packages_apps_trebuchet-9180c157cc84b76ee92d26d2ee4f199da4fc0038.tar.gz packages_apps_trebuchet-9180c157cc84b76ee92d26d2ee4f199da4fc0038.tar.bz2 |
Wallpaper Hack
Normally the wallpaper is drawn by the system in a separate window.
This means that the wallpaper can often be drawn out of sync with
the launcher. This hack gets the wallpaper bitmap and draws it
manually (in sync with the rest of the launcher). This increases
performance greatly.
Change-Id: I6aaf9c574cabcf2ee0bfeef1076140421108331d
Diffstat (limited to 'src/com/cyanogenmod/trebuchet/Launcher.java')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/Launcher.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/cyanogenmod/trebuchet/Launcher.java b/src/com/cyanogenmod/trebuchet/Launcher.java index 9ef20c6..e5ef20e 100644 --- a/src/com/cyanogenmod/trebuchet/Launcher.java +++ b/src/com/cyanogenmod/trebuchet/Launcher.java @@ -311,6 +311,8 @@ public final class Launcher extends Activity private boolean mHideIconLabels; private boolean mAutoRotate; + private boolean mWallpaperVisible; + private Runnable mBuildLayersRunnable = new Runnable() { public void run() { if (mWorkspace != null) { @@ -772,6 +774,7 @@ public final class Launcher extends Activity // (framework issue). On resuming, we ensure that any widgets are inflated for the current // orientation. getWorkspace().reinflateWidgetsIfNecessary(); + getWorkspace().checkWallpaper(); // Again, as with the above scenario, it's possible that one or more of the global icons // were updated in the wrong orientation. @@ -1251,6 +1254,8 @@ public final class Launcher extends Activity } else if (Intent.ACTION_USER_PRESENT.equals(action)) { mUserPresent = true; updateRunning(); + } else if (Intent.ACTION_SET_WALLPAPER.equals(action)) { + mWorkspace.checkWallpaper(); } } }; @@ -1263,6 +1268,7 @@ public final class Launcher extends Activity final IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_SCREEN_OFF); filter.addAction(Intent.ACTION_USER_PRESENT); + filter.addAction(Intent.ACTION_SET_WALLPAPER); registerReceiver(mReceiver, filter); mAttached = true; @@ -2469,8 +2475,13 @@ public final class Launcher extends Activity } } + void setWallpaperVisibility(boolean visible) { + mWallpaperVisible = visible; + updateWallpaperVisibility(visible); + } + void updateWallpaperVisibility(boolean visible) { - int wpflags = visible ? WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER : 0; + int wpflags = visible && mWallpaperVisible ? WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER : 0; int curflags = getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER; if (wpflags != curflags) { |