summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui/BitmapScreenNail.java
diff options
context:
space:
mode:
authorBobby Georgescu <georgescu@google.com>2012-08-23 13:05:53 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-08-24 17:12:44 -0700
commit93d87ff509cabdad9f02f379df7eba01a44969c7 (patch)
tree1252bcd153ffff5f94f2b4608872a950c6fb21de /src/com/android/gallery3d/ui/BitmapScreenNail.java
parent0b6bca8513ae49dacbfdbd9c800ba9f542b6b68b (diff)
downloadandroid_packages_apps_Snap-93d87ff509cabdad9f02f379df7eba01a44969c7.tar.gz
android_packages_apps_Snap-93d87ff509cabdad9f02f379df7eba01a44969c7.tar.bz2
android_packages_apps_Snap-93d87ff509cabdad9f02f379df7eba01a44969c7.zip
Ongoing reskin of Gallery app
Bug: 7050303 Moved the majority of color settings from hardcoded to colors.xml in order to allow rapid iteration with UX input. Started changing some colors and layouts to reflect latest UX mocks. Change-Id: I300338e9f75c71f3ed3f36140d16e893387f3184
Diffstat (limited to 'src/com/android/gallery3d/ui/BitmapScreenNail.java')
-rw-r--r--src/com/android/gallery3d/ui/BitmapScreenNail.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/com/android/gallery3d/ui/BitmapScreenNail.java b/src/com/android/gallery3d/ui/BitmapScreenNail.java
index 57685e8e5..6fbcf0137 100644
--- a/src/com/android/gallery3d/ui/BitmapScreenNail.java
+++ b/src/com/android/gallery3d/ui/BitmapScreenNail.java
@@ -33,10 +33,9 @@ import com.android.gallery3d.data.MediaItem;
public class BitmapScreenNail implements ScreenNail {
@SuppressWarnings("unused")
private static final String TAG = "BitmapScreenNail";
- private static final int PLACEHOLDER_COLOR = 0xFF222222;
+
// The duration of the fading animation in milliseconds
private static final int DURATION = 180;
- private static boolean mDrawPlaceholder = true;
private static final int MAX_SIDE = 640;
@@ -63,6 +62,15 @@ public class BitmapScreenNail implements ScreenNail {
setSize(width, height);
}
+ // This gets overridden by bitmap_screennail_placeholder
+ // in GalleryUtils.initialize
+ private static int mPlaceholderColor = 0xFF222222;
+ private static boolean mDrawPlaceholder = true;
+
+ public static void setPlaceholderColor(int color) {
+ mPlaceholderColor = color;
+ }
+
private void setSize(int width, int height) {
if (width == 0 || height == 0) {
width = 640;
@@ -155,7 +163,7 @@ public class BitmapScreenNail implements ScreenNail {
mAnimationStartTime = ANIMATION_NEEDED;
}
if(mDrawPlaceholder) {
- canvas.fillRect(x, y, width, height, PLACEHOLDER_COLOR);
+ canvas.fillRect(x, y, width, height, mPlaceholderColor);
}
return;
}
@@ -169,7 +177,7 @@ public class BitmapScreenNail implements ScreenNail {
}
if (isAnimating()) {
- canvas.drawMixed(mTexture, PLACEHOLDER_COLOR, getRatio(), x, y,
+ canvas.drawMixed(mTexture, mPlaceholderColor, getRatio(), x, y,
width, height);
} else {
mTexture.draw(canvas, x, y, width, height);
@@ -180,7 +188,7 @@ public class BitmapScreenNail implements ScreenNail {
public void draw(GLCanvas canvas, RectF source, RectF dest) {
if (mBitmap == null) {
canvas.fillRect(dest.left, dest.top, dest.width(), dest.height(),
- PLACEHOLDER_COLOR);
+ mPlaceholderColor);
return;
}