diff options
| author | Leon Scroggins <scroggo@google.com> | 2009-09-17 12:46:04 -0400 |
|---|---|---|
| committer | Leon Scroggins <scroggo@google.com> | 2009-09-23 15:23:12 -0400 |
| commit | 06ec5f2d8735d1ba17b779deb0f8da032e0a62ea (patch) | |
| tree | c795ff8093b67c26657c8f522d9a87a5dfd7c6c0 /src/com/android/browser/BrowserActivity.java | |
| parent | da0fe556a00773ce2af25eb6dcc5442bd08c7add (diff) | |
| download | packages_apps_Browser-06ec5f2d8735d1ba17b779deb0f8da032e0a62ea.tar.gz packages_apps_Browser-06ec5f2d8735d1ba17b779deb0f8da032e0a62ea.tar.bz2 packages_apps_Browser-06ec5f2d8735d1ba17b779deb0f8da032e0a62ea.zip | |
Tweaks to improve the look of the bookmarks page.
Change the size of the thumbnails for hi dpi. Scale the
thumbnails according to the content width. Make the overlay
on the first item slightly lighter.
See http://b/issue?id=2137041
Change-Id: Ib461459c37ee03d1a6013a404a35c3869a8bb284
Diffstat (limited to 'src/com/android/browser/BrowserActivity.java')
| -rw-r--r-- | src/com/android/browser/BrowserActivity.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index faf0e6b0f..ff8a58931 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -2335,16 +2335,24 @@ public class BrowserActivity extends Activity } } + /** + * Constants for the size of the thumbnail created when taking a screenshot + */ + /* package */ static final int THUMBNAIL_WIDTH = 130; + /* package */ static final int THUMBNAIL_HEIGHT = 104; + private Bitmap createScreenshot(WebView view) { Picture thumbnail = view.capturePicture(); - // Keep width and height in sync with BrowserBookmarksPage - // and bookmark_thumb - Bitmap bm = Bitmap.createBitmap(100, 80, + Bitmap bm = Bitmap.createBitmap(THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT, Bitmap.Config.ARGB_4444); Canvas canvas = new Canvas(bm); // May need to tweak these values to determine what is the // best scale factor - canvas.scale(.5f, .5f); + int contentWidth = view.getContentWidth(); + if (contentWidth > 0) { + float scaleFactor = (float) THUMBNAIL_WIDTH / (float) contentWidth; + canvas.scale(scaleFactor, scaleFactor); + } thumbnail.draw(canvas); return bm; } |
