diff options
author | Bobby Georgescu <georgescu@google.com> | 2012-10-05 15:37:40 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-05 15:37:41 -0700 |
commit | 10e960f7d6c940cf6db327d2f68effc441e60ddb (patch) | |
tree | 75eed6bac9e0e450cf708ccf011899ce6a30fa06 /src/com/android/gallery3d/ui | |
parent | 41a6aca3e0c6ef899f020673939d2a936d954fa1 (diff) | |
parent | 7cbd0d98c83d9023ec00bca70014326d859a1423 (diff) | |
download | android_packages_apps_Snap-10e960f7d6c940cf6db327d2f68effc441e60ddb.tar.gz android_packages_apps_Snap-10e960f7d6c940cf6db327d2f68effc441e60ddb.tar.bz2 android_packages_apps_Snap-10e960f7d6c940cf6db327d2f68effc441e60ddb.zip |
Merge "Set the thumbnail/screennail sizes based on screensize" into gb-ub-photos-arches
Diffstat (limited to 'src/com/android/gallery3d/ui')
-rw-r--r-- | src/com/android/gallery3d/ui/BitmapScreenNail.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/gallery3d/ui/BitmapScreenNail.java b/src/com/android/gallery3d/ui/BitmapScreenNail.java index 25f88a1e4..9b629160c 100644 --- a/src/com/android/gallery3d/ui/BitmapScreenNail.java +++ b/src/com/android/gallery3d/ui/BitmapScreenNail.java @@ -37,7 +37,7 @@ public class BitmapScreenNail implements ScreenNail { // The duration of the fading animation in milliseconds private static final int DURATION = 180; - private static final int MAX_SIDE = 640; + private static int sMaxSide = 640; // These are special values for mAnimationStartTime private static final long ANIMATION_NOT_NEEDED = -1; @@ -73,10 +73,10 @@ public class BitmapScreenNail implements ScreenNail { private void setSize(int width, int height) { if (width == 0 || height == 0) { - width = 640; - height = 480; + width = sMaxSide; + height = sMaxSide * 3 / 4; } - float scale = Math.min(1, (float) MAX_SIDE / Math.max(width, height)); + float scale = Math.min(1, (float) sMaxSide / Math.max(width, height)); mWidth = Math.round(scale * width); mHeight = Math.round(scale * height); } @@ -209,4 +209,8 @@ public class BitmapScreenNail implements ScreenNail { public TiledTexture getTexture() { return mTexture; } + + public static void setMaxSide(int size) { + sMaxSide = size; + } } |