summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Zhang <chaoz@codeaurora.org>2016-03-17 16:19:36 +0800
committerChao Zhang <chaoz@codeaurora.org>2016-03-17 16:32:24 +0800
commit4653ca910ecdc4a2b65a05debad13ff49f248d0d (patch)
tree7596b5f76b32047f0b0140519d69ff7fa1c1cf6d
parent97b5b5bdf26970e8873ada05de73555a9872c933 (diff)
downloadandroid_packages_apps_Gallery2-4653ca910ecdc4a2b65a05debad13ff49f248d0d.tar.gz
android_packages_apps_Gallery2-4653ca910ecdc4a2b65a05debad13ff49f248d0d.tar.bz2
android_packages_apps_Gallery2-4653ca910ecdc4a2b65a05debad13ff49f248d0d.zip
Gallery2: fix panorama picture display abnormal in list view mode.
Panorama picture's rotation is 90, it will display abnormal if rendered in a rectangle canvas. In list view mode, let content always rendered in a square canvas. Change-Id: Idf5550661f016a9c202a2f2941c4bb93f29afd44 CRs-Fixed: 984855
-rw-r--r--src/com/android/gallery3d/ui/AlbumSlotRenderer.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/ui/AlbumSlotRenderer.java b/src/com/android/gallery3d/ui/AlbumSlotRenderer.java
index 5d4898f10..a4096dc95 100644
--- a/src/com/android/gallery3d/ui/AlbumSlotRenderer.java
+++ b/src/com/android/gallery3d/ui/AlbumSlotRenderer.java
@@ -148,7 +148,14 @@ public class AlbumSlotRenderer extends AbstractSlotRenderer {
content = new FadeInTexture(mPlaceholderColor, entry.bitmapTexture);
entry.content = content;
}
- drawContent(canvas, content, width, height, entry.rotation);
+ if (mIsGridViewShown) {
+ drawContent(canvas, content, width, height, entry.rotation);
+ } else {
+ // In List View, the content is always rendered in to the largest square that fits
+ // inside the slot, aligned to the top of the slot.
+ int minSize = Math.min(width, height);
+ drawContent(canvas, content, minSize, minSize, entry.rotation);
+ }
if ((content instanceof FadeInTexture)
&& ((FadeInTexture) content).isAnimating()) {
renderRequestFlags |= SlotView.RENDER_MORE_FRAME;