diff options
author | Chih-Chung Chang <chihchung@google.com> | 2012-02-17 02:25:23 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2012-02-17 02:26:19 +0800 |
commit | ed0e84d75ed4f75ac9589bb3ea04b7327f8745f2 (patch) | |
tree | 7b166f00292242a38924609dff11a8dd39816123 | |
parent | 5b01ee731c6acbcef657746a23d5cfde2251ab7e (diff) | |
download | android_packages_apps_Snap-ed0e84d75ed4f75ac9589bb3ea04b7327f8745f2.tar.gz android_packages_apps_Snap-ed0e84d75ed4f75ac9589bb3ea04b7327f8745f2.tar.bz2 android_packages_apps_Snap-ed0e84d75ed4f75ac9589bb3ea04b7327f8745f2.zip |
Change from fillRect to clearBuffer for pure black background.
Change-Id: Ie3da19b377f3e7926ab37c5936ce48cbb3227f92
-rw-r--r-- | src/com/android/gallery3d/app/AlbumPage.java | 13 | ||||
-rw-r--r-- | src/com/android/gallery3d/app/AlbumSetPage.java | 13 | ||||
-rw-r--r-- | src/com/android/gallery3d/app/ManageCachePage.java | 11 | ||||
-rw-r--r-- | src/com/android/gallery3d/ui/StaticBackground.java | 3 |
4 files changed, 16 insertions, 24 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java index 120519da0..22b189999 100644 --- a/src/com/android/gallery3d/app/AlbumPage.java +++ b/src/com/android/gallery3d/app/AlbumPage.java @@ -52,7 +52,6 @@ import com.android.gallery3d.ui.PositionRepository; import com.android.gallery3d.ui.PositionRepository.Position; import com.android.gallery3d.ui.SelectionManager; import com.android.gallery3d.ui.SlotView; -import com.android.gallery3d.ui.StaticBackground; import com.android.gallery3d.util.Future; import com.android.gallery3d.util.GalleryUtils; @@ -78,7 +77,6 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster private static final float USER_DISTANCE_METER = 0.3f; private boolean mIsActive = false; - private StaticBackground mStaticBackground; private AlbumView mAlbumView; private Path mMediaSetPath; @@ -110,9 +108,13 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster private final float mMatrix[] = new float[16]; @Override + protected void renderBackground(GLCanvas view) { + view.clearBuffer(); + } + + @Override protected void onLayout( boolean changed, int left, int top, int right, int bottom) { - mStaticBackground.layout(0, 0, right - left, bottom - top); int slotViewTop = GalleryActionBar.getHeight((Activity) mActivity); int slotViewBottom = bottom - top; @@ -364,9 +366,6 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster } private void initializeViews() { - mStaticBackground = new StaticBackground((Context) mActivity); - mRootPane.addComponent(mStaticBackground); - mSelectionManager = new SelectionManager(mActivity, false); mSelectionManager.setSelectionListener(this); mGridDrawer = new GridDrawer((Context) mActivity, mSelectionManager); @@ -402,8 +401,6 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster return onItemSelected(item); } }); - mStaticBackground.setImage(R.drawable.background, - R.drawable.background_portrait); } private void initializeData(Bundle data) { diff --git a/src/com/android/gallery3d/app/AlbumSetPage.java b/src/com/android/gallery3d/app/AlbumSetPage.java index be70d3c9c..118b7d5aa 100644 --- a/src/com/android/gallery3d/app/AlbumSetPage.java +++ b/src/com/android/gallery3d/app/AlbumSetPage.java @@ -52,7 +52,6 @@ import com.android.gallery3d.ui.PositionRepository; import com.android.gallery3d.ui.PositionRepository.Position; import com.android.gallery3d.ui.SelectionManager; import com.android.gallery3d.ui.SlotView; -import com.android.gallery3d.ui.StaticBackground; import com.android.gallery3d.util.Future; import com.android.gallery3d.util.GalleryUtils; @@ -74,7 +73,6 @@ public class AlbumSetPage extends ActivityState implements private static final int BIT_LOADING_SYNC = 2; private boolean mIsActive = false; - private StaticBackground mStaticBackground; private AlbumSetView mAlbumSetView; private MediaSet mMediaSet; @@ -113,9 +111,13 @@ public class AlbumSetPage extends ActivityState implements private final float mMatrix[] = new float[16]; @Override + protected void renderBackground(GLCanvas view) { + view.clearBuffer(); + } + + @Override protected void onLayout( boolean changed, int left, int top, int right, int bottom) { - mStaticBackground.layout(0, 0, right - left, bottom - top); mEyePosition.resetPosition(); int slotViewTop = GalleryActionBar.getHeight((Activity) mActivity); @@ -369,8 +371,6 @@ public class AlbumSetPage extends ActivityState implements private void initializeViews() { mSelectionManager = new SelectionManager(mActivity, true); mSelectionManager.setSelectionListener(this); - mStaticBackground = new StaticBackground(mActivity.getAndroidContext()); - mRootPane.addComponent(mStaticBackground); mGridDrawer = new GridDrawer((Context) mActivity, mSelectionManager); Config.AlbumSetPage config = Config.AlbumSetPage.get((Context) mActivity); @@ -405,9 +405,6 @@ public class AlbumSetPage extends ActivityState implements } }); mRootPane.addComponent(mAlbumSetView); - - mStaticBackground.setImage(R.drawable.background, - R.drawable.background_portrait); } @Override diff --git a/src/com/android/gallery3d/app/ManageCachePage.java b/src/com/android/gallery3d/app/ManageCachePage.java index 27f92e42d..225323636 100644 --- a/src/com/android/gallery3d/app/ManageCachePage.java +++ b/src/com/android/gallery3d/app/ManageCachePage.java @@ -30,7 +30,6 @@ import com.android.gallery3d.ui.MenuExecutor; import com.android.gallery3d.ui.SelectionDrawer; import com.android.gallery3d.ui.SelectionManager; import com.android.gallery3d.ui.SlotView; -import com.android.gallery3d.ui.StaticBackground; import com.android.gallery3d.ui.SynchronizedHandler; import com.android.gallery3d.util.Future; import com.android.gallery3d.util.GalleryUtils; @@ -67,7 +66,6 @@ public class ManageCachePage extends ActivityState implements private static final int MSG_REQUEST_LAYOUT = 2; private static final int PROGRESS_BAR_MAX = 10000; - private StaticBackground mStaticBackground; private AlbumSetView mAlbumSetView; private MediaSet mMediaSet; @@ -96,6 +94,11 @@ public class ManageCachePage extends ActivityState implements private float mMatrix[] = new float[16]; @Override + protected void renderBackground(GLCanvas view) { + view.clearBuffer(); + } + + @Override protected void onLayout( boolean changed, int left, int top, int right, int bottom) { // Hack: our layout depends on other components on the screen. @@ -107,7 +110,6 @@ public class ManageCachePage extends ActivityState implements } mLayoutReady = false; - mStaticBackground.layout(0, 0, right - left, bottom - top); mEyePosition.resetPosition(); Activity activity = (Activity) mActivity; int slotViewTop = GalleryActionBar.getHeight(activity); @@ -288,8 +290,6 @@ public class ManageCachePage extends ActivityState implements mSelectionManager = new SelectionManager(mActivity, true); mSelectionManager.setSelectionListener(this); - mStaticBackground = new StaticBackground(activity); - mRootPane.addComponent(mStaticBackground); Config.ManageCachePage config = Config.ManageCachePage.get(activity); mSelectionDrawer = new ManageCacheDrawer((Context) mActivity, @@ -324,7 +324,6 @@ public class ManageCachePage extends ActivityState implements mFooterContent = inflater.inflate(R.layout.manage_offline_bar, null); mFooterContent.findViewById(R.id.done).setOnClickListener(this); - mStaticBackground.setImage(R.drawable.background, R.drawable.background_portrait); refreshCacheStorageInfo(); } diff --git a/src/com/android/gallery3d/ui/StaticBackground.java b/src/com/android/gallery3d/ui/StaticBackground.java index 08c55c378..e7fd003f2 100644 --- a/src/com/android/gallery3d/ui/StaticBackground.java +++ b/src/com/android/gallery3d/ui/StaticBackground.java @@ -56,7 +56,6 @@ public class StaticBackground extends GLView { @Override protected void render(GLCanvas canvas) { - //mBackground.draw(canvas, 0, 0, getWidth(), getHeight()); - canvas.fillRect(0, 0, getWidth(), getHeight(), 0xFF000000); + mBackground.draw(canvas, 0, 0, getWidth(), getHeight()); } } |