summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2010-11-16 17:09:37 -0800
committerJohn Reck <jreck@google.com>2010-11-17 13:43:37 -0800
commitfe49ab43d138ee52c04de77729870daf2a890c46 (patch)
treef45ca1dd8f429415bd80ce31a1e4e63f0a131254
parent8233facddcc51865d612a919d450db6954aa48e3 (diff)
downloadpackages_apps_Browser-fe49ab43d138ee52c04de77729870daf2a890c46.tar.gz
packages_apps_Browser-fe49ab43d138ee52c04de77729870daf2a890c46.tar.bz2
packages_apps_Browser-fe49ab43d138ee52c04de77729870daf2a890c46.zip
Thumbnail asset and algorithm tweak
Bug: 3203597 This update replaces the preloaded thumbnails with the desktop versions of the sites rather than the mobile one. It also corrects the thumbnail generation behavior to prevent stretching. Change-Id: Ic122962496079d4ebf0111585bbcaadf47a06165
-rw-r--r--res/raw/thumb_amazon.pngbin2471 -> 17750 bytes
-rw-r--r--res/raw/thumb_bbc.pngbin14406 -> 11663 bytes
-rw-r--r--res/raw/thumb_cnn.pngbin5440 -> 18956 bytes
-rw-r--r--res/raw/thumb_ebay.pngbin2989 -> 18526 bytes
-rw-r--r--res/raw/thumb_espn.pngbin5127 -> 23367 bytes
-rw-r--r--res/raw/thumb_facebook.pngbin936 -> 10293 bytes
-rw-r--r--res/raw/thumb_google.pngbin5905 -> 4754 bytes
-rw-r--r--res/raw/thumb_msn.pngbin5684 -> 16154 bytes
-rw-r--r--res/raw/thumb_myspace.pngbin1601 -> 22824 bytes
-rw-r--r--res/raw/thumb_picasa.pngbin3889 -> 15064 bytes
-rw-r--r--res/raw/thumb_weatherchannel.pngbin1599 -> 21618 bytes
-rw-r--r--res/raw/thumb_yahoo.pngbin5166 -> 15376 bytes
-rw-r--r--src/com/android/browser/Controller.java18
13 files changed, 8 insertions, 10 deletions
diff --git a/res/raw/thumb_amazon.png b/res/raw/thumb_amazon.png
index eec1d772d..4dd2f35bc 100644
--- a/res/raw/thumb_amazon.png
+++ b/res/raw/thumb_amazon.png
Binary files differ
diff --git a/res/raw/thumb_bbc.png b/res/raw/thumb_bbc.png
index 9cdd90270..dff04248c 100644
--- a/res/raw/thumb_bbc.png
+++ b/res/raw/thumb_bbc.png
Binary files differ
diff --git a/res/raw/thumb_cnn.png b/res/raw/thumb_cnn.png
index 70b7ea2e6..3d6fdc9ac 100644
--- a/res/raw/thumb_cnn.png
+++ b/res/raw/thumb_cnn.png
Binary files differ
diff --git a/res/raw/thumb_ebay.png b/res/raw/thumb_ebay.png
index 070fa6caa..023f67858 100644
--- a/res/raw/thumb_ebay.png
+++ b/res/raw/thumb_ebay.png
Binary files differ
diff --git a/res/raw/thumb_espn.png b/res/raw/thumb_espn.png
index 94918e2ca..c0882ebb9 100644
--- a/res/raw/thumb_espn.png
+++ b/res/raw/thumb_espn.png
Binary files differ
diff --git a/res/raw/thumb_facebook.png b/res/raw/thumb_facebook.png
index 6e295b13c..a8c047f42 100644
--- a/res/raw/thumb_facebook.png
+++ b/res/raw/thumb_facebook.png
Binary files differ
diff --git a/res/raw/thumb_google.png b/res/raw/thumb_google.png
index 17537882a..c54e6ea05 100644
--- a/res/raw/thumb_google.png
+++ b/res/raw/thumb_google.png
Binary files differ
diff --git a/res/raw/thumb_msn.png b/res/raw/thumb_msn.png
index 2240e12ec..4ad710f5c 100644
--- a/res/raw/thumb_msn.png
+++ b/res/raw/thumb_msn.png
Binary files differ
diff --git a/res/raw/thumb_myspace.png b/res/raw/thumb_myspace.png
index 3f39ac5c3..d6f6e76cd 100644
--- a/res/raw/thumb_myspace.png
+++ b/res/raw/thumb_myspace.png
Binary files differ
diff --git a/res/raw/thumb_picasa.png b/res/raw/thumb_picasa.png
index dca6a7d98..5ec2d7ac2 100644
--- a/res/raw/thumb_picasa.png
+++ b/res/raw/thumb_picasa.png
Binary files differ
diff --git a/res/raw/thumb_weatherchannel.png b/res/raw/thumb_weatherchannel.png
index c91e54c7c..a190a0c51 100644
--- a/res/raw/thumb_weatherchannel.png
+++ b/res/raw/thumb_weatherchannel.png
Binary files differ
diff --git a/res/raw/thumb_yahoo.png b/res/raw/thumb_yahoo.png
index 115d8bb20..08dd759b6 100644
--- a/res/raw/thumb_yahoo.png
+++ b/res/raw/thumb_yahoo.png
Binary files differ
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 6b0ab0e44..7d183f6ff 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -1776,25 +1776,23 @@ public class Controller
// best scale factor
int thumbnailWidth = thumbnail.getWidth();
int thumbnailHeight = thumbnail.getHeight();
- float scaleFactorX = 1.0f;
- float scaleFactorY = 1.0f;
+ float scaleFactor = 1.0f;
if (thumbnailWidth > 0) {
- scaleFactorX = (float) width / (float)thumbnailWidth;
+ scaleFactor = (float) width / (float)thumbnailWidth;
} else {
return null;
}
+
if (view.getWidth() > view.getHeight() &&
thumbnailHeight < view.getHeight() && thumbnailHeight > 0) {
// If the device is in landscape and the page is shorter
- // than the height of the view, stretch the thumbnail to fill the
- // space.
- scaleFactorY = (float) height / (float)thumbnailHeight;
- } else {
- // In the portrait case, this looks nice.
- scaleFactorY = scaleFactorX;
+ // than the height of the view, center the thumnail and crop the sides
+ scaleFactor = (float) height / (float)thumbnailHeight;
+ float wx = (thumbnailWidth * scaleFactor) - width;
+ canvas.translate((int) -(wx / 2), 0);
}
- canvas.scale(scaleFactorX, scaleFactorY);
+ canvas.scale(scaleFactor, scaleFactor);
thumbnail.draw(canvas);
return bm;